@innovastudio/contentbox 1.4.6 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ var ContentBox=function(){"use strict";class t{appendHtml(t,e,i="beforeend"){t.i
|
|
10
10
|
License: MIT
|
11
11
|
Copyright (c) 2020 Paweł Kuna
|
12
12
|
https://github.com/tabler/tabler-icons
|
13
|
-
*/let i=!1;function n(t){if(i){var e=window._txt[t];return e||t}return t}"undefined"!=typeof window&&void 0!==window._txt&&(i=!0);class o{constructor(t){const[e,i]=t.children,n=e=>{if(!t)return document.removeEventListener("click",n);t.contains(e.target)||this.toggle(!1)},o=n=>{const o=n.textContent,s=n.getAttribute("data-value");e.textContent=o,this.value=s,this.toggle(!1),t.dispatchEvent(new Event("change")),e.focus();let a=i.children;Array.from(a).map((t=>{t.classList.remove("selected")}));let r=i.querySelector('[data-value="'+s+'"]');r&&r.classList.add("selected")},s=t=>{t.preventDefault(),38===t.keyCode&&t.target.previousElementSibling?t.target.previousElementSibling.focus():40===t.keyCode&&t.target.nextElementSibling?t.target.nextElementSibling.focus():27===t.keyCode?(this.toggle(!1),e.focus()):13!==t.keyCode&&32!==t.keyCode||o(t.target)};e.addEventListener("keydown",(t=>{27===t.keyCode?(this.toggle(!1),t.preventDefault()):13!==t.keyCode&&32!==t.keyCode||(this.toggle(!0),t.preventDefault())})),e.addEventListener("click",(()=>this.toggle())),[...i.children].forEach((t=>{t.addEventListener("keydown",s),t.addEventListener("click",(()=>o(t)))})),this.element=t,this.value=e.getAttribute("data-value"),this.toggle=(o=null)=>{if(o=null===o?"true"!==i.getAttribute("aria-expanded"):o,i.setAttribute("aria-expanded",o),o){e.classList.add("active");let o=i.querySelector('[data-value="'+this.value+'"]');o&&(o.classList.add("selected"),o.focus()),document.addEventListener("click",n),t.dispatchEvent(new Event("opened"))}else e.classList.remove("active"),t.dispatchEvent(new Event("closed")),document.removeEventListener("click",n)}}}const s=new t;class a{constructor(t){this.builder=t;let e="";const i=this.builder.builderStuff;if(this.builderStuff=i,this.builder.useSidebar){e+='<div class="is-sidebar active" style="transform: translate3d(0,0,0);display: flex;flex-direction: column;opacity: 0.0001;">';var o=0;this.builder.sidebarData.buttons.map((t=>{"section"==t.name?e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSections" data-command="section" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon"><use xlink:href="#ion-android-add"></use></svg></button>':"snippet"==t.name?e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSnippets" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon"><use xlink:href="#icon-align-center"></use></svg></button>':"typography"==t.name?this.builder.enableContentStyle&&(e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarTypography" data-command="typography" data-title="'+t.title+'" title="'+t.title+'"><span style="">a</span></button>'):"code"==t.name?this.builder.htmlSyntaxHighlighting?e+='<button class="is-sidebar-button" tabindex="-1" data-command="code" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg></button>':e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSource" data-command="code" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg></button>':"custom1"==t.name?e+='<button class="is-sidebar-button" tabindex="-1" data-content="divCustomSidebarArea1" data-title="'+t.title+'" title="'+t.title+'" data-src="'+t.src+'">'+t.html+"</button>":"custom2"==t.name?e+='<button class="is-sidebar-button" data-content="divCustomSidebarArea2" data-title="'+t.title+'" title="'+t.title+'" data-src="'+t.src+'">'+t.html+"</button>":e+='<button class="is-sidebar-button" tabindex="-1" data-content="'+t.content.substr(1)+'" data-title="'+t.title+'" title="'+t.title+'">'+t.html+"</button>",this.builder.sideButtons&&this.builder.sideButtons.map((t=>{if(o==t.pos){var a=s.uniqueId();e+='<button class="is-sidebar-button" tabindex="-1" data-content="'+a+'" data-src="'+t.src+'" data-title="'+n(t.title)+'" title="'+n(t.title)+'">'+t.html+"</button>";let o='<div id="'+a+'" class="is-sidebar-content '+t.class+'" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div><iframe src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div>';s.appendHtml(i,o)}})),o++})),e+="</div>",e+='<div id="divSidebarSections" class="is-sidebar-content '+this.builder.templateThumbnailSize+'" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div><iframe id="ifrIdeasPanel" src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div><div id="divSidebarSnippets" class="is-sidebar-content scroll-darker" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="max-width:275px;border-left: transparent 50px solid;box-sizing: border-box;"></div><div id="divSidebarSource" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div><div style="position:absolute;width:240px;height:35px;right:10px;top:5px;z-index:1;display:flex;"><button title="'+n("Cancel")+'" id="btnViewHtmlCancel" tabindex="-1" style="height:38px" class="classic-secondary"> '+n("Cancel")+' </button><button title="'+n("Ok")+'" id="btnViewHtmlOk" tabindex="-1" style="height:38px" class="classic-primary"> '+n("Ok")+' </button></div><div style="height:100%;box-sizing:border-box;border-top:#f3f3f3 50px solid;position:relative"><textarea id="inpViewHtml" tabindex="-1" style="width:100%;height:100%;resize: none;"></textarea></div></div></div><div id="divSidebarTypography" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div class="scroll-darker"><div style="padding: 15px 0 0 20px"><div class="is-sidebar-title" style="margin-bottom:12px;">'+n("Typography Styles")+"</div><div>"+n("Apply to")+':</div><div style="display:flex;justify-content:space-between;align-items: center;"><div class="typo-target-default" style="display:flex"><label><input type="radio" tabindex="0" name="typoTarget" value="page"> <span>'+n("Page")+'</span></label><label><input type="radio" tabindex="0" name="typoTarget" value="section" checked> <span>'+n("Section")+'</span></label></div><div class="typo-target-box" style="display: flex;"><span>'+n("Active Box")+'</span></div><button title="'+n("Clear")+'" tabindex="0" id="btnTypoClear"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button></div></div><div id="divSelector"></div><div id="divStyles"></div></div></div><div id="divCustomSidebarArea1" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="max-width:500px;"><div style="padding:0 0 0 50px;box-sizing:border-box;"><iframe id="ifrCustomSidebarArea1" src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div><div id="divCustomSidebarArea2" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="max-width:500px;"><div style="padding:0 0 0 50px;box-sizing:border-box;"><iframe id="ifrCustomSidebarArea2" src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div>'}else e='<div id="divSections" style="display:none"></div><div class="is-modal addsection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width: 900px;"><div id="divSectionList" class="is-section-list"></div></div></div>';if(s.appendHtml(i,e),this.builder.useSidebar){document.querySelectorAll(".is-sidebar .is-sidebar-button").forEach((t=>{t.addEventListener("click",(()=>{let e=!1;if(s.hasClass(t,"active")&&(e=!0),this.closeSidebar(),e)return;let n=t.getAttribute("data-content");if(n){const e=i.querySelector(".is-sidebar-overlay");e&&e.addEventListener("click",(()=>{this.closeSidebar()})),s.addClass(t,"active");const o=document.querySelector("#"+n);o.style.display="block",o.setAttribute("aria-hidden",!1),setTimeout((()=>{if(s.addClass(o,"active"),o.focus(),"divSidebarSnippets"===o.getAttribute("id")){o.querySelector(".selectsnippet .dropdown-toggle").focus()}"divSidebarTypography"===o.getAttribute("id")&&o.focus()}),10)}let o=t.getAttribute("data-command");o&&("section"==o&&this.viewIdeas(),"code"==o&&(this.builder.htmlSyntaxHighlighting?this.viewHtml():this.viewHtml2()),"typography"==o&&(t.setAttribute("data-applyto","page"),i.querySelector(".typo-target-default").style.display="flex",i.querySelector(".typo-target-box").style.display="none",this.viewTypography()));let a=t.getAttribute("data-src");if(a){let e=t.getAttribute("data-content");if("divCustomSidebarArea1"==e){const t=document.querySelector("#ifrCustomSidebarArea1");-1!=t.getAttribute("src").indexOf("blank")&&t.setAttribute("src",a)}else if("divCustomSidebarArea2"==e){const t=document.querySelector("#ifrCustomSidebarArea2");-1!=t.getAttribute("src").indexOf("blank")&&t.setAttribute("src",a)}else{let e=t.getAttribute("data-content");const i=document.querySelector("#"+e);-1!=i.getAttribute("src").indexOf("blank")&&i.setAttribute("src",a)}}}))}));i.querySelector("#btnViewHtmlOk").addEventListener("click",(()=>{this.builder.editor.saveForUndo();var t=i.querySelector("#inpViewHtml").value;t=this.builder.editor.fromViewToActual(t),this.builder.loadHtml(t),this.builder.settings.onChange();const e=document.querySelector(".is-sidebar-overlay");e&&(e.remove(),document.body.style.overflow="",document.body.style.overflowY=""),document.querySelectorAll(".is-sidebar-button.active").forEach((t=>{s.removeClass(t,"active")})),document.querySelectorAll(".is-sidebar-content.active").forEach((t=>{s.removeClass(t,"active")}))}));i.querySelector("#btnViewHtmlCancel").addEventListener("click",(()=>{const t=document.querySelector(".is-sidebar-overlay");t&&(t.remove(),document.body.style.overflow="",document.body.style.overflowY=""),document.querySelectorAll(".is-sidebar-button.active").forEach((t=>{s.removeClass(t,"active")})),document.querySelectorAll(".is-sidebar-content.active").forEach((t=>{s.removeClass(t,"active")}))})),document.querySelector("#btnTypoClear").addEventListener("click",(()=>{this.boxTypography("","","")}));i.querySelectorAll(".is-sidebar-content").forEach((t=>{t.addEventListener("keydown",(t=>{27===t.keyCode&&this.closeSidebar()}))}))}}closeSidebar(){const t=this.builderStuff,e=t.querySelector(".is-sidebar-overlay");e&&(e.remove(),document.body.style.overflowY=""),t.querySelectorAll(".is-sidebar-button.active").forEach((t=>{s.removeClass(t,"active")})),t.querySelectorAll(".is-sidebar > div").forEach((t=>{s.removeClass(t,"active")})),t.querySelectorAll(".is-sidebar-content.active").forEach((t=>{s.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),setTimeout((()=>{t.style.display=""}),300)}))}viewIdeas(){const t=this.builder.designPath,e=this.builder.designUrl1,i=this.builder.designUrl2;if(e&&i){var n=document.querySelector("#ifrIdeasPanel").contentWindow.document;""===n.body.innerHTML&&(n.open(),0===this.builder.templates.length?n.write(this.getTemplatesHtml_OLD()):n.write(this.getTemplatesHtml()),n.close())}else if(t){const e=document.querySelector("#ifrIdeasPanel");-1!=e.getAttribute("src").indexOf("blank")&&e.setAttribute("src",t+"ideas.html")}return!1}viewHtml(){const t=this.builderStuff;var e=this.builder.html(!0);t.querySelector("#inpViewHtml").value=e;let i=t.querySelectorAll("[data-source-active]");i.forEach((t=>{t.removeAttribute("data-source-active")})),i=t.querySelectorAll("[data-source-ok]"),i.forEach((t=>{t.removeAttribute("data-source-ok")})),i=t.querySelectorAll("[data-source-cancel]"),i.forEach((t=>{t.removeAttribute("data-source-cancel")}));let n=t.querySelector("#divSidebarSource textarea");n.setAttribute("data-source-active","1"),n.setAttribute("data-source-ok","#btnViewHtmlOk"),n.setAttribute("data-source-cancel","#btnViewHtmlCancel"),this.builder.editor.viewHtmlNormal()}viewHtml2(){const t=this.builderStuff;let e=this.builder.html(!0);t.querySelector("#inpViewHtml").value=e}viewTypography(){const t=this.builder.settings.contentStylePath,e=this.builder.settings.contentStyles,i=e.data.categories;let s="",a="";for(let t=0;t<i.length;t++)a+='<li role="option" tabindex="0" data-value="'+i[t].id+'">'+n(i[t].desc)+"</li >",-1===i[t].id&&(s=n(i[t].desc));let r='<div class="is-dropdown style-cat" style=""><button tabindex="0" class="dropdown-toggle no-outline" type="button" aria-haspopup="true" data-value="-1"><span>'+s+'</span></button><ul class="dropdown-menu" role="listbox" aria-expanded="false">'+a+"</ul></div>";function l(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}document.querySelector("#divSelector").innerHTML=r;const d=new o(document.querySelector(".style-cat"));d.element.addEventListener("change",(()=>{let i=d.value,n=e.data.styles,o="";if(-1==i)for(let e=0;e<n.length;e++)o+='<div data-css="'+n[e].css+'" data-sectioncss="'+n[e].sectioncss+'" data-classname="'+n[e].classname+'"><div>['+(e+1)+"] "+n[e].caption+'</div><img src="'+t+n[e].img+'" /><span class="is-overlay"></span></div></div>';else for(let e=0;e<n.length;e++)i==n[e].category&&(o+='<div data-css="'+n[e].css+'" data-sectioncss="'+n[e].sectioncss+'" data-classname="'+n[e].classname+'"><div>['+(e+1)+"] "+n[e].caption+'</div><img src="'+t+n[e].img+'" /><span class="is-overlay"></span></div></div>');let s=document.querySelector("#divStyles");s.innerHTML=o,l(s).forEach((t=>{t.addEventListener("click",(()=>{this.boxTypography(t.getAttribute("data-classname"),t.getAttribute("data-sectioncss"),t.getAttribute("data-css"))}))}))}));for(var c=e.data.styles,u="",p=0;p<c.length;p++)u+='<div data-css="'+c[p].css+'" data-sectioncss="'+c[p].sectioncss+'" data-classname="'+c[p].classname+'"><div>['+(p+1)+"] "+c[p].caption+'</div><img src="'+t+c[p].img+'" /><span class="is-overlay"></span></div></div>';var h=document.querySelector("#divStyles");h.innerHTML=u,l(h).forEach((t=>{t.addEventListener("click",(()=>{this.boxTypography(t.getAttribute("data-classname"),t.getAttribute("data-sectioncss"),t.getAttribute("data-css"))}))}))}boxTypography(t,e,i){const n=this.builder.builderStuff;this.builder.editor.saveForUndo();const o=this.builder.settings.contentStylePath;let a=n.querySelector('.is-sidebar > button[data-command="typography"]').getAttribute("data-applyto"),r=document.querySelector('input[name="typoTarget"]:checked').value;if("box"!==a)if("section"===r){let i=this.builder.activeSection;if(!i)return;if(i.getAttribute("class").split(/\s+/).forEach((t=>{-1!=t.indexOf("type-")&&s.removeClass(i,t)})),i.querySelectorAll(".is-box, .is-box-centered").forEach((t=>{t.getAttribute("class").split(/\s+/).forEach((e=>{-1!=e.indexOf("type-")&&s.removeClass(t,e)}))})),""!==t){s.addClass(i,t);let n=!1,a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++){-1!=a[t].href.toLowerCase().indexOf(e.toLowerCase())&&(n=!0)}n||(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'))}let n=document.getElementsByTagName("link");for(let t=0;t<n.length;t++)if("contentstyle"===n[t].getAttribute("data-name")){let e=n[t].getAttribute("data-class");this.builder.wrapperEl.querySelector("."+e)||n[t].setAttribute("data-rel","_del")}document.querySelectorAll('[data-rel="_del"]').forEach((t=>{t.parentNode.removeChild(t)}))}else if("page"===r){let t=document.getElementsByTagName("link");for(let e=0;e<t.length;e++)if("contentstyle"===t[e].getAttribute("data-name")){let i=t[e].getAttribute("data-class");if(this.builder.wrapperEl.querySelector("."+i)){this.builder.wrapperEl.querySelectorAll("."+i).forEach((t=>{s.removeClass(t,i)})),t[e].setAttribute("data-rel","_del")}}let e=document.querySelectorAll('[data-rel="_del"]');e.forEach((t=>{t.parentNode.removeChild(t)})),t=document.getElementsByTagName("link");for(let e=0;e<t.length;e++){-1!=t[e].href.toLowerCase().indexOf("basetype-")&&t[e].setAttribute("data-rel","_del")}e=document.querySelectorAll('[data-rel="_del"]'),e.forEach((t=>{t.parentNode.removeChild(t)})),""!=i&&(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link href="'+o+i+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link href="'+o+i+'" rel="stylesheet">'))}else if("container"===r){let i=document.querySelector(".builder-active");if(!i)return;let n=s.parentsHasClass(i,"is-box");if(n.getAttribute("class").split(/\s+/).forEach((t=>{-1!=t.indexOf("type-")&&s.removeClass(n,t)})),""!==t){s.addClass(n,t);let i=!1,a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++){-1!=a[t].href.toLowerCase().indexOf(e.toLowerCase())&&(i=!0)}i||(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'))}let a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++)if("contentstyle"===a[t].getAttribute("data-name")){let e=a[t].getAttribute("data-class");this.builder.wrapperEl.querySelector("."+e)||a[t].setAttribute("data-rel","_del")}document.querySelectorAll('[data-rel="_del"]').forEach((t=>{t.parentNode.removeChild(t)}))}if("box"===a){let i=this.builder.activeBox;if(i){if(i.getAttribute("class").split(/\s+/).forEach((t=>{-1!=t.indexOf("type-")&&s.removeClass(i,t)})),""!==t){s.addClass(i,t);let n=!1,a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++){-1!=a[t].href.toLowerCase().indexOf(e.toLowerCase())&&(n=!0)}n||(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'))}let n=document.getElementsByTagName("link");for(let t=0;t<n.length;t++)if("contentstyle"===n[t].getAttribute("data-name")){let e=n[t].getAttribute("data-class");this.builder.wrapperEl.querySelector("."+e)||n[t].setAttribute("data-rel","_del")}document.querySelectorAll('[data-rel="_del"]').forEach((t=>{t.parentNode.removeChild(t)}))}}this.builder.settings.onChange()}getTemplatesHtml(){let t="";this.builder.templateJSON.forEach((e=>{t+=`{\n url: '${e.url}',\n path: '${e.path}',\n pathReplace: '${e.pathReplace}',\n },`}));let e="";this.builder.templates.forEach((t=>{e+=`{\n url: '${t.url}',\n path: '${t.path}',\n pathReplace: '${t.pathReplace}',\n },`}));let i="";this.builder.featuredCategories.forEach((t=>{i+=`{\n id: '${t.id}',\n name: '${t.name}',\n },`}));let n="",o="",s="";"small"===this.builder.templateThumbnailSize?(n="250px",o="30px 0 0 30px",s="513px"):"medium"===this.builder.templateThumbnailSize?(n="350px",o="40px 0 0 40px",s="214px"):(n="450px",o="50px 0 0 50px",s="275");let a=`\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Browse</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#" />\n <style>\n body {\n margin: 0;\n background: #fff;\n font-family: sans-serif;\n font-weight: 300;\n }\n h2 {\n font-weight: 300;\n }\n button {\n cursor: pointer;\n border: none;\n background: #fdfdfd;\n padding: 12px 25px;\n border-radius: 500px;\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 1px;;\n color: #333;\n }\n button.on {\n background: #f5f5f5;\n }\n \n .featured-categories {\n background-color: #f5f5f5;\n position: absolute;\n width: 100%;\n height: 88px;\n z-index: 1;\n padding: 14px 15px 0 25px;\n box-sizing: border-box;\n /* box-shadow: 0 5px 15px rgb(0 0 0 / 5%); */\n }\n .featured-categories button {\n margin: 10px 15px 0 0;\n font-size: 11px;\n }\n \n .is-design-list {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 88px solid;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n padding: 0px 0px 30px 0px;\n box-sizing: border-box;\n overflow: auto;\n transition: all 200ms ease;\n }\n .is-design-list > button {\n position: relative;\n width: ${n};\n max-height: ${s};\n overflow: hidden;\n margin: ${o};\n cursor: pointer;\n display: inline-block;\n padding: 0px;\n border: rgba(219, 219, 219, 0.39) 1px solid;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n }\n .is-design-list > button img {\n box-shadow: none;\n opacity: 1;\n display: block;\n box-sizing: border-box;\n transition: all 0.2s ease-in-out;\n max-width: 500px;\n width: 100%\n }\n .is-design-list > button .is-overlay {\n position: absolute;\n top:0px;\n left:0px;\n width:100%;\n height:100%;\n }\n .is-design-list > button .is-overlay:after {\n background: rgba(0, 0, 0, 0.05);\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transition: all 0.2s ease-in-out;\n opacity: 0;\n }\n .is-design-list > button:hover .is-overlay:after {\n opacity: 0.5;\n }\n \n .mega-menu {\n display: none;\n transform: translateY(-100%);\n background: #f5f5f5;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 88px;\n left: 0;\n right: 0;\n width: 100%;\n height: auto;\n z-index: 1;\n padding: 10px 50px 40px 40px;\n box-sizing: border-box;\n transition: all 300ms ease;\n min-width:400px;\n min-height: 200px;\n /* box-shadow: 0 5px 15px rgb(0 0 0 / 5%); */\n }\n .mega-menu.active {\n opacity: 1;\n transform: scale(1);\n transform: translateY(0);\n }\n .mega-menu h2 {\n margin-top:30px;\n font-size: 21px\n }\n .mega-menu button {\n margin:15px 15px 0 0;\n }\n .mega-menu .close {\n position: absolute;\n top: 0px; right: 0px;\n background: transparent;\n width: 50px;\n height: 50px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 2px;;\n }\n\n .is-waiting {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 88px solid;\n width: 100%;\n height: 100%;\n background-color: #fff;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n padding: 50px\n }\n .is-waiting2 {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n background-color: #f5f5f5;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n padding: 20px 50px;\n }\n </style>\n </head>\n <body style="touch-action: pan-y">`;return a+=`\n <div class="mega-menu">\n <div class="is-waiting2">\n <div style="color:rgba(125, 125, 125, 0.5)" class="loader loader--style2" title="1">\n <svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">\n <path fill="currentColor" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z">\n <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.7s" repeatCount="indefinite"></animateTransform>\n </path>\n </svg>\n </div> \n </div>\n \n <button class="close" tabindex="0"><svg style="width:40px;height:40px;flex:none;"><use xlink:href="#iconclose"></use></svg></button>\n \n <div class="mega-menu-content">\n </div>\n </div>\n \n <div class="featured-categories">\n </div>\n \n <div class="is-design-list">\n </div>\n \n <div class="is-waiting">\n <div style="color:rgba(125, 125, 125, 0.5)" class="loader loader--style2" title="1">\n <svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">\n <path fill="currentColor" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z">\n <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.7s" repeatCount="indefinite"></animateTransform>\n </path>\n </svg>\n </div> \n </div>\n \n <svg width="0" height="0" style="position:absolute;display:none;">\n <defs>\n <symbol viewBox="0 0 24 24" id="iconclose" stroke-width="0.7" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="none" d="M0 0h24v24H0z" fill="none"></path><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>\n </symbol>\n </defs>\n </svg>\n \n <script>\n var template_list = [];\n <\/script>\n \x3c!-- <script src="basic.js" type="text/javascript"><\/script>\n <script src="examples.js" type="text/javascript"><\/script> --\x3e\n \n <script>\n \n // Configuration\n const featuredCategories = [\n ${i}\n ];\n const defaultCat = ${this.builder.defaultDesignCategory};\n const navbar = ${this.builder.navbar?"true":"false"};\n\n const slider = '${this.builder.slider}';\n\n const framework = '${this.builder.framework}'; \n const contentStylePath = '${this.builder.contentStylePath}'; \n \n let templates = [\n ${e}\n ];\n \n let templateJSON = [\n ${t}\n ];\n // /Configuration\n\n if(templates.length > 0) templateJSON = [...templates];\n \n const loadJsFiles = (list, callback) => {\n if(list.length===0) {\n return;\n } else {\n const url = list[0].url;\n const script = document.createElement('script');\n script.src = url; \n script.async = true;\n script.onload = () => {\n callback(list[0]);\n loadJsFiles(list.slice(1), callback);\n };\n document.body.appendChild(script);\n } \n }\n \n const imageObserver = new IntersectionObserver((entries, imgObserver) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const lazyImage = entry.target\n // console.log("lazy loading ", lazyImage)\n lazyImage.src = lazyImage.dataset.src\n lazyImage.classList.remove("lzy-img");\n imgObserver.unobserve(lazyImage);\n }\n })\n });\n \n const makeid = () => { //http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript\n var text = "";\n var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";\n for (var i = 0; i < 2; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n \n var text2 = "";\n var possible2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";\n for (var i = 0; i < 5; i++)\n text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));\n \n return text + text2;\n }\n \n const addDesign = (designid) => {\n\n const wrapper = parent._cb.doc.querySelector('.is-wrapper');\n \n let nIndex = 0;\n template_list.forEach(gallery=>{\n let designs = gallery.designs;\n designs.forEach(item=>{\n \n item.id = nIndex; //Give id\n \n if(nIndex===parseInt(designid)) {\n // alert(item.html);\n // alert(gallery.path);\n // alert(gallery.pathReplace);\n\n let html = item.html;\n let googleFonts = item.googleFonts;\n let contentCss = item.contentCss;\n let contentClass = item.contentClass;\n \n let designPath = gallery.path;\n let snippetPathReplace = gallery.pathReplace;\n \n //To Tailwind\n if (framework == 'tailwind') {\n html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'flex flex-col md:flex-row');\n html = html.replace(new RegExp('column full', 'g'), 'w-full px-4');\n html = html.replace(new RegExp('column half', 'g'), 'w-full md:w-6/12 px-4');\n html = html.replace(new RegExp('column third', 'g'), 'w-full md:w-4/12 px-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'w-full md:w-3/12 px-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'w-full md:w-2/12 px-4'); //not needed\n html = html.replace(new RegExp('column sixth', 'g'), 'w-full md:w-2/12 px-4');\n html = html.replace(new RegExp('column two-third', 'g'), 'w-full md:w-8/12 px-4');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'w-full md:w-9/12 px-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'w-full md:w-10/12 px-4');\n }\n \n //To Bootstrap\n if (framework == 'bootstrap') {\n html = html.replace(new RegExp(' container', 'g'), ' container-fluid');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'col-md-12');\n html = html.replace(new RegExp('column half', 'g'), 'col-md-6');\n html = html.replace(new RegExp('column third', 'g'), 'col-md-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'col-md-3');\n html = html.replace(new RegExp('column fifth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column sixth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column two-third', 'g'), 'col-md-8');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'col-md-9');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'col-md-10');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'btn btn-primary btn-lg');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'btn btn-default btn-lg');\n }`,a+="\n //To Foundation\n if (framework == 'foundation') {\n //html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'large-12 columns');\n html = html.replace(new RegExp('column half', 'g'), 'large-6 columns');\n html = html.replace(new RegExp('column third', 'g'), 'large-4 columns');\n html = html.replace(new RegExp('column fourth', 'g'), 'large-3 columns');\n html = html.replace(new RegExp('column fifth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column sixth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column two-third', 'g'), 'large-8 columns');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'large-9 columns');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'large-10 columns');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'button');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'secondary button');\n }\n \n //To UIKit\n if (framework == 'uikit') {\n html = html.replace(new RegExp(' container', 'g'), ' uk-container uk-container-center');\n html = html.replace(new RegExp('row clearfix', 'g'), 'uk-grid');\n html = html.replace(new RegExp('column full', 'g'), 'uk-width-1-1');\n html = html.replace(new RegExp('column half', 'g'), 'uk-width-1-2');\n html = html.replace(new RegExp('column third', 'g'), 'uk-width-1-3');\n html = html.replace(new RegExp('column fourth', 'g'), 'uk-width-1-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'uk-width-1-5');\n html = html.replace(new RegExp('column sixth', 'g'), 'uk-width-1-6');\n html = html.replace(new RegExp('column two-third', 'g'), 'uk-width-2-3');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'uk-width-3-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'uk-width-5-6');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'uk-button uk-button-primary uk-button-large');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'uk-button uk-button-large');\n }\n \n //To Material\n if (framework == 'material') {\n html = html.replace(new RegExp(' container', 'g'), '');\n html = html.replace(new RegExp('row clearfix', 'g'), 'mdl-grid');\n html = html.replace(new RegExp('column full', 'g'), 'mdl-cell mdl-cell--12-col');\n html = html.replace(new RegExp('column half', 'g'), 'mdl-cell mdl-cell--6-col');\n html = html.replace(new RegExp('column third', 'g'), 'mdl-cell mdl-cell--4-col');\n html = html.replace(new RegExp('column fourth', 'g'), 'mdl-cell mdl-cell--3-col');\n html = html.replace(new RegExp('column fifth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column sixth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column two-third', 'g'), 'mdl-cell mdl-cell--8-col');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'mdl-cell mdl-cell--9-col');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'mdl-cell mdl-cell--10-col');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'mdl-button mdl-js-button mdl-button--raised mdl-button--accent');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'mdl-button mdl-js-button mdl-button--raised');\n }\n \n html = html.replace(/{id}/g, makeid());\n\n if(snippetPathReplace.length>0) {\n if (snippetPathReplace[0] != '') {\n var regex = new RegExp(snippetPathReplace[0], 'g');\n html = html.replace(regex, snippetPathReplace[1]);\n }\n }\n \n html = html.replace(/\\[%IMAGE_PATH%\\]/g, designPath);\n html = html.replace(/%5B%25IMAGE_PATH%25%5D/g, designPath); //If [%IMAGE_PATH%] is encoded (inside data-html)\n\n //Add html\n parent.contentbox.addIdea(html);\n \n //Add contentCss\n let exist = false;\n let links = parent._cb.doc.getElementsByTagName(\"link\");\n for (let i = 0; i < links.length; i++) {\n let src = links[i].href.toLowerCase();\n if (src.indexOf(contentCss.toLowerCase()) != -1) exist = true;\n }\n \n if (!exist) wrapper.insertAdjacentHTML('beforeend', '<link data-name=\"contentstyle\" data-class=\"' + contentClass + '\" href=\"' + contentStylePath + contentCss + '\" rel=\"stylesheet\">');\n }\n \n nIndex++;\n });\n });\n }\n \n const showDesigns = (catId) => {\n\n if(template_list.length>0) {\n const wait = document.querySelector('.is-waiting');\n wait.style.display = 'none';\n }\n \n const designList = document.querySelector('.is-design-list');\n designList.style.opacity = 0;\n setTimeout(()=>{\n designList.innerHTML = '';\n designList.style.opacity = 1;\n \n let nIndex = 0;\n \n template_list.forEach(gallery=>{\n let designs = gallery.designs;\n designs.forEach(item=>{\n let isSelected = false;\n let catSplit = item.category.split(',');\n for (let j = 0; j < catSplit.length; j++) {\n if (parseInt(catSplit[j]) === parseInt(catId)) {\n isSelected = true;\n }\n }\n \n item.id = nIndex; //Give id\n \n if (isSelected) {\n \n let html = '<button tabindex=\"0\" class=\"active\" data-id=\"' + item.id + '\" data-cat=\"\"' + item.category + '\">' +\n '<img class=\"lzy-img\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAK5GlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUE1kXgN/MpBdaIAJSQm+CdAJICT2AgHQQlZCEJJQQUlCxK4sruBZURLCs6EpTcHUFZC2IBdsioNh1QRYVdV0s2FDZAX7C7v7n///z33PuvG/u3HffvXPeO+c+AKgpHIkkC1YDIFssl0YH+zESk5IZ+McABxBARpXG4cokrKiocIDK5Ph3eXcTQGPjdduxWP/+/b+KBo8v4wIApaCcxpNxs1FuRfUrVyKVA4CgDEwWyiVj/BvKmlI0QZQ/jLFgnDGUMU6bYMa4T2y0P8rOABAoHI5UAADFF7Uz8rgCNA4lFWV7MU8kRnkTyt5cIYeHcifKM7Kzc8b4M8qWqL8EAKopysy0v8QU/C1+mjI+hyNQ8kRd40IIEMkkWZzF/+ev+d+SnaWYXMMcVYpQGhI9wdDtzJwwJYvTIiInWcSb9IduCxUhcZPMlfknTzKPExCmnJsVET7J6aIgtjKOnB07yXxZYMwkS3OilWulS/1Zk8yRTq2ryIxT2oV8tjJ+vjA2YZLzRPERkyzLjAmb8vFX2qWKaGX+fHGw39S6Qcras2V/qVfEVs6VC2NDlLVzpvLni1lTMWWJytx4/IDAKZ84pb9E7qdcS5IVpfTnZwUr7bK8GOVcObo5p+ZGKf9hBic0apJBLBACBRADHuADKUgDOSALyAEDBAARkAEJ+sYB6HaS8xfJx4rzz5EslooEQjmDhZ5APoMt5trNYDjaOzoCMHaeJ7bIG/r4OYXol6dsua0AuBehRsGUjWMCwPHHANDeTdlMXk+clZOdXIU0b8KGGXtgAQmoAk2gAwyACbAEtsARuAJP4AsCQSiIRCtJAvMBF60nG61kIVgKVoFCUAw2gW2gHOwB+0A1OASOgCZwApwBF8AV0Al6wD3QCwbAczAE3oERCILwEBWiQTqQIWQG2UCOEBPyhgKhcCgaSoJSIQEkhhTQUmgNVAyVQOXQXqgG+hE6Dp2BLkFd0B2oDxqEXkOfYASmwJqwPmwOz4SZMAsOg2PhebAAzoXz4QJ4A1wGV8IH4Ub4DHwF7oF74efwMAIQMkJHjBBbhIn4I5FIMpKOSJHlSBFSilQi9UgL0o5cR3qRF8hHDA5DwzAwthhPTAgmDsPF5GKWY9ZjyjHVmEbMOcx1TB9mCPMVS8XqYW2wHlg2NhErwC7EFmJLsQewx7DnsT3YAew7HA5Hx1ng3HAhuCRcBm4Jbj1uF64B14rrwvXjhvF4vA7eBu+Fj8Rz8HJ8IX4H/iD+NL4bP4D/QCATDAmOhCBCMkFMWE0oJdQSThG6CU8II0Q1ohnRgxhJ5BEXEzcS9xNbiNeIA8QRkjrJguRFiiVlkFaRykj1pPOk+6Q3ZDLZmOxOnkMWkVeSy8iHyRfJfeSPFA2KNcWfkkJRUDZQqiitlDuUN1Qq1ZzqS02myqkbqDXUs9SH1A8qNBU7FbYKT2WFSoVKo0q3yktVoqqZKkt1vmq+aqnqUdVrqi/UiGrmav5qHLXlahVqx9VuqQ2r09Qd1CPVs9XXq9eqX1J/qoHXMNcI1OBpFGjs0zir0U9DaCY0fxqXtoa2n3aeNqCJ07TQZGtmaBZrHtLs0BzS0tBy1orXWqRVoXVSq5eO0M3pbHoWfSP9CP0m/dM0/Wmsafxp66bVT+ue9l57uravNl+7SLtBu0f7kw5DJ1AnU2ezTpPOA12MrrXuHN2Furt1z+u+mK453XM6d3rR9CPT7+rBetZ60XpL9PbpXdUb1jfQD9aX6O/QP6v/woBu4GuQYbDV4JTBoCHN0NtQZLjV8LThM4YWg8XIYpQxzjGGjPSMQowURnuNOoxGjC2M44xXGzcYPzAhmTBN0k22mrSZDJkams42XWpaZ3rXjGjGNBOabTdrN3tvbmGeYL7WvMn8qYW2Bdsi36LO4r4l1dLHMtey0vKGFc6KaZVptcuq0xq2drEWWldYX7OBbVxtRDa7bLpmYGe4zxDPqJxxy5Ziy7LNs62z7bOj24XbrbZrsns503Rm8szNM9tnfrV3sc+y329/z0HDIdRhtUOLw2tHa0euY4XjDSeqU5DTCqdmp1fONs58593Ot11oLrNd1rq0uXxxdXOVuta7DrqZuqW67XS7xdRkRjHXMy+6Y9393Fe4n3D/6OHqIfc44vGHp61npmet59NZFrP4s/bP6vcy9uJ47fXq9WZ4p3p/793rY+TD8an0eeRr4svzPeD7hGXFymAdZL30s/eT+h3ze+/v4b/MvzUACQgOKAroCNQIjAssD3wYZBwkCKoLGgp2CV4S3BqCDQkL2Rxyi63P5rJr2EOhbqHLQs+FUcJiwsrDHoVbh0vDW2bDs0Nnb5l9P8IsQhzRFAki2ZFbIh9EWUTlRv08Bzcnak7FnMfRDtFLo9tjaDELYmpj3sX6xW6MvRdnGaeIa4tXjU+Jr4l/nxCQUJLQmzgzcVnilSTdJFFSczI+OT75QPLw3MC52+YOpLikFKbcnGcxb9G8S/N152fNP7lAdQFnwdFUbGpCam3qZ04kp5IznMZO25k2xPXnbuc+5/nytvIG+V78Ev6TdK/0kvSnAi/BFsGg0EdYKnwh8heVi15lhGTsyXifGZlZlTmalZDVkE3ITs0+LtYQZ4rP5RjkLMrpkthICiW9uR6523KHpGHSAzJINk/WLNdEG6erCkvFN4q+PO+8irwPC+MXHl2kvki86Opi68XrFj/JD8r/YQlmCXdJ21KjpauW9i1jLdu7HFqetrxthcmKghUDK4NXVq8ircpc9ctq+9Ulq9+uSVjTUqBfsLKg/5vgb+oKVQqlhbfWeq7d8y3mW9G3Heuc1u1Y97WIV3S52L64tPjzeu76y985fFf23eiG9A0dG1037t6E2yTedHOzz+bqEvWS/JL+LbO3NG5lbC3a+nbbgm2XSp1L92wnbVds7y0LL2veYbpj047P5cLyngq/ioadejvX7Xy/i7ere7fv7vo9+nuK93z6XvT97b3BexsrzStL9+H25e17vD9+f/sPzB9qDugeKD7wpUpc1VsdXX2uxq2mplavdmMdXKeoGzyYcrDzUMCh5nrb+r0N9Ibiw+Cw4vCzH1N/vHkk7EjbUebR+p/Mftp5jHasqBFqXNw41CRs6m1Oau46Hnq8rcWz5djPdj9XnTA6UXFS6+TGU6RTBadGT+efHm6VtL44IzjT37ag7d7ZxLM3zs0513E+7PzFC0EXzraz2k9f9Lp44pLHpeOXmZebrrheabzqcvXYLy6/HOtw7Wi85natudO9s6VrVtepbp/uM9cDrl+4wb5xpSeip+tm3M3bt1Ju9d7m3X56J+vOq7t5d0furbyPvV/0QO1B6UO9h5W/Wv3a0Ovae7IvoO/qo5hH9/q5/c9/k/32eaDgMfVx6RPDJzVPHZ+eGAwa7Hw299nAc8nzkReFv6v/vvOl5cuf/vD94+pQ4tDAK+mr0dfr3+i8qXrr/LZtOGr44bvsdyPviz7ofKj+yPzY/inh05ORhZ/xn8u+WH1p+Rr29f5o9uiohCPljLcCCKpwejoAr6vQfjkJ7R3QXpo0d6LfHhdo4o4wTuA/8URPPi6uAFT5AhC3EoBwtEfZjaoZyhR0HGuTYn0B7OSk1H+JLN3JcSIWBe02sR9GR9/oA4BvAeCLdHR0ZNfo6Jf9aLJ3AGjNnejzxwSH3n5KLLQpUOu1iE324B8ycQf4S43/HIEyg7+NfwKKiCGaEdH2dAAAAFZlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA5KGAAcAAAASAAAARKACAAQAAAABAAAAEKADAAQAAAABAAAAEAAAAABBU0NJSQAAAFNjcmVlbnNob3Q3CVDhAAAB1GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xNjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xNjwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlVzZXJDb21tZW50PlNjcmVlbnNob3Q8L2V4aWY6VXNlckNvbW1lbnQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpzPGLtAAAAIklEQVQ4EWP8DwQMFAAmCvSCtY4awMAwGgajYQDKDAOfDgBrygQcINQZEQAAAABJRU5ErkJggg==\" data-src=\"' + gallery.path + item.thumbnail + '\">' +\n '<span class=\"is-overlay\"></span>' +\n '</button>';\n \n if(item.type === 'glide' || item.type === 'slick') {\n if(slider==='glide') {\n if(item.type === 'glide') {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n } \n } else if(slider==='slick') {\n if(item.type === 'slick') {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n } \n } else if(slider==='all') {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n } \n } else if(item.type === 'navbar' ) {\n if(navbar) {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n }\n } else {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n }\n }",a+="\n nIndex++;\n });\n });\n \n const arr = document.querySelectorAll('img.lzy-img')\n arr.forEach((v) => {\n imageObserver.observe(v);\n });\n \n closeMegaMenu();\n \n }, 200);\n \n // Set active Button\n const menu = document.querySelector('.mega-menu');\n menu.setAttribute('data-active-cat', catId);\n const featuredCat = document.querySelector('.featured-categories');\n const btnActive1 = menu.querySelector('button.on');\n const btnActive2 = featuredCat.querySelector('button.on');\n if(btnActive1) btnActive1.classList.remove('on');\n if(btnActive2) btnActive2.classList.remove('on');\n const btn1 = menu.querySelector('[data-cat=\"' + catId + '\"]');\n const btn2 = featuredCat.querySelector('[data-cat=\"' + catId + '\"]');\n if(btn1) btn1.classList.add('on');\n if(btn2) btn2.classList.add('on');\n }\n \n const renderMegaMenu = () => {\n \n if(template_list.length>0) {\n const wait2 = document.querySelector('.is-waiting2');\n wait2.style.display = 'none';\n }\n\n const menu = document.querySelector('.mega-menu');\n const menuContent = document.querySelector('.mega-menu-content');\n menuContent.innerHTML = '';\n \n let catNum = 0;\n template_list.forEach(gallery=>{\n let categories = gallery.categories;\n let html = '<h2>' + gallery.name + '</h2><div class=\"cat' +catNum+ '\"></div>';\n menuContent.insertAdjacentHTML('beforeend', html);\n const catList = menuContent.querySelector('.cat'+catNum);\n categories.forEach(categoryItem=>{\n let html= '<button data-cat=\"'+categoryItem.id+'\">'+categoryItem.name+'</button>';\n catList.insertAdjacentHTML('beforeend', html);\n const btn = catList.querySelector('[data-cat=\"'+categoryItem.id+'\"]');\n btn.addEventListener('click', (e)=>{\n const catId = btn.getAttribute('data-cat');\n showDesigns(catId);\n \n closeMegaMenu();\n });\n });\n \n catNum++;\n });\n \n // Set active Button\n const catId = menu.getAttribute('data-active-cat');\n if(catId) {\n const btnActive = menu.querySelector('button.on');\n if(btnActive) btnActive.classList.remove('on');\n const btn = menu.querySelector('[data-cat=\"' + catId + '\"]');\n if(btn) btn.classList.add('on');\n }\n }\n \n const handleClick = (e) => {\n if(!e.target.closest('.mega-menu') && !e.target.closest('[data-cat=\"0\"]')) { \n closeMegaMenu();\n }\n };\n \n const showMegaMenu = () => {\n const menu = document.querySelector('.mega-menu');\n menu.style.display = 'block';\n setTimeout(()=>{\n menu.classList.add('active');\n const menuClose = menu.querySelector('.close');\n menuClose.focus();\n }, 10);\n const btn = document.querySelector('[data-cat=\"0\"]');\n btn.classList.add('on');\n \n document.addEventListener('click', handleClick); // handleClick\n }\n \n const closeMegaMenu = () => {\n const menu = document.querySelector('.mega-menu.active');\n if(!menu) return;\n menu.classList.remove('active');\n setTimeout(()=>{\n menu.style.display = '';\n }, 300);\n const btn = document.querySelector('[data-cat=\"0\"]');\n btn.classList.remove('on');\n \n document.removeEventListener('keydown', handleClick); // handleClick\n }\n \n const renderResize = () => {\n const btns = document.querySelectorAll('.featured-categories button');\n let viewportWidth = document.body.clientWidth;\n if(viewportWidth < 1024 && viewportWidth>=800) {\n let n = 0;\n btns.forEach(btn=>{\n if(n>=5) {\n btns[n].style.display = 'none';\n } else {\n btns[n].style.display = '';\n }\n n++;\n });\n } else if(viewportWidth < 800) {\n let n = 0;\n btns.forEach(btn=>{\n if(n>=2) {\n btns[n].style.display = 'none';\n } else {\n btns[n].style.display = '';\n }\n n++;\n });\n } else {\n let n = 0;\n btns.forEach(btn=>{\n btns[n].style.display = '';\n n++;\n });\n }\n btns[btns.length-1].style.display = '';\n };\n\n const renderFeaturedCategories= () => {\n let html = '';\n const div = document.querySelector('.featured-categories');\n featuredCategories.forEach(item=>{\n html += '<button data-cat=\"'+item.id+'\">'+item.name+'</button>';\n });\n html += '<button data-cat=\"0\">All Categories</button>';\n div.insertAdjacentHTML('beforeend', html);\n \n const menu = document.querySelector('.mega-menu');\n const btns = div.querySelectorAll('[data-cat]');\n btns.forEach(btn=>{\n btn.addEventListener('click', (e)=>{\n const catId = btn.getAttribute('data-cat');\n if(catId==='0') {\n // Show All Categories' Mega Menu\n showMegaMenu();\n } else {\n showDesigns(catId);\n }\n });\n });",a+="\n const menuClose = menu.querySelector('.close');\n menuClose.addEventListener('click',()=>{\n closeMegaMenu();\n });\n\n renderResize();\n }\n \n document.addEventListener(\"DOMContentLoaded\", function() {\n \n renderFeaturedCategories();\n \n const wait = document.querySelector('.is-waiting');\n wait.style.display = 'flex';\n const wait2 = document.querySelector('.is-waiting2');\n wait2.style.display = 'flex';\n\n renderMegaMenu();\n \n showDesigns(defaultCat); // If not ready (not loaded yet) will show empty\n \n loadJsFiles(templateJSON, (template)=>{\n // console.log(template)\n const templateAdded = template_list[template_list.length-1];\n templateAdded.path = template.path;\n templateAdded.pathReplace = template.pathReplace;\n // console.log(templateAdded);\n \n renderMegaMenu();\n \n const designList = document.querySelector('.is-design-list');\n if(designList.innerHTML.trim()==='') { // first load\n const cats = templateAdded.categories;\n cats.forEach(cat=>{\n if(parseInt(cat.id)===defaultCat) {\n showDesigns(defaultCat);\n }\n });\n }\n });\n })\n \n \n document.addEventListener('keydown', (e)=>{\n if(e.keyCode === 27) { // escape key\n \n const menu = document.querySelector('.mega-menu.active');\n if(menu) {\n closeMegaMenu();\n \n e.preventDefault();\n return;\n } \n }\n });\n\n window.addEventListener('resize', ()=>{\n renderResize();\n });\n\n applyParentStyles();\n \n // Style stuff\n function applyParentStyles() {\n var cssString = '' +\n 'body {' +\n 'background: ' + parent._cb.styleSnippetBackground + ';' +\n 'color: ' + parent._cb.styleSnippetColor + ';' +\n 'margin: 0;' +\n '}' +\n\n 'button {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackground + ';' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n '}' +\n 'button.on {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackgroundActive + ';' +\n '}' +\n '.featured-categories {' +\n 'background-color: ' + parent._cb.styleSnippetTabsBackground + ';' +\n '}' +\n\n '.dark .is-design-list > button {' +\n 'border: transparent 1px solid;' +\n '}' +\n\n '.mega-menu {' +\n 'background: ' + parent._cb.styleSnippetTabsBackground + ';' +\n '}' +\n\n '/* Scrollbar for modal */' +\n\n '/* Darker color, because background for snippet thumbnails is always light. */' +\n '.dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(78 78 78 / 62%) auto;' +\n '}' +\n '.dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(78 78 78 / 62%);' +\n '}' +\n\n '.colored-dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(100, 100, 100) auto;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(100, 100, 100);' +\n '}' +\n\n '.colored * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.colored *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n\n '.light * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.light *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.light *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.light *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n \n 'svg {' +\n 'fill: ' + parent._cb.styleSnippetColor + ';' +\n '}' +\n\n '.dark .is-design-list>div .is-overlay:after {' +\n 'background: rgb(78 78 78 / 13%);' +\n '}' +\n '';\n \n let themestyle = document.querySelector('[data-theme-style]');\n if(themestyle) themestyle.parentNode.removeChild(themestyle);\n \n var style = document.createElement(\"style\");\n style.setAttribute('data-theme-style','');\n style.type = \"text/css\";\n style.innerHTML = cssString;\n document.head.appendChild(style);\n\n if(parent._cb.styleDark) {\n document.body.setAttribute('class', 'dark');\n } else if(parent._cb.styleColored) {\n document.body.setAttribute('class', 'colored');\n } else if(parent._cb.styleColoredDark) {\n document.body.setAttribute('class', 'colored-dark');\n } else if(parent._cb.styleLight) {\n document.body.setAttribute('class', 'light');\n } else {\n document.body.setAttribute('class', '');\n }\n }\n <\/script>\n </body>\n </html>\n ",a}getTemplatesHtml_OLD(){const t=this.builder.designUrl1,e=this.builder.designUrl2;let i=`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title></title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style> \n body {\n /* background: rgba(255,255,255,0.7); */\n margin: 0;\n }\n \n .is-design-list {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 80px solid;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n padding: 0px 0px 30px 0px;\n box-sizing: border-box;\n overflow: auto;\n }\n \n .is-design-list>div {\n position:relative;\n /* background: #fff; */\n width: 250px;\n overflow: hidden;\n margin: 32px 0 0 30px;\n cursor: pointer;\n display: inline-block;\n outline: rgba(219, 219, 219, 0.39) 1px solid;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n border-radius:2px;\n }\n \n .is-design-list>div img {\n box-shadow: none;\n opacity: 1;\n display: block;\n box-sizing: border-box;\n transition: all 0.2s ease-in-out;\n max-width: 400px;\n width: 100%\n }\n \n .is-overlay {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n }\n .is-design-list>div .is-overlay:after {\n background: rgba(0, 0, 0, 0.03);\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transition: all 0.3s ease-in-out;\n opacity: 0;\n }\n .is-design-list>div:hover .is-overlay:after {\n opacity: 0.9;\n }\n \n .is-category-list {\n position: relative;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 80px;\n /* background: #f5f5f5; */\n box-sizing: border-box;\n z-index: 1;\n }\n \n .is-category-list>div {\n display: inline-block;\n white-space: nowrap;\n padding: 13px 10px 0 20px;\n box-sizing: border-box;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n /* background: #f5f5f5; */\n }\n \n .is-category-list > div > div {\n margin-bottom:10px;\n margin-left:5px;\n }\n .is-category-list > div > a {\n display: inline-block;\n padding: 10px 25px;\n /* background: #fefefe;\n color: #000; */\n border-radius: 50px;\n \n margin: 0 15px 8px 0;\n text-decoration: none;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);\n }\n \n .is-category-list > div > a:hover {\n /* background: #fafafa;\n color: #000; */\n }\n .is-category-list > div > a.active {\n /* background: #f5f5f5;\n color: #000; */\n box-shadow: none;\n }\n \n .is-category-list a:focus {\n outline: ${this.builder.editor.styleOutlineColor} 2px solid;\n }\n\n .is-design-list>div:focus {\n outline: ${this.builder.editor.styleOutlineColor} 2px solid;\n }\n \n `;return i+="\n \n .is-more-categories {\n display: none;\n flex-flow: wrap;\n position: absolute;\n width: 400px;\n box-sizing: border-box;\n padding: 0;\n z-index: 1;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n /* background: #fff; */\n }\n \n .is-more-categories a {\n width: 200px;\n float: left;\n display: block;\n box-sizing: border-box;\n padding: 12px 20px;\n /* background: #fff; */\n text-decoration: none;\n /* color: #000; */\n line-height: 1.6;\n }\n \n /* .is-more-categories a:hover {\n background:#eee;\n }\n .is-more-categories a.active {\n background:#eee;\n } */\n .is-more-categories.active {\n display: flex;\n }\n\n /*\n .is-category-list {visibility:hidden}\n .is-more-categories {visibility:hidden}\n */\n \n /* Responsive */\n .is-category-list > div > a.more-basic {display:none}\n .is-category-list > div > .screen1 {display:inline-block}\n .is-more-categories .screen1 {display:none}\n .is-category-list > div > .screen2 {display:inline-block}\n .is-more-categories .screen2 {display:none} \n @media all and (max-width: 970px) {\n .is-category-list > div > .screen1 {display:none}\n .is-more-categories .screen1 {display:block}\n .is-category-list > div > a.more-basic {display:inline-block}\n } \n @media all and (max-width: 690px) {\n .is-category-list > div > .screen2 {display:none}\n .is-more-categories .screen2 {display:block}\n .is-category-list > div > a.more-basic {display:inline-block}\n } \n .is-more-categories a.cms-option {display:none}\n \n /* Enable Module/Placeholder \n .is-category-list > div > a.more-basic {display:inline-block}\n .custom {display:none} \n .is-more-categories a.cms-option {display:block}\n */\n \n \n /* First Loading */\n .is-category-list {opacity:0;transition: opacity ease 0.3s;} \n .is-design-list {opacity:0;transition: opacity ease 0.3s;} \n \n </style> \n </head>",i+=`<body>\n \n <div class="is-category-list">\n \x3c!--<a href="" data-cat="0">Default</a>--\x3e\n <div style="border-right: rgba(255,255,255,0.1) 1px solid;">\n <div>${n("Simple Start:")}</div>\n <a href="" data-cat="5">${n("Random")}</a>\n <a href="" data-cat="1" class="screen2">Basic</a>\n <a href="" class="slider-section screen2" data-cat="2">${n("Slider")}</a>\n <a href="" data-cat="3" class="screen1 screen2">${n("Video")}</a>\n <a href="" data-cat="4" class="screen1 screen2 custom">${n("Custom")}</a>\n <a href="" class="more-basic">${n("More")}</a>\n </div>\n <div>\n <div>Quick Start: </div>\n <a href="" data-cat="101" class="screen2">${n("Header")}</a>\n <a href="" data-cat="118" class="screen2">${n("Article")}</a>\n <a href="" data-cat="103" class="screen1 screen2">${n("Profile")}</a>\n <a href="" class="more-examples">${n("More")}</a>\n </div>\n </div>\n <div id="morebasic" class="is-more-categories" style="width:200px">\n <a href="" data-cat="1" class="screen2">${n("Basic")}</a>\n <a href="" data-cat="2" class="screen2">${n("Slider")}</a>\n <a href="" data-cat="3" class="screen1">${n("Video")}</a>\n <a href="" data-cat="4" class="screen1">${n("Custom")}</a>\n\n <a href="" data-cat="51" class="cms-option">${n("Module")}</a>\n <a href="" data-cat="52" class="cms-option">${n("Placeholder")}</a>\n </div>\n <div id="morecat" class="is-more-categories">\n <a href="" data-cat="101" class="screen2">${n("Header")}</a>\n <a href="" data-cat="118" class="screen2">${n("Article")}</a>\n <a href="" data-cat="103" class="screen1 screen2">${n("Profile")}</a>\n\n <a href="" data-cat="102">${n("Photos")}</a>\n <a href="" data-cat="104">${n("Products, Services")}</a>\n <a href="" data-cat="105">${n("Features")}</a>\n <a href="" data-cat="106">${n("Process")}</a>\n <a href="" data-cat="107">${n("Pricing")}</a>\n <a href="" data-cat="108">${n("Skills")}</a>\n <a href="" data-cat="109">${n("Achievements")}</a>\n <a href="" data-cat="110">${n("Quotes")}</a>\n <a href="" data-cat="111">${n("Partners")}</a>\n <a href="" data-cat="112">${n("As Featured On")}</a> \n <a href="" data-cat="113">${n("Page Not Found")}</a>\n <a href="" data-cat="114">${n("Coming Soon")}</a>\n <a href="" data-cat="115">${n("Help, FAQ")}</a>\n <a href="" data-cat="116">${n("Contact")}</a>\n <a href="" data-cat="117" class="static-section">${n("Footer")}</a>\n \n <div class="template-extension" style="display:none">\n \x3c!--\n <div style="font-weight: 600;padding: 15px 0 10px 19px;width: 100%;position: relative !important;border-top: rgb(0 0 0 / 4%) 1px solid;">\n Writing Set\n </div>\n <div>\n <a href="" data-cat="102">${n("General")}</a>\n <a href="" data-cat="108">${n("Agency")}</a>\n <a href="" data-cat="114">${n("Travel")}</a>\n <a href="" data-cat="116">${n("Food")}</a>\n </div>\n --\x3e\n </div>\n\n </div>\n\n <div class="is-design-list">\n </div>\n \n <script src="${t}" type="text/javascript"><\/script> \n <script src="${e}" type="text/javascript"><\/script> \n \n <script>\n\n applyParentStyles();\n setTimeout(()=>{\n document.querySelector('.is-category-list').style.opacity = 1;\n document.querySelector('.is-design-list').style.opacity = 1;\n },300);\n\n \n function hasClass(element, classname) {\n if(!element) return false;\n try{\n let s = element.getAttribute('class');\n if(!s) return false;\n let exists = false;\n s.split(' ').forEach((item)=>{\n if(item===classname) {\n exists=true;\n }\n });\n return exists;\n } catch(e) { \n // Do nothing\n }\n }\n\n function appendHtml(parent, html) {\n parent.insertAdjacentHTML('beforeend', html);\n }\n function addClass(element, classname) {\n if(!element) return;\n if(element.length) {\n element.forEach((elm) => {\n _addClass(elm, classname);\n })\n return;\n } \n _addClass(element, classname);\n \n }`,i+=`\n function _addClass(element, classname) {\n if(!element) return;\n if(element.length) {\n return;\n } \n if(hasClass(element,classname)) return;\n if(element.classList.length===0) element.className = classname;\n else element.className = element.className + ' ' + classname;\n element.className = element.className.replace(/ +/g, ' ');\n }\n\n function _removeClass(element, classname) {\n if(!element) return;\n if(!element) return;\n if(element.classList.length>0) {\n let i, j, imax, jmax;\n let classesToDel = classname.split(' ');\n for (i=0, imax=classesToDel.length; i<imax; ++i) {\n if (!classesToDel[i]) continue;\n let classtoDel = classesToDel[i];\n \n let sClassName = ''; \n let currentClasses = element.className.split(' ');\n for (j=0, jmax=currentClasses.length; j<jmax; ++j) {\n if (!currentClasses[j]) continue;\n if (currentClasses[j]!==classtoDel) sClassName += currentClasses[j] + ' ';\n }\n element.className = sClassName.trim();\n }\n if(element.className==='') element.removeAttribute('class');\n }\n }\n function removeClass(element, classname) {\n if(!element) return;\n if(element.length) {\n element.forEach((elm) => {\n _removeClass(elm, classname);\n })\n return;\n } \n _removeClass(element, classname);\n }\n function getElementOffset(el) {\n const rect = el.getBoundingClientRect();\n \n return {\n top: rect.top + window.pageYOffset,\n left: rect.left + window.pageXOffset,\n width: rect.width,\n height: rect.height\n };\n }\n \n var defaultCat = ${this.builder.defaultDesignCategory}; //Show 'Header' category: 101\n var disableStaticSection = false;\n try {\n disableStaticSection = ${this.builder.disableStaticSection};\n } catch (e) { }\n if (disableStaticSection) document.querySelector('.static-section').style.display = 'none';\n\n var elm = document.querySelector('.is-category-list');\n var tab = elm.querySelector('[data-cat="' + defaultCat + '"]');\n if(tab) addClass(tab,'active');\n\n elm = document.querySelector('#morecat');\n tab = elm.querySelector('[data-cat="' + defaultCat + '"]');\n if(tab) addClass(tab,'active');\n\n elm = document.querySelector('#morebasic');\n tab = elm.querySelector('[data-cat="' + defaultCat + '"]');\n if(tab) addClass(tab,'active');\n \n /*\n elm = document.querySelector('.is-category-list');\n elm.style.visibility = 'visible';\n var elms = document.querySelectorAll('.is-more-categories'); \n elms.forEach(function(elm){\n elm.style.visibility = 'visible';\n });\n */\n\n var nIndex = 1;\n var path = '${this.builder.designPath}';\n var navbar = ${this.builder.navbar};\n data_basic.designs.forEach(function(item){\n\n var isdefault = false;\n var catSplit = item.category.split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == defaultCat) {\n isdefault = true;\n }\n }\n item.id = nIndex; //Give id to each record\n \n if (isdefault) {\n var elm = document.querySelector('.is-design-list');\n\n var html = '<div role="button" tabindex="0" class="active" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path + item.thumbnail + '"><span class="is-overlay"></span></div>';\n //appendHtml(elm, html);\n\n if(item.type === 'navbar' ) {\n if(navbar) {\n appendHtml(elm, html);\n }\n } else {\n appendHtml(elm, html);\n }\n }\n \n nIndex++;\n });`,i+="\n data_examples.designs.forEach(function(item){\n\n var isdefault = false;\n var catSplit = item.category.split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == defaultCat) {\n isdefault = true;\n }\n }\n item.id = nIndex; //Give id to each record\n \n if (isdefault) {\n var elm = document.querySelector('.is-design-list');\n var html = '<div role=\"button\" tabindex=\"0\" data-id=\"' + item.id + '\" data-cat=\"' + item.category + '\"><img src=\"' + path + item.thumbnail + '\"><span class=\"is-overlay\"></span></div>';\n appendHtml(elm, html);\n }\n \n nIndex++;\n });\n\n var btnMore1 = document.querySelector('.more-basic');\n var btnMore2 = document.querySelector('.more-examples');\n btnMore1.addEventListener('click', function(e){\n let elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms, 'active');\n\n addClass(btnMore1, 'active');\n removeClass(btnMore2, 'active');\n\n let elm = document.querySelector('#morebasic');\n addClass(elm, 'active');\n\n var top = getElementOffset(btnMore1).top;\n var left = getElementOffset(btnMore1).left;\n top = top + 42;\n elm.style.top = top + 'px';\n elm.style.left = left + 'px';\n e.preventDefault();\n });\n btnMore2.addEventListener('click', function(e){\n let elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms, 'active');\n\n addClass(btnMore2, 'active');\n removeClass(btnMore1, 'active');\n\n let elm = document.querySelector('#morecat');\n addClass(elm, 'active');\n\n var top = getElementOffset(btnMore2).top;\n var left = getElementOffset(btnMore2).left;\n top = top + 42;\n elm.style.top = top + 'px';\n elm.style.left = 'auto';\n elm.style.right = '0px';\n e.preventDefault();\n });\n\n elms = document.querySelectorAll('.is-more-categories a');\n elms.forEach(function(elm){\n elm.addEventListener('click', function(e){\n\n selectCategory(elm);\n \n let cat = e.target.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n\n e.preventDefault();\n });\n });\n\n elms = document.querySelectorAll('.is-category-list a');\n elms.forEach(function(elm){\n elm.addEventListener('click', function(e){\n \n if(!elm.getAttribute('data-cat')) return;\n\n selectCategory(elm);\n \n e.preventDefault();\n });\n });\n\n var div = document.querySelectorAll('.is-design-list div');\n div.forEach(function(btn){\n btn.addEventListener('click', function(e){\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n btn.addEventListener('keydown', function(e){\n //Extra \n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n const items = e.target.parentNode.querySelectorAll('.active');\n if(items.length>0) {\n let lastItem = items[items.length-1];\n if(e.target===lastItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n }\n } else if ((e.which === 9 && e.shiftKey)) { // tab + shift key pressed\n const firstItem = e.target.parentNode.querySelector('.active');\n if(e.target===firstItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = firstItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n }\n });\n });\n\n document.addEventListener(\"click\", function(e) {\n var btn1 = document.querySelector('.more-basic');\n var btn2 = document.querySelector('.more-examples');\n var targetEl = e.target; // clicked element \n do {\n if(targetEl == btn1 || targetEl == btn2) {\n // Click inside\n return;\n }\n targetEl = targetEl.parentNode;\n } while (targetEl);\n\n // Click outside\n\n var elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms,'active');\n removeClass(btn1,'active');\n removeClass(btn2,'active');\n });",i+=`\n parent.document.addEventListener("click", function(e) {\n var btn1 = document.querySelector('.more-basic');\n var btn2 = document.querySelector('.more-examples');\n \n var elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms,'active');\n removeClass(btn1,'active');\n removeClass(btn2,'active');\n });\n\n // elm = document.querySelector('.is-category-list');\n // elm.style.display = 'block';\n elm = document.querySelector('.is-design-list');\n elm.style.display = 'block';\n\n var slider = '${this.builder.slider}';\n var navbar = ${this.builder.navbar};\n\n if(slider==='') document.querySelector('.slider-section').style.display = 'none';\n\n function selectCategory(elm) {\n \n var cat = elm.getAttribute('data-cat');\n var div = document.querySelector('.is-design-list');\n var items = div.querySelectorAll('[data-cat="' + cat + '"]');\n if(items.length == 0) {\n \n data_basic.designs.forEach(function(item){\n if (cat == item.category) {\n\n if(item.type === 'glide' || item.type === 'slick') {\n if(slider==='glide') {\n if(cat === '2') {\n if(item.type === 'glide') {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n } \n } \n } else if(slider==='slick') {\n if(cat === '2') {\n if(item.type === 'slick') {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n } \n } \n } else if(slider==='all') {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n } \n } else if(item.type === 'navbar' ) {\n if(navbar) {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n }\n } else {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n }\n \n }\n });\n data_examples.designs.forEach(function(item){\n if (cat == item.category) {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n }\n });\n\n items = div.querySelectorAll('[data-cat="' + cat + '"]');\n items.forEach(function(btn){\n btn.addEventListener('click', function(e){\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n btn.addEventListener('keydown', function(e){\n //Extra \n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n const items = e.target.parentNode.querySelectorAll('.active');\n if(items.length>0) {\n let lastItem = items[items.length-1];\n if(e.target===lastItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n }\n } else if ((e.which === 9 && e.shiftKey)) { // tab + shift key pressed\n const firstItem = e.target.parentNode.querySelector('.active');\n if(e.target===firstItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = firstItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n }\n });\n });\n\n }\n\n var _elms = document.querySelectorAll('.is-category-list a');\n removeClass(_elms,'active');\n _elms = document.querySelectorAll('.is-more-categories a');\n removeClass(_elms,'active');\n addClass(elm,'active');\n \n if (cat) {\n _elms = document.querySelectorAll('.is-design-list div');\n _elms.forEach(function(elm) {\n elm.style.display = 'none';\n elm.classList.remove('active');\n });\n _elms.forEach(function(elm) {\n var catSplit = elm.getAttribute('data-cat').split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == cat) {\n elm.style.display = '';\n elm.classList.add('active');\n }\n }\n });\n \n }\n\n _elms = document.querySelectorAll('.is-more-categories');\n removeClass(_elms,'active');\n }`,i+=`\n\n let categorylist = document.querySelector('.is-category-list');\n let designlist = document.querySelector('.is-design-list');\n\n let inputTabs = [];\n let inputTabsAll = document.querySelectorAll('.is-category-list a');\n inputTabsAll.forEach((item)=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='inline-block') {\n item.classList.add('show');\n inputTabs.push(item);\n } else {\n item.classList.remove('show');\n }\n });\n let index = 0;\n inputTabs.forEach((item)=>{\n\n let nextItem = inputTabs[index+1];\n let prevItem = inputTabs[index-1];\n \n item.addEventListener('keydown', (e)=>{\n e.preventDefault();\n \n if (e.which === 39) { // arrow right key pressed\n if(nextItem) nextItem.focus();\n } else if (e.which === 37) { // arrow left key pressed\n if(prevItem) prevItem.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n \n if(e.target===btnMore1) {\n \n btnMore1.click();\n\n e.preventDefault();\n e.stopImmediatePropagation();\n } else if(e.target===btnMore2) {\n \n btnMore2.click();\n\n e.preventDefault();\n e.stopImmediatePropagation();\n } else {\n\n selectCategory(e.target);\n \n }\n } else if(e.which === 40 && (e.target.classList.contains('more-basic') || e.target.classList.contains('more-examples'))) { // down\n\n // Redirect to dropdown list\n let firstItem;\n let activeItem;\n let moreCategories = document.querySelector('.is-more-categories.active');\n let items = moreCategories.querySelectorAll('a');\n items.forEach(item=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='block') {\n item.classList.add('show');\n if(item.classList.contains('active')) {\n activeItem=item;\n }\n } else {\n item.classList.remove('show');\n }\n });\n firstItem = moreCategories.querySelector('.show');\n if(activeItem) {\n activeItem.focus();\n } else {\n firstItem.focus();\n }\n\n } else if (e.which === 27) {\n // let moreCategories = document.querySelector('.is-more-categories.active');\n // if(moreCategories) moreCategories.classList.remove('active');\n // let activeTab = document.querySelector('.more-basic.active,.more-examples.active');\n // if(activeTab) activeTab.focus();\n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n\n if(inputs.length===0) return;\n\n let firstInput = inputs[0];\n\n firstInput.focus();\n\n let lastInput = inputs[inputs.length-1];\n \n lastInput.addEventListener('keydown', (e)=>{\n \n e.preventDefault();\n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastInput.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n }\n });\n } \n \n });\n index++;\n });\n\n\n let dropdownItems = document.querySelectorAll('.is-more-categories a');\n Array.prototype.forEach.call(dropdownItems, (item) => {\n\n item.addEventListener('keydown', (e)=>{\n e.preventDefault();\n if(e.keyCode === 38 && e.target.previousElementSibling && window.getComputedStyle(e.target.previousElementSibling).getPropertyValue('display')==='block') { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling && window.getComputedStyle(e.target.nextElementSibling).getPropertyValue('display')==='block') { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n selectCategory(e.target);\n\n let cat = e.target.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n \n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n \n if(inputs.length===0) return;\n \n let firstInput = inputs[0];\n \n firstInput.focus();\n\n let lastInput = inputs[inputs.length-1];\n \n lastInput.addEventListener('keydown', (e)=>{\n \n e.preventDefault();\n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastInput.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n }\n });\n }\n \n });\n \n // item.addEventListener('click', (e)=>{\n // e.preventDefault();\n\n // e.target.focus();\n \n // selectCategory(e.target);\n // });\n });\n\n function addDesign(designid) {\n \n // var wrapper = parent.document.querySelector('.is-wrapper');\n var wrapper = parent._cb.doc.querySelector('.is-wrapper');\n\n var framework = '${this.builder.framework}';\n var snippetPathReplace = [];\n ${this.builder.designPathReplace.length>0?`\n snippetPathReplace = ['${this.builder.designPathReplace[0]}', '${this.builder.designPathReplace[1]}'];\n `:""}\n \n var contentStylePath = '${this.builder.contentStylePath}';\n var html = '';\n var result = data_basic.designs.filter(function(element){ \n if(element.id === parseInt(designid)) return element;\n });\n if (result.length==0) {\n result = data_examples.designs.filter(function(element){ \n if(element.id === parseInt(designid)) return element;\n });\n }\n\n var html = result[0].html;\n var googleFonts = result[0].googleFonts;\n var contentCss = result[0].contentCss;\n var contentClass = result[0].contentClass;\n\n //To Tailwind\n if (framework == 'tailwind') {\n html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'flex flex-col md:flex-row');\n html = html.replace(new RegExp('column full', 'g'), 'w-full px-4');\n html = html.replace(new RegExp('column half', 'g'), 'w-full md:w-6/12 px-4');\n html = html.replace(new RegExp('column third', 'g'), 'w-full md:w-4/12 px-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'w-full md:w-3/12 px-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'w-full md:w-2/12 px-4'); //not needed\n html = html.replace(new RegExp('column sixth', 'g'), 'w-full md:w-2/12 px-4');\n html = html.replace(new RegExp('column two-third', 'g'), 'w-full md:w-8/12 px-4');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'w-full md:w-9/12 px-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'w-full md:w-10/12 px-4');\n }\n \n //To Bootstrap\n if (framework == 'bootstrap') {\n html = html.replace(new RegExp(' container', 'g'), ' container-fluid');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'col-md-12');\n html = html.replace(new RegExp('column half', 'g'), 'col-md-6');\n html = html.replace(new RegExp('column third', 'g'), 'col-md-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'col-md-3');\n html = html.replace(new RegExp('column fifth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column sixth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column two-third', 'g'), 'col-md-8');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'col-md-9');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'col-md-10');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'btn btn-primary btn-lg');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'btn btn-default btn-lg');\n }\n\n //To Foundation\n if (framework == 'foundation') {\n //html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'large-12 columns');\n html = html.replace(new RegExp('column half', 'g'), 'large-6 columns');\n html = html.replace(new RegExp('column third', 'g'), 'large-4 columns');\n html = html.replace(new RegExp('column fourth', 'g'), 'large-3 columns');\n html = html.replace(new RegExp('column fifth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column sixth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column two-third', 'g'), 'large-8 columns');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'large-9 columns');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'large-10 columns');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'button');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'secondary button');\n }\n\n //To UIKit\n if (framework == 'uikit') {\n html = html.replace(new RegExp(' container', 'g'), ' uk-container uk-container-center');\n html = html.replace(new RegExp('row clearfix', 'g'), 'uk-grid');\n html = html.replace(new RegExp('column full', 'g'), 'uk-width-1-1');\n html = html.replace(new RegExp('column half', 'g'), 'uk-width-1-2');\n html = html.replace(new RegExp('column third', 'g'), 'uk-width-1-3');\n html = html.replace(new RegExp('column fourth', 'g'), 'uk-width-1-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'uk-width-1-5');\n html = html.replace(new RegExp('column sixth', 'g'), 'uk-width-1-6');\n html = html.replace(new RegExp('column two-third', 'g'), 'uk-width-2-3');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'uk-width-3-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'uk-width-5-6');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'uk-button uk-button-primary uk-button-large');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'uk-button uk-button-large');\n }\n\n //To Material\n if (framework == 'material') {\n html = html.replace(new RegExp(' container', 'g'), '');\n html = html.replace(new RegExp('row clearfix', 'g'), 'mdl-grid');\n html = html.replace(new RegExp('column full', 'g'), 'mdl-cell mdl-cell--12-col');\n html = html.replace(new RegExp('column half', 'g'), 'mdl-cell mdl-cell--6-col');\n html = html.replace(new RegExp('column third', 'g'), 'mdl-cell mdl-cell--4-col');\n html = html.replace(new RegExp('column fourth', 'g'), 'mdl-cell mdl-cell--3-col');\n html = html.replace(new RegExp('column fifth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column sixth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column two-third', 'g'), 'mdl-cell mdl-cell--8-col');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'mdl-cell mdl-cell--9-col');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'mdl-cell mdl-cell--10-col');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'mdl-button mdl-js-button mdl-button--raised mdl-button--accent');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'mdl-button mdl-js-button mdl-button--raised');\n }`,i+="\n\n html = html.replace(/{id}/g, makeid());\n\n if(snippetPathReplace.length>0) {\n if (snippetPathReplace[0] != '') {\n var regex = new RegExp(snippetPathReplace[0], 'g');\n html = html.replace(regex, snippetPathReplace[1]);\n }\n }\n\n //Add html\n parent.contentbox.addIdea(html);\n\n //Add contentCss\n var exist = false;\n var links = parent.document.getElementsByTagName(\"link\");\n for (var i = 0; i < links.length; i++) {\n var src = links[i].href.toLowerCase();\n if (src.indexOf(contentCss.toLowerCase()) != -1) exist = true;\n }\n \n if (!exist) appendHtml(wrapper,'<link data-name=\"contentstyle\" data-class=\"' + contentClass + '\" href=\"' + contentStylePath + contentCss + '\" rel=\"stylesheet\">');\n \n }\n\n function makeid() {//http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n for (var i = 0; i < 2; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n \n var text2 = \"\";\n var possible2 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 5; i++)\n text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));\n \n return text + text2;\n }\n\n \n // Style stuff\n function applyParentStyles() {\n var cssString = '' +\n 'body {' +\n 'background: ' + parent._cb.styleSnippetBackground + ';' +\n 'color: ' + parent._cb.styleSnippetColor + ';' +\n 'margin: 0;' +\n '}' +\n \n\n '.dark .is-design-list>div {' +\n 'outline: transparent 1px solid;' +\n '}' +\n\n '/* Scrollbar for modal */' +\n\n '/* Darker color, because background for snippet thumbnails is always light. */' +\n '.dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(78 78 78 / 62%) auto;' +\n '}' +\n '.dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(78 78 78 / 62%);' +\n '}' +\n\n '.colored-dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(100, 100, 100) auto;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(100, 100, 100);' +\n '}' +\n\n '.colored * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.colored *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n ",i+="\n '.light * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.light *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.light *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.light *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n \n 'svg {' +\n 'fill: ' + parent._cb.styleSnippetColor + ';' +\n '}' +\n\n '.dark .is-design-list>div .is-overlay:after {' +\n 'background: rgb(78 78 78 / 13%);' +\n '}' +\n\n \n '.is-category-list {' +\n 'display: flex;' +\n '}' +\n \n '.is-category-list>div {' +\n 'background: ' + parent._cb.styleSnippetTabsBackground + ';' +\n '}' +\n '.is-category-list>div:last-child {' +\n 'width:100%;' +\n '}' +\n \n '.is-category-list a {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackground + ';' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n 'transition: box-shadow ease 0.3s;' +\n '}' +\n \n '.is-category-list a:hover {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackgroundHover + ';' +\n 'box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n '}' +\n \n '.is-category-list a.active {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackgroundActive + ';' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n 'cursor: default;' +\n '}' +\n\n '.is-more-categories {' +\n 'background: ' + parent._cb.styleSnippetMoreItemBackground + ';' +\n '}' +\n \n '.is-more-categories a {' +\n 'background: ' + parent._cb.styleSnippetMoreItemBackground + ';' +\n 'color: ' + parent._cb.styleSnippetMoreItemColor + ';' +\n '}' +\n \n '.is-more-categories a:hover {' +\n 'background: ' + parent._cb.styleSnippetMoreItemBackgroundHover + ';' +\n '}' +\n \n '.is-more-categories a.active, .is-more-categories a:focus {' +\n ' background: ' + parent._cb.styleSnippetMoreItemBackgroundActive + ';outline:none;' +\n '}';\n \n let themestyle = document.querySelector('[data-theme-style]');\n if(themestyle) themestyle.parentNode.removeChild(themestyle);\n \n var style = document.createElement(\"style\");\n style.setAttribute('data-theme-style','');\n style.type = \"text/css\";\n style.innerHTML = cssString;\n document.head.appendChild(style);\n\n if(parent._cb.styleDark) {\n document.body.setAttribute('class', 'dark');\n } else if(parent._cb.styleColored) {\n document.body.setAttribute('class', 'colored');\n } else if(parent._cb.styleColoredDark) {\n document.body.setAttribute('class', 'colored-dark');\n } else if(parent._cb.styleLight) {\n document.body.setAttribute('class', 'light');\n } else {\n document.body.setAttribute('class', '');\n }\n }\n\n // applyParentStyles();\n\n document.addEventListener('keydown', (e)=>{\n if(e.keyCode === 27) { // escape key\n \n let moreCategories = document.querySelector('.is-more-categories.active');\n if(moreCategories) {\n moreCategories.classList.remove('active');\n\n let activeTab = document.querySelector('.more-basic.active,.more-examples.active');\n if(activeTab) activeTab.focus();\n\n e.preventDefault();\n return;\n } else {\n const overlay = parent.document.body;\n overlay.click();\n }\n }\n });\n\n <\/script>\n </body>\n </html>\n \n \n ",i}}class r{constructor(t){const e=()=>{let e=t.querySelectorAll(".is-tabs-more");Array.prototype.forEach.call(e,(t=>{t.style.display="none",t.setAttribute("aria-expanded",!1)})),document.removeEventListener("click",i)},i=t=>{t.target.closest(".is-tab-more")||t.target.closest("[data-menu]")||e()},n=n=>{const o=n.parentNode.getAttribute("data-group"),s=n.getAttribute("data-menu");if(s){document.addEventListener("click",i),n.setAttribute("aria-expanded",!0),t.querySelector("#"+s).style.display="block";let e=t.querySelector('.is-tabs-more[data-group="'+o+'"] > li.active');if(e)e.focus();else{t.querySelector('.is-tabs-more[data-group="'+o+'"]').focus()}return!1}if(n.classList.contains("active"))return!1;const a=n.getAttribute("data-content");if(!a)return!1;let r=t.querySelectorAll('.is-tabs[data-group="'+o+'"] > a');Array.prototype.forEach.call(r,(t=>{t.classList.remove("active")})),r=t.querySelectorAll('.is-tabs-more[data-group="'+o+'"] > li'),Array.prototype.forEach.call(r,(t=>{t.classList.remove("active")})),n.classList.add("active");let l=t.querySelectorAll('.is-tab-content[data-group="'+o+'"]');Array.prototype.forEach.call(l,(t=>{t.style.display="none",t.classList.remove("active")}));const d=t.querySelector("#"+a);d.style.display="flex",d.classList.add("active");const c=t.querySelector(".is-tabs-more");return c&&(c.style.display="none"),e(),this.setupTabKey(d,t),!1};let o=t.querySelectorAll(".is-tabs a");Array.prototype.forEach.call(o,(t=>{t.addEventListener("keydown",(e=>{if(e.preventDefault(),13===e.keyCode||32===e.keyCode)n(e.target);else if(9===e.which&&!e.shiftKey){let e=[];const i=t.parentNode.getAttribute("data-group");let n=t.parentNode.parentNode.querySelector('.is-tab-content[data-group="'+i+'"].active');if(Array.from(n.children).map((t=>{if("none"!==window.getComputedStyle(t,null).getPropertyValue("display")){t.querySelectorAll('.is-tabs.active, a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex]').forEach((t=>{"none"!==window.getComputedStyle(t,null).getPropertyValue("display")&&e.push(t)}))}})),0===e.length)return;e[0].focus()}})),t.addEventListener("click",(t=>{t.preventDefault(),n(t.target)}))}));const s=t.querySelectorAll(".is-tabs-more");Array.prototype.forEach.call(s,(t=>{t.addEventListener("keydown",(i=>{i.preventDefault(),40===i.keyCode&&i.target.nextElementSibling?t.querySelector("li").focus():27===i.keyCode&&e()}))})),o=t.querySelectorAll(".is-tabs-more li"),Array.prototype.forEach.call(o,(i=>{i.addEventListener("keydown",(o=>{if(o.preventDefault(),o.stopImmediatePropagation(),38===o.keyCode&&o.target.previousElementSibling)o.target.previousElementSibling.focus();else if(40===o.keyCode&&o.target.nextElementSibling)o.target.nextElementSibling.focus();else if(27===o.keyCode)e();else if((13===o.keyCode||32===o.keyCode)&&(n(o.target),o.target.closest(".is-tabs-more"))){const e=i.parentNode.getAttribute("id"),n=t.querySelector('.is-tabs a[data-menu="'+e+'"]');n&&n.focus()}})),i.addEventListener("click",(e=>{if(e.preventDefault(),n(e.target),e.target.closest(".is-tabs-more")){const e=i.parentNode.getAttribute("id"),n=t.querySelector('.is-tabs a[data-menu="'+e+'"]');n&&n.focus()}}))}));t.addEventListener("focus",(()=>{this.setupModal(t)}))}setupModal(t){setTimeout((()=>{let e=[];t.querySelectorAll(".is-tabs a").forEach((t=>{"none"!==t.style.display?(t.classList.add("show"),e.push(t)):t.classList.remove("show")}));let i=0;this.inputTabs=e,e.forEach((t=>{let n=e[i+1],o=e[i-1];t.addEventListener("keydown",(t=>{t.preventDefault(),39===t.which?n&&n.focus():37===t.which&&o&&o.focus()})),i++})),this.setupTabKey(t.querySelector(".is-tab-content.active"),t)}),30)}setupTabKey(t,e){let i=[];if(Array.from(t.children).map((t=>{if("none"!==window.getComputedStyle(t,null).getPropertyValue("display")){t.querySelectorAll('.is-tabs.active, a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex]').forEach((t=>{"none"!==window.getComputedStyle(t,null).getPropertyValue("display")&&i.push(t)}))}})),0===i.length)return;let n=i[0];i[i.length-1].addEventListener("keydown",(i=>{if(9===i.which&&!i.shiftKey){i.preventDefault();let n=t.getAttribute("id");const o=e.querySelector('li[data-content="'+n+'"],a[data-content="'+n+'"]');if(o.closest(".is-tabs-more")){n=o.parentNode.getAttribute("id");const t=e.querySelector('.is-tabs a[data-menu="'+n+'"]');t&&t.focus()}else o.focus()}})),n.addEventListener("keydown",(i=>{if(9===i.which&&i.shiftKey){i.preventDefault();let n=t.getAttribute("id");const o=e.querySelector('li[data-content="'+n+'"],a[data-content="'+n+'"]');if(o.closest(".is-tabs-more")){n=o.parentNode.getAttribute("id");const t=e.querySelector('.is-tabs a[data-menu="'+n+'"]');t&&t.focus()}else o.focus()}}))}}const l=new t;class d{constructor(t){this.builder=t;const e=this.builder.builderStuff;this.builderStuff=e;let i='<div class="is-modal delsectionconfirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width: 450px;"><div style="margin: 20px 0 30px;text-align:center;font-size: 14px;">'+n("Are you sure you want to delete this section?")+'</div><button title="'+n("Delete")+'" class="input-ok classic">'+n("Delete")+'</button></div></div><div class="is-modal editsection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div class="is-modal-content" style="max-width:313px;padding:0;"><div class="is-modal-bar is-draggable">'+n("Section Settings")+'</div><div class="is-tabs clearfix" style="padding-top:37px;" data-group="sectionsettings"><a id="tabSectionGeneral" title="'+n("General")+'" href="" data-content="divSectionGeneral" class="active">'+n("General")+'</a><a id="tabSectionAnimation" title="'+n("Animation")+'" href="" data-content="divSectionAnimation">'+n("Animation")+'</a><a id="tabSectionScrollButton" title="'+n("Scroll")+'" href="" data-content="divSectionScrollButton">'+n("Scroll")+"</a></div>";i+='<div id="divSectionGeneral" class="is-tab-content active" data-group="sectionsettings" style="display:flex;padding-top:0"><div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Move Section")+':</div><div style="display:flex"><button title="'+n("Move Up")+'" class="cmd-section-up" style="">↑</button><button title="'+n("Move Down")+'" class="cmd-section-down">↓</button><button title="'+n("Move to Top")+'" class="cmd-section-top"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇤</span></button><button title="'+n("Move to Bottom")+'" class="cmd-section-bottom"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇥</span></button><button title="'+n("Duplicate")+'" class="cmd-section-duplicate" style="margin-left:20px;"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-copy-outline"></use></svg></button></div></div>',i+='<div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Height")+':</div><div style="display:flex"><button title="'+n("Auto")+'" class="cmd-section-height" data-value="0">'+n("Auto")+'</button><button title="20%" class="cmd-section-height" data-value="20">20%</button><button title="25%" class="cmd-section-height" data-value="25">25%</button><button title="30%" class="cmd-section-height" data-value="30">30%</button><button title="40%" class="cmd-section-height" data-value="40">40%</button><button title="50%" class="cmd-section-height" data-value="50">50%</button></div><div style="display:flex"><button title="60%" class="cmd-section-height" data-value="60" style="border-left:none;border-top:none;">60%</button><button title="70%" class="cmd-section-height" data-value="70" style="border-left:none;border-top:none;">70%</button><button title="75%" class="cmd-section-height" data-value="75" style="border-left:none;border-top:none;">75%</button><button title="80%" class="cmd-section-height" data-value="80" style="border-left:none;border-top:none;">80%</button><button title="90%" class="cmd-section-height" data-value="90" style="border-left:none;border-top:none;">90%</button><button title="100%" class="cmd-section-height" data-value="100" style="border-left:none;border-top:none;">100%</button></div></div><div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Spacing")+':</div><div style="display:flex"><button title="'+n("xs")+'" class="cmd-box-spacing" data-value="default">'+n("xs")+'</button><button title="'+n("sm")+'" class="cmd-box-spacing" data-value="sm">'+n("sm")+'</button><button title="'+n("m")+'" class="cmd-box-spacing" data-value="m">'+n("m")+'</button><button title="'+n("lg")+'" class="cmd-box-spacing" data-value="lg">'+n("lg")+'</button><button title="'+n("Clear")+'" class="cmd-box-spacing" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button></div></div>',i+='<div class="div-section-bgcolor" style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Background Color")+':</div><div style="display:flex;"><button title="'+n("Background Color")+'" class="input-section-bgcolor is-btn-color" style="margin-right:15px"></button><button title="'+n("Gradient")+'" class="input-section-gradient classic" data-value="+">'+n("Gradient")+'</button></div></div></div><div id="divSectionAnimation" class="is-tab-content" data-group="sectionsettings" style="display:none;padding-top:0"><div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Start")+':</div><div style="display:flex;flex-flow:wrap;"><button title="'+n("Slide Left")+'" class="cmd-section-anim-start" data-value="slide-left">'+n("Slide Left")+'</button><button title="'+n("Slide Right")+'" class="cmd-section-anim-start" data-value="slide-right">'+n("Slide Right")+'</button><button title="'+n("Zoom In")+'" class="cmd-section-anim-start" data-value="zoom-in">'+n("Zoom In")+'</button><button title="'+n("Clear")+'" class="cmd-section-anim-start" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button></div></div>',i+='<div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("End")+':</div><div style="display:flex;flex-flow:wrap;"><button title="'+n("Slide Left")+'" class="cmd-section-anim-end" data-value="slide-left">'+n("Slide Left")+'</button><button title="'+n("Slide Right")+'" class="cmd-section-anim-end" data-value="slide-right">'+n("Slide Right")+'</button><button title="'+n("Slide Back")+'" class="cmd-section-anim-end" data-value="slide-back">'+n("Slide Back")+'</button><button title="'+n("Overlap")+'" class="cmd-section-anim-end" data-value="overlap">'+n("Overlap")+'</button><button title="'+n("Zoom In")+'" class="cmd-section-anim-end" data-value="zoom-in">'+n("Zoom In")+'</button><button title="'+n("Zoom Out")+'" class="cmd-section-anim-end" data-value="zoom-out">'+n("Zoom Out")+'</button><button title="'+n("Clear")+'" class="cmd-section-anim-end" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button></div></div></div><div id="divSectionScrollButton" class="is-tab-content" data-group="sectionsettings" style="display:none;padding-top:0"><div style="display:none;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;"><label for="chkScrollIcon" style="margin:0;"><input id="chkScrollIcon" type="checkbox" /> '+n("Scroll Icon")+'</label></div><div style="display:flex;padding-top:10px;"><button title="'+n("Light")+'" class="cmd-section-scroll" data-value="light" style="min-width:80px;">'+n("Light")+'</button><button title="'+n("Dark")+'" class="cmd-section-scroll" data-value="dark" style="border-left:none;min-width:80px;">'+n("Dark")+'</button></div></div><div style="display:flex;flex-direction:column;padding-bottom:3px;"><div style="padding-top:20px;padding-bottom:3px;">'+n("Scroll Button")+':</div><div style="display:flex;flex-flow:wrap;"><button class="cmd-scroll-preset" data-value="1" title="'+n("Apply")+'" type="button">1</button><button class="cmd-scroll-preset" data-value="2" title="'+n("Apply")+'" type="button">2</button><button class="cmd-scroll-preset" data-value="3" title="'+n("Apply")+'" type="button">3</button><button class="cmd-scroll-preset" data-value="4" title="'+n("Apply")+'" type="button">4</button><button class="cmd-scroll-preset" data-value="5" title="'+n("Apply")+'" type="button">5</button><button class="cmd-scroll-preset" data-value="6" title="'+n("Apply")+'" type="button">6</button><button class="cmd-scroll-preset" data-value="7" title="'+n("Apply")+'" type="button">7</button><button class="cmd-scroll-preset" data-value="8" title="'+n("Apply")+'" type="button">8</button><button class="cmd-scroll-preset" data-value="9" title="'+n("Apply")+'" type="button">9</button><button class="cmd-scroll-preset" data-value="10" title="'+n("Apply")+'" type="button">10</button><button class="cmd-scroll-preset" data-value="11" title="'+n("Apply")+'" type="button">11</button><button class="cmd-scroll-preset" data-value="12" title="'+n("Apply")+'" type="button">12</button><button class="cmd-scroll-preset" data-value="13" title="'+n("Apply")+'" type="button">13</button><button class="cmd-scroll-preset" data-value="14" title="'+n("Apply")+'" type="button">14</button><button class="cmd-scroll-preset" data-value="" title="'+n("Remove")+'" type="button"><svg class="is-icon-flex" style="flex:none;width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button></div></div></div></div></div>',i+='<div class="is-modal editmodule" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;"><div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">'+n("Module Settings")+'</div><iframe style="position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;margin:0;box-sizing:border-box;" src="about:blank"></iframe><input id="hidModuleCode" type="hidden" /><input id="hidModuleSettings" type="hidden" /><button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">'+n("Ok")+"</button></div></div>",l.appendHtml(e,i);let o=e.querySelector(".is-modal.editsection");this.modalEditSection=o,new r(o);const s=o.querySelectorAll(".is-tabs a");s.forEach((t=>{t.addEventListener("click",(e=>{if(e.preventDefault(),l.hasClass(t,"active"))return;s.forEach((t=>{l.removeClass(t,"active")})),l.addClass(t,"active");let i=t.getAttribute("data-content");o.querySelectorAll(".is-tab-content").forEach((t=>{t.style.display="none"})),o.querySelector("#"+i).style.display="flex"}))}));const a=e.querySelector(".is-modal.delsectionconfirm");a.querySelector(".input-ok").addEventListener("click",(()=>{const t=this.builder.activeSection;this.builder.editor.saveForUndo(),t.parentNode.removeChild(t),this.builder.settings.onRender(),this.builder.editor.util.hideModal(a),this.builder.settings.onChange(),this.builder.activeSection=null}));o.querySelector(".cmd-section-up").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionUp(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-down").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionDown(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-top").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionTop(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-bottom").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionBottom(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-duplicate").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionDuplicate(),this.builder.settings.onChange()}));o.querySelectorAll(".cmd-section-anim-start").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionAnimStart(e),o.querySelectorAll(".cmd-section-anim-start").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-section-anim-end").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionAnimEnd(e),o.querySelectorAll(".cmd-section-anim-end").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-section-height").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionHeight(e),o.querySelectorAll(".cmd-section-height").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-spacing").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxSpacing(e),o.querySelectorAll(".cmd-box-spacing").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-section-scroll").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionScrollIcon(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-scroll-preset").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionScrollPreset(e),o.querySelectorAll(".cmd-scroll-preset").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelector("#chkScrollIcon").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionUseScroll(),this.builder.settings.onChange()}));const d=this.builder.editor.colorpicker(),c=o.querySelector(".input-section-bgcolor");c.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeSection;let e=c.style.backgroundColor;d.open((e=>{t.style.backgroundColor=e,t.style.backgroundImage="",c.style.backgroundColor=e}),e)})),o.querySelector(".input-section-gradient").addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeSection;this.builder.editor.gradientpicker().open(t)}))}edit(){this.builder.sidebar.closeSidebar();const t=this.builder.activeSection,e=this.modalEditSection;l.addClass(t,"section-active"),this.builder.showModal(e,!1,(()=>{l.removeClass(t,"section-active")})),e.focus();let i=this.builder.activeSection.querySelectorAll(".is-bg-light");i.forEach((t=>{if(l.removeClass(t,"is-bg-light"),l.hasClass(t,"is-box")){let e=t.querySelector(".is-overlay");e?e.style.backgroundColor||(e.style.backgroundColor="rgb(255, 255, 255)"):(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"),e.style.backgroundColor="rgb(255, 255, 255)")}})),i=this.builder.activeSection.querySelectorAll(".is-bg-dark"),i.forEach((t=>{if(l.removeClass(t,"is-bg-dark"),l.hasClass(t,"is-box")){let e=t.querySelector(".is-overlay");e?e.style.backgroundColor||(e.style.backgroundColor="rgb(17, 17, 17)"):(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"),e.style.backgroundColor="rgb(17, 17, 17)")}})),i=this.builder.activeSection.querySelectorAll(".is-bg-grey"),i.forEach((t=>{if(l.removeClass(t,"is-bg-grey"),l.hasClass(t,"is-box")){let e=t.querySelector(".is-overlay");e?e.style.backgroundColor||(e.style.backgroundColor="rgb(238, 239, 240)"):(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"),e.style.backgroundColor="rgb(238, 239, 240)")}}));const n=e.querySelector("#chkScrollIcon");t.querySelector(".is-arrow-down")?n.checked=!0:n.checked=!1;let o=e.querySelectorAll(".cmd-section-height");if(o.forEach((t=>{l.removeClass(t,"on")})),l.hasClass(t,"is-section-100")&&l.addClass(e.querySelector('.cmd-section-height[data-value="100"]'),"on"),l.hasClass(t,"is-section-90")&&l.addClass(e.querySelector('.cmd-section-height[data-value="90"]'),"on"),l.hasClass(t,"is-section-80")&&l.addClass(e.querySelector('.cmd-section-height[data-value="80"]'),"on"),l.hasClass(t,"is-section-75")&&l.addClass(e.querySelector('.cmd-section-height[data-value="75"]'),"on"),l.hasClass(t,"is-section-70")&&l.addClass(e.querySelector('.cmd-section-height[data-value="70"]'),"on"),l.hasClass(t,"is-section-60")&&l.addClass(e.querySelector('.cmd-section-height[data-value="60"]'),"on"),l.hasClass(t,"is-section-50")&&l.addClass(e.querySelector('.cmd-section-height[data-value="50"]'),"on"),l.hasClass(t,"is-section-40")&&l.addClass(e.querySelector('.cmd-section-height[data-value="40"]'),"on"),l.hasClass(t,"is-section-30")&&l.addClass(e.querySelector('.cmd-section-height[data-value="30"]'),"on"),l.hasClass(t,"is-section-25")&&l.addClass(e.querySelector('.cmd-section-height[data-value="25"]'),"on"),l.hasClass(t,"is-section-20")&&l.addClass(e.querySelector('.cmd-section-height[data-value="20"]'),"on"),l.hasClass(t,"is-section-auto")&&l.addClass(e.querySelector('.cmd-section-height[data-value="0"]'),"on"),o=e.querySelectorAll(".cmd-section-anim-start"),o.forEach((t=>{l.removeClass(t,"on")})),o=e.querySelectorAll(".cmd-section-anim-end"),o.forEach((t=>{l.removeClass(t,"on")})),t.hasAttribute("data-anim-start")){const i=t.getAttribute("data-anim-start");"zoom-in"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="zoom-in"]'),"on"),"zoom-out"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="zoom-out"]'),"on"),"slide-left"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="slide-left"]'),"on"),"slide-right"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="slide-right"]'),"on")}if(t.hasAttribute("data-anim-end")){const i=t.getAttribute("data-anim-end");"zoom-in"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="zoom-in"]'),"on"),"zoom-out"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="zoom-out"]'),"on"),"slide-left"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="slide-left"]'),"on"),"slide-right"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="slide-right"]'),"on"),"overlap"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="overlap"]'),"on"),"slide-back"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="slide-back"]'),"on")}o=e.querySelectorAll(".cmd-box-spacing");const s=this.modalEditSection.querySelector(".div-section-bgcolor");o.forEach((t=>{l.removeClass(t,"on")})),l.hasClass(t,"box-space")?(l.hasClass(t,"box-space-sm")?l.addClass(e.querySelector('.cmd-box-spacing[data-value="sm"]'),"on"):l.hasClass(t,"box-space-m")?l.addClass(e.querySelector('.cmd-box-spacing[data-value="m"]'),"on"):l.hasClass(t,"box-space-lg")?l.addClass(e.querySelector('.cmd-box-spacing[data-value="lg"]'),"on"):l.addClass(e.querySelector('.cmd-box-spacing[data-value="default"]'),"on"),s.style.display="flex"):s.style.display="none",o=e.querySelectorAll(".cmd-scroll-preset"),o.forEach((t=>{l.removeClass(t,"on")}));const a=t.querySelector(".is-arrow-down");if(a){let t=a.getAttribute("data-scroll-preset");if(t){let i=e.querySelector(`.cmd-scroll-preset[data-value="${t}"]`);l.addClass(i,"on")}}let r=e.querySelector(".input-section-bgcolor"),d=t.style.backgroundColor;r.style.backgroundColor=d||""}sectionUp(){const t=this.builder.activeSection;let e=t.previousElementSibling;if(e)for(;!l.hasClass(e,"is-section")&&e.previousElementSibling;)e=e.previousElementSibling;e&&!l.hasClass(e,"is-static")&&(t.parentNode.insertBefore(t,e),this.builder.settings.onRender(),this.builder.scrollTo(t,600))}sectionDown(){const t=this.builder.activeSection;let e=t.nextElementSibling;if(e)for(;!l.hasClass(e,"is-section")&&e.nextElementSibling;)e=e.previousElementSibling;return e&&!l.hasClass(e,"is-static")&&(t.parentNode.insertBefore(e,t),this.builder.settings.onRender(),this.builder.scrollTo(t,600)),!1}sectionTop(){const t=this.builder.activeSection;let e=this.builder.wrapperEl.querySelector(".is-section:not(.is-static)");t.parentNode.insertBefore(t,e),this.builder.settings.onRender(),this.builder.scrollTo(t,600)}sectionBottom(){const t=this.builder.activeSection;let e=this.builder.wrapperEl.querySelectorAll(".is-section:not(.is-static)"),i=e[e.length-1];t.parentNode.insertBefore(t,i.nextElementSibling),this.builder.settings.onRender(),this.builder.scrollTo(t,600)}sectionDuplicate(){const t=this.builder.activeSection;let e=t.cloneNode(!0);e.setAttribute("data-section-copied","1"),t.parentNode.insertBefore(e,t.nextElementSibling);let i=this.builder.doc.querySelector("[data-section-copied]");if(i.removeAttribute("data-section-copied"),l.removeClass(i,"section-active"),i.querySelectorAll(".is-overlay-content[data-module]").forEach((t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,l.uniqueId()),l.html(t,e)})),this.builder.sectionSetup(i),l.hasClass(i,"is-box"))this.builder.boxSetup(i);else{i.querySelectorAll(".is-box").forEach((t=>{this.builder.boxSetup(t)}))}i.querySelectorAll(".is-builder").forEach((t=>{let e=this.builder.editor.html(t),i=document.createRange();t.innerHTML="",t.appendChild(i.createContextualFragment(e)),t.removeAttribute("data-sort"),this.builder.editor.applyBehaviorOn(t)}));const n=i.querySelector(".is-arrow-down a");n&&n.addEventListener("click",(t=>(this.builder.scrollTo(i.nextElementSibling),t.preventDefault(),t.stopImmediatePropagation(),!1))),this.builder.settings.onRender(),this.builder.hideModal(this.modalEditSection),this.builder.scrollTo(i,600)}sectionAnimStart(t){const e=this.builder.activeSection;e.removeAttribute("data-bottom-top"),e.removeAttribute("data-300-bottom"),e.removeAttribute("data-400-bottom"),e.removeAttribute("data-center-top"),e.removeAttribute("data-anim-start"),e.style.transform="","zoom-in"===t?(e.setAttribute("data-bottom-top","transform:translateX(0%) translateY(0%) scale(0.7)"),e.setAttribute("data-300-bottom","transform:translateX(0%) translateY(0%) scale(1)")):"zoom-out"===t?(e.setAttribute("data-bottom-top","transform:translateX(0%) translateY(0%) scale(1.5)"),e.setAttribute("data-300-bottom","transform:translateX(0%) translateY(0%) scale(1)")):"slide-left"===t?(e.setAttribute("data-bottom-top","transform:translateX(100%) translateY(0%) scale(1)"),e.setAttribute("data-center-top","transform:translateX(0%) translateY(0%) scale(1)")):"slide-right"===t&&(e.setAttribute("data-bottom-top","transform:translateX(-100%) translateY(0%) scale(1)"),e.setAttribute("data-center-top","transform:translateX(0%) translateY(0%) scale(1)")),e.setAttribute("data-anim-start",t),"overlap"===e.getAttribute("data-anim-end")?e.setAttribute("data-smooth-scrolling","off"):e.removeAttribute("data-smooth-scrolling"),this.builder.settings.onRender()}sectionAnimEnd(t){const e=this.builder.activeSection;e.removeAttribute("data-top-bottom"),e.removeAttribute("data-center"),e.removeAttribute("data-anim-end"),e.style.transform="","zoom-in"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(0%) scale(1.5)")):"zoom-out"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1);"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(0%) scale(0.5)")):"overlap"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(70%) scale(1)"),e.setAttribute("data-smooth-scrolling","off")):"slide-left"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(-100%) translateY(0%) scale(1)")):"slide-right"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(100%) translateY(0%) scale(1)")):"slide-back"===t&&(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1);"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(100%) scale(0.5)")),e.setAttribute("data-anim-end",t),"overlap"===e.getAttribute("data-anim-end")?e.setAttribute("data-smooth-scrolling","off"):e.removeAttribute("data-smooth-scrolling"),this.builder.settings.onRender()}sectionHeight(t){const e=this.builder.activeSection;e.style.height="",l.removeClass(e,"is-section-auto"),l.removeClass(e,"is-section-20"),l.removeClass(e,"is-section-25"),l.removeClass(e,"is-section-30"),l.removeClass(e,"is-section-40"),l.removeClass(e,"is-section-50"),l.removeClass(e,"is-section-60"),l.removeClass(e,"is-section-70"),l.removeClass(e,"is-section-75"),l.removeClass(e,"is-section-80"),l.removeClass(e,"is-section-90"),l.removeClass(e,"is-section-100"),"0"===t?l.addClass(e,"is-section-auto"):l.addClass(e,"is-section-"+t),this.builder.settings.onRender(),this.builder.scrollTo(e,600)}boxSpacing(t){const e=this.builder.activeSection,i=this.modalEditSection.querySelector(".div-section-bgcolor");""==t?(l.removeClass(e,"box-space"),l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-m"),l.removeClass(e,"box-space-lg"),i.style.display="none"):(l.addClass(e,"box-space"),i.style.display="flex"),"sm"===t?(l.removeClass(e,"box-space-m"),l.removeClass(e,"box-space-lg"),l.addClass(e,"box-space-sm")):"m"==t?(l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-lg"),l.addClass(e,"box-space-m")):"lg"==t?(l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-m"),l.addClass(e,"box-space-lg")):"default"==t&&(l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-m"),l.removeClass(e,"box-space-lg"))}sectionUseScroll(){const t=this.builder.activeSection;if(this.modalEditSection.querySelector("#chkScrollIcon").checked){t.querySelector(".is-section-tool").insertAdjacentHTML("beforebegin",'<div class="is-arrow-down bounce"><a href="#"><i class="icon ion-ios-arrow-thin-down"></i></a></div>');t.querySelector(".is-arrow-down a").addEventListener("click",(e=>(this.builder.scrollTo(t.nextElementSibling),e.preventDefault(),e.stopImmediatePropagation(),!1)))}else{const e=t.querySelector(".is-arrow-down");e.parentNode.removeChild(e)}}sectionScrollIcon(t){const e=this.builder.activeSection.querySelector(".is-arrow-down");"light"===t?l.addClass(e,"light"):l.removeClass(e,"light")}sectionScrollPreset(t){const e=this.builder.activeSection,i=e.querySelector(".is-arrow-down");if(i&&i.parentNode.removeChild(i),"1"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="1" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="border-radius: 5px;background:${"rgb(173 173 173 / 26%)"};box-shadow:0px 5px 5px 0px rgba(0, 0, 0, 0.03);">\n <svg style="width:17px;height:17px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("2"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="2" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="border-radius: 5px;background:${"rgb(221 221 221 / 30%)"};box-shadow:0px 5px 5px 0px rgba(0, 0, 0, 0.03);">\n <svg style="width:17px;height:17px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("3"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="3">\n <a href="#" style="background:${"rgba(193, 193, 193, 0.18)"};border-radius:500px">\n <svg style="width:22px;height:22px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("4"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="4">\n <a href="#" style="background:${"rgba(193, 193, 193, 0.18)"};border-radius:500px">\n <svg style="width:22px;height:22px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("5"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="5">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M349.7 322.2c-3.1-3.1-8-3-11.3 0L264 388.6V104c0-4.4-3.6-8-8-8s-8 3.6-8 8v284.6l-74.4-66.3c-3.4-2.9-8.1-3.2-11.2-.1-3.1 3.1-3.3 8.5-.1 11.4 0 0 87 79.2 88 80s2.8 2.4 5.7 2.4 4.9-1.6 5.7-2.4 88-80 88-80c1.5-1.5 2.3-3.6 2.3-5.7s-.8-4.1-2.3-5.7z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("6"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="6">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M349.7 322.2c-3.1-3.1-8-3-11.3 0L264 388.6V104c0-4.4-3.6-8-8-8s-8 3.6-8 8v284.6l-74.4-66.3c-3.4-2.9-8.1-3.2-11.2-.1-3.1 3.1-3.3 8.5-.1 11.4 0 0 87 79.2 88 80s2.8 2.4 5.7 2.4 4.9-1.6 5.7-2.4 88-80 88-80c1.5-1.5 2.3-3.6 2.3-5.7s-.8-4.1-2.3-5.7z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("7"===t){let t="#fff",i="border:#333 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="7" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="${i}border-radius: 5px;background:none;">\n <svg style="width:17px;height:17px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}if("8"===t){let t="#000",i="border:#333 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="8" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="${i}border-radius: 5px;background:none;">\n <svg style="width:17px;height:17px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}if("9"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="9">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("10"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="10">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("11"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="11">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:60px;height:60px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("12"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="12">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:60px;height:60px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("13"===t){let t="#fff",i="border:#111 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="13" style="width: 40px;margin-left: -20px;height: 35px;">\n <a href="#" style="background:none;border-radius:unset;${i};">\n <svg style="width:25px;height:25px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}if("14"===t){let t="#000",i="border:#111 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="14" style="width: 40px;margin-left: -20px;height: 35px;">\n <a href="#" style="background:none;border-radius:unset;${i}">\n <svg style="width:25px;height:25px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}const n=e.querySelector(".is-arrow-down a");n&&n.addEventListener("click",(t=>(this.builder.scrollTo(e.nextElementSibling),t.preventDefault(),t.stopImmediatePropagation(),!1)))}}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},u={exports:{}},p={},h={exports:{}},g={},f={};function m(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function b(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function v(t,e){this.__indent_cache=new b(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.clone_empty=function(){var t=new m(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},m.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},m.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},m.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return 0===this.__items.length},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},m.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},b.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},b.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},b.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},v.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},v.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},f.Output=v;var y={};y.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var _,x,w,S,C,k={};x="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",S="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",C="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(w="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",(_=k).identifier=new RegExp(C+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),_.identifierStart=new RegExp(C),_.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+x+w+S+"])+"),_.newline=/[\n\r\u2028\u2029]/,_.lineBreak=new RegExp("\r\n|"+_.newline.source),_.allLineBreaks=new RegExp(_.lineBreak.source,"g");var E={},A={};function L(t,e){this.raw_options=q(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function q(t,e){var i,n={};for(i in t=T(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function T(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}L.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},L.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},L.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},L.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},L.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},L.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},L.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},A.Options=L,A.normalizeOpts=T,A.mergeOpts=q;var M=A.Options,R=["before-newline","after-newline","preserve-newline"];function O(t){M.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",R),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}O.prototype=new M,E.Options=O;var B={},N={},I=RegExp.prototype.hasOwnProperty("sticky");function D(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}D.prototype.restart=function(){this.__position=0},D.prototype.back=function(){this.__position>0&&(this.__position-=1)},D.prototype.hasNext=function(){return this.__position<this.__input_length},D.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},D.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},D.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||I&&t.sticky||i.index!==e&&(i=null),i},D.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},D.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},D.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},D.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},D.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},D.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},D.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&I&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},D.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},D.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},D.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},N.InputScanner=D;var P={},$={};function z(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}z.prototype.restart=function(){this.__position=0},z.prototype.isEmpty=function(){return 0===this.__tokens_length},z.prototype.hasNext=function(){return this.__position<this.__tokens_length},z.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},z.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},z.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},$.TokenStream=z;var H={},j={};function F(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}F.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},F.prototype.read_match=function(){return this._input.match(this._match_pattern)},F.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},F.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},F.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},F.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},F.prototype._create=function(){return new F(this._input,this)},F.prototype._update=function(){},j.Pattern=F;var U=j.Pattern;function W(t,e){U.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}W.prototype=new U,W.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},W.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},W.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},W.prototype._create=function(){return new W(this._input,this)},W.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},H.WhitespacePattern=W;var V=N.InputScanner,G=y.Token,X=$.TokenStream,Y=H.WhitespacePattern,K={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Z=function(t,e){this._input=new V(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Y(this._input)};Z.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new X,this._reset();for(var e=new G(K.START,""),i=null,n=[],o=new X;e.type!==K.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new X),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Z.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Z.prototype._reset=function(){},Z.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(K.RAW,i):this._create_token(K.EOF,"")},Z.prototype._is_comment=function(t){return!1},Z.prototype._is_opening=function(t){return!1},Z.prototype._is_closing=function(t,e){return!1},Z.prototype._create_token=function(t,e){return new G(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Z.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},P.Tokenizer=Z,P.TOKEN=K;var Q={};function J(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}J.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},J.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},Q.Directives=J;var tt={},et=j.Pattern,it={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function nt(t,e){et.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},it),this._excluded=Object.assign({},it),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new et(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}nt.prototype=new et,nt.prototype._create=function(){return new nt(this._input,this)},nt.prototype._update=function(){this.__set_templated_pattern()},nt.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},nt.prototype.read_options=function(t){var e=this._create();for(var i in it)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},nt.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},nt.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},nt.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},nt.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},tt.TemplatablePattern=nt;var ot=N.InputScanner,st=P.Tokenizer,at=P.TOKEN,rt=Q.Directives,lt=k,dt=j.Pattern,ct=tt.TemplatablePattern;function ut(t,e){return-1!==e.indexOf(t)}var pt={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:at.START,RAW:at.RAW,EOF:at.EOF},ht=new rt(/\/\*/,/\*\//),gt=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ft=/[0-9]/,mt=/[^\d\.]/,bt=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),vt=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";vt=(vt="\\?\\.(?!\\d) "+(vt=vt.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var yt,_t=new RegExp(vt),xt="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),wt=xt.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),St=new RegExp("^(?:"+wt.join("|")+")$"),Ct=function(t,e){st.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new dt(this._input),n=new ct(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(lt.identifier).matching(lt.identifierMatch),number:i.matching(gt),punct:i.matching(_t),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(lt.lineBreak),shebang:i.starting_with(/#!/).until_after(lt.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(Ct.prototype=new st)._is_comment=function(t){return t.type===pt.COMMENT||t.type===pt.BLOCK_COMMENT||t.type===pt.UNKNOWN},Ct.prototype._is_opening=function(t){return t.type===pt.START_BLOCK||t.type===pt.START_EXPR},Ct.prototype._is_closing=function(t,e){return(t.type===pt.END_BLOCK||t.type===pt.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},Ct.prototype._reset=function(){yt=!1},Ct.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(pt.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(pt.UNKNOWN,this._input.next())},Ct.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(lt.allLineBreaks,"\n"),t.type!==pt.DOT&&(t.type!==pt.RESERVED||"set"!==t.text&&"get"!==t.text)&&St.test(e)?"in"===e||"of"===e?this._create_token(pt.OPERATOR,e):this._create_token(pt.RESERVED,e):this._create_token(pt.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(pt.WORD,e):void 0},Ct.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(pt.START_EXPR,t):")"===t||"]"===t?e=this._create_token(pt.END_EXPR,t):"{"===t?e=this._create_token(pt.START_BLOCK,t):"}"===t?e=this._create_token(pt.END_BLOCK,t):";"===t?e=this._create_token(pt.SEMICOLON,t):"."===t&&mt.test(this._input.peek(1))?e=this._create_token(pt.DOT,t):","===t&&(e=this._create_token(pt.COMMA,t)),e&&this._input.next(),e},Ct.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(pt.EQUALS,t):"?."===t?this._create_token(pt.DOT,t):this._create_token(pt.OPERATOR,t)},Ct.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(pt.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(pt.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(ft)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(pt.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(lt.newline);)e+=this._input.next();return yt=!0,this._create_token(pt.COMMENT,e)}}else if(yt&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return yt=!1,this._create_token(pt.COMMENT,e);return null},Ct.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=ht.get_directives(i);n&&"start"===n.ignore&&(i+=ht.readIgnored(this._input)),i=i.replace(lt.allLineBreaks,"\n"),(e=this._create_token(pt.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(pt.COMMENT,i))}return e},Ct.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new ot(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(lt.allLineBreaks,"\n"),this._create_token(pt.STRING,e)}return null},Ct.prototype._allow_regexp_or_xml=function(t){return t.type===pt.RESERVED&&ut(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===pt.END_EXPR&&")"===t.text&&t.opened.previous.type===pt.RESERVED&&ut(t.opened.previous.text,["if","while","for"])||ut(t.type,[pt.COMMENT,pt.START_EXPR,pt.START_BLOCK,pt.START,pt.END_BLOCK,pt.OPERATOR,pt.EQUALS,pt.EOF,pt.SEMICOLON,pt.COMMA])},Ct.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(lt.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(lt.identifier)),this._create_token(pt.STRING,i)}return null},Ct.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),a=0;n;){var r=!!n[1],l=n[2];if(!(!!n[n.length-1]||"![CDATA["===l.slice(0,8))&&(l===o||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(r?--a:++a),i+=n[0],a<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(lt.allLineBreaks,"\n"),this._create_token(pt.STRING,i)}}return null},Ct.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),a="";this._input.hasNext();){if((a=this._input.next())===t||!e&<.newline.test(a)){this._input.back();break}"\\"===a&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),a+=this._input.next()):i&&("${"===i&&"$"===a&&"{"===this._input.peek()&&(a+=this._input.next()),i===a&&(a+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next()))),s+=a+=o.read()}return s},B.Tokenizer=Ct,B.TOKEN=pt,B.positionable_operators=bt.slice(),B.line_starters=xt.slice();var kt=f.Output,Et=y.Token,At=k,Lt=E.Options,qt=B.Tokenizer,Tt=B.line_starters,Mt=B.positionable_operators,Rt=B.TOKEN;function Ot(t,e){return-1!==e.indexOf(t)}function Bt(t,e){return t&&t.type===Rt.RESERVED&&t.text===e}function Nt(t,e){return t&&t.type===Rt.RESERVED&&Ot(t.text,e)}var It=["case","return","do","if","throw","else","await","break","continue","async"],Dt=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),Pt=[Dt.before_newline,Dt.preserve_newline],$t="BlockStatement",zt="Statement",Ht="ObjectLiteral",jt="ArrayLiteral",Ft="ForInitializer",Ut="Conditional",Wt="Expression";function Vt(t,e){e.multiline_frame||e.mode===Ft||e.mode===Ut||t.remove_indent(e.start_line_index)}function Gt(t){return t===jt}function Xt(t){return Ot(t,[Wt,Ft,Ut])}function Yt(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new Lt(e)}Yt.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new Et(Rt.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},Yt.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new kt(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode($t);var i=new qt(t,this._options);return this._tokens=i.tokenize(),t},Yt.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&At.lineBreak.test(t||"")&&(e=t.match(At.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},Yt.prototype.handle_token=function(t,e){t.type===Rt.START_EXPR?this.handle_start_expr(t):t.type===Rt.END_EXPR?this.handle_end_expr(t):t.type===Rt.START_BLOCK?this.handle_start_block(t):t.type===Rt.END_BLOCK?this.handle_end_block(t):t.type===Rt.WORD||t.type===Rt.RESERVED?this.handle_word(t):t.type===Rt.SEMICOLON?this.handle_semicolon(t):t.type===Rt.STRING?this.handle_string(t):t.type===Rt.EQUALS?this.handle_equals(t):t.type===Rt.OPERATOR?this.handle_operator(t):t.type===Rt.COMMA?this.handle_comma(t):t.type===Rt.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===Rt.COMMENT?this.handle_comment(t,e):t.type===Rt.DOT?this.handle_dot(t):t.type===Rt.EOF?this.handle_eof(t):(t.type,Rt.UNKNOWN,this.handle_unknown(t,e))},Yt.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&Gt(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var a=1;a<i;a+=1)this.print_newline(!0,e)}};var Kt=["async","break","continue","return","throw","yield"];Yt.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(Ot(this._flags.last_token.text,Mt)||Ot(t.text,Mt)){var n=Ot(this._flags.last_token.text,Mt)&&Ot(this._options.operator_position,Pt)||Ot(t.text,Mt);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(Nt(this._flags.last_token,Kt))return;this._output.set_wrap_point()}}},Yt.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==Rt.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==zt||this._flags.if_block&&Bt(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},Yt.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||Gt(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Yt.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===Rt.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},Yt.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Yt.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Yt.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Yt.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===zt&&Vt(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Yt.prototype.start_of_object_property=function(){return this._flags.parent.mode===Ht&&this._flags.mode===zt&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Nt(this._flags.last_token,["get","set"]))},Yt.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||Nt(this._flags.last_token,["var","let","const"])&&t.type===Rt.WORD)||Bt(this._flags.last_token,"do"))||!(this._flags.parent.mode===Ht&&this._flags.mode===zt)&&Nt(this._flags.last_token,Kt)&&!t.newlines)||Bt(this._flags.last_token,"else")&&!(Bt(t,"if")&&!t.comments_before))||this._flags.last_token.type===Rt.END_EXPR&&(this._previous_flags.mode===Ft||this._previous_flags.mode===Ut))||this._flags.last_token.type===Rt.WORD&&this._flags.mode===$t&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==Rt.WORD&&t.type!==Rt.RESERVED)||this._flags.mode===Ht&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Nt(this._flags.last_token,["get","set"])))&&(this.set_mode(zt),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,Nt(t,["do","for","if","while"])),!0)},Yt.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=Wt;if("["===t.text){if(this._flags.last_token.type===Rt.WORD||")"===this._flags.last_token.text)return Nt(this._flags.last_token,Tt)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=jt,Gt(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),Ot(this._flags.last_token.type,[Rt.START_EXPR,Rt.END_EXPR,Rt.WORD,Rt.OPERATOR,Rt.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Rt.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Ft):Ot(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Ut):Ot(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(Ot(this._flags.last_token.text,Tt)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Rt.EQUALS||this._flags.last_token.type===Rt.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===Rt.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);Nt(i,["async","function"])||"*"===i.text&&Nt(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Ht&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===Rt.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(Ot(this._last_last_text,["function","yield"])||this._flags.mode===Ht&&Ot(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===Rt.START_BLOCK?this.print_newline():this._flags.last_token.type!==Rt.END_EXPR&&this._flags.last_token.type!==Rt.START_EXPR&&this._flags.last_token.type!==Rt.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==Rt.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Yt.prototype.handle_end_expr=function(t){for(;this._flags.mode===zt;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&Gt(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==Rt.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),Vt(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ut&&(this._previous_flags.mode=Wt,this._flags.do_block=!1,this._flags.do_while=!1)},Yt.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===Rt.END_EXPR?(this.set_mode($t),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode($t):i&&(Ot(i.text,[":",","])&&Ot(e.type,[Rt.STRING,Rt.WORD,Rt.RESERVED])||Ot(e.text,["get","set","..."])&&Ot(i.type,[Rt.WORD,Rt.RESERVED]))?Ot(this._last_last_text,["class","interface"])&&!Ot(i.text,[":",","])?this.set_mode($t):this.set_mode(Ht):this._flags.last_token.type===Rt.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode($t):Ot(this._flags.last_token.type,[Rt.EQUALS,Rt.START_EXPR,Rt.COMMA,Rt.OPERATOR])||Nt(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Ht):this.set_mode($t);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===Rt.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do{if(s+=1,(a=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==Rt.EOF&&(a.type!==Rt.END_BLOCK||a.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Rt.OPERATOR&&(o||this._flags.last_token.type===Rt.EQUALS||Nt(this._flags.last_token,It)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!Gt(this._previous_flags.mode)||this._flags.last_token.type!==Rt.START_EXPR&&this._flags.last_token.type!==Rt.COMMA||((this._flags.last_token.type===Rt.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Rt.COMMA||this._flags.last_token.type===Rt.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Rt.OPERATOR&&this._flags.last_token.type!==Rt.START_EXPR&&(this._flags.last_token.type!==Rt.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},Yt.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===zt;)this.restore_mode();var e=this._flags.last_token.type===Rt.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(Gt(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},Yt.prototype.handle_word=function(t){if(t.type===Rt.RESERVED)if(Ot(t.text,["set","get"])&&this._flags.mode!==Ht)t.type=Rt.WORD;else if("import"===t.text&&Ot(this._tokens.peek().text,["(","."]))t.type=Rt.WORD;else if(Ot(t.text,["as","from"])&&!this._flags.import_block)t.type=Rt.WORD;else if(this._flags.mode===Ht){":"===this._tokens.peek().text&&(t.type=Rt.WORD)}if(this.start_of_statement(t)?Nt(this._flags.last_token,["var","let","const"])&&t.type===Rt.WORD&&(this._flags.declaration_statement=!0):!t.newlines||Xt(this._flags.mode)||this._flags.last_token.type===Rt.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===Rt.EQUALS||!this._options.preserve_newlines&&Nt(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(Bt(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&Bt(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===zt;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&Nt(t,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==Rt.COMMA&&this._flags.last_token.type!==Rt.START_EXPR&&this._flags.last_token.type!==Rt.EQUALS&&this._flags.last_token.type!==Rt.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),Bt(t,"function"))return(Ot(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!Ot(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==Rt.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===Rt.RESERVED||this._flags.last_token.type===Rt.WORD?Nt(this._flags.last_token,["get","set","new","export"])||Nt(this._flags.last_token,Kt)||Bt(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Rt.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!Xt(this._flags.mode)&&!Gt(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===Rt.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":Nt(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===Rt.SEMICOLON&&this._flags.mode===$t?e="NEWLINE":this._flags.last_token.type===Rt.SEMICOLON&&Xt(this._flags.mode)?e="SPACE":this._flags.last_token.type===Rt.STRING?e="NEWLINE":this._flags.last_token.type===Rt.RESERVED||this._flags.last_token.type===Rt.WORD||"*"===this._flags.last_token.text&&(Ot(this._last_last_text,["function","yield"])||this._flags.mode===Ht&&Ot(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===Rt.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===Rt.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),Nt(t,Tt)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),Nt(t,["else","catch","finally"]))?(this._flags.last_token.type!==Rt.END_BLOCK||this._previous_flags.mode!==$t||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?Nt(this._flags.last_token,It)||"declare"===this._flags.last_token.text&&Nt(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Rt.END_EXPR?this._flags.last_token.type===Rt.START_EXPR&&Nt(t,["var","let","const"])||":"===this._flags.last_token.text||(Bt(t,"if")&&Bt(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):Nt(t,Tt)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&Gt(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==Rt.WORD&&t.previous.type!==Rt.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===Rt.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&Bt(t,"from")&&(this._flags.import_block=!1))},Yt.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==zt||this._flags.if_block&&Bt(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},Yt.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==Rt.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===Rt.RESERVED||this._flags.last_token.type===Rt.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Rt.COMMA||this._flags.last_token.type===Rt.START_EXPR||this._flags.last_token.type===Rt.EQUALS||this._flags.last_token.type===Rt.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==Rt.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},Yt.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},Yt.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Xt(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===Ht||this._flags.mode===zt&&this._flags.parent.mode===Ht?(this._flags.mode===zt&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},Yt.prototype.handle_operator=function(t){var e="*"===t.text&&(Nt(this._flags.last_token,["function","yield"])||Ot(this._flags.last_token.type,[Rt.START_BLOCK,Rt.COMMA,Rt.END_BLOCK,Rt.SEMICOLON])),i=Ot(t.text,["-","+"])&&(Ot(this._flags.last_token.type,[Rt.START_BLOCK,Rt.START_EXPR,Rt.EQUALS,Rt.OPERATOR])||Ot(this._flags.last_token.text,Tt)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(Nt(this._flags.last_token,It))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==Rt.DOT)if("::"!==t.text){if(this._flags.last_token.type===Rt.OPERATOR&&Ot(this._options.operator_position,Pt)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==Rt.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var o=!0,s=!0,a=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,a=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&Ot(t.text,Mt)){var r=":"===t.text,l=r&&a,d=r&&!a;switch(this._options.operator_position){case Dt.before_newline:return this._output.space_before_token=!d,this.print_token(t),r&&!l||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case Dt.after_newline:return this._output.space_before_token=!0,!r||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case Dt.preserve_newline:return d||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||d),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var c=this._tokens.peek();s=c&&Ot(c.type,[Rt.WORD,Rt.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===Rt.START_BLOCK,s=!1):(Ot(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==Rt.COMMA&&this._flags.last_token.type!==Rt.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text&&"~"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&Xt(this._flags.mode)&&(o=!0),this._flags.last_token.type===Rt.RESERVED?o=!0:this._flags.last_token.type===Rt.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===Rt.OPERATOR&&(o=Ot(t.text,["--","-","++","+"])&&Ot(this._flags.last_token.text,["--","-","++","+"]),Ot(t.text,["+","-"])&&Ot(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==$t||this._flags.inline_frame)&&this._flags.mode!==zt||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},Yt.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):At.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},Yt.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(At.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,a=t.whitespace_before,r=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,a),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(r))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},Yt.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},Yt.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),Nt(this._flags.last_token,It)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},Yt.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},Yt.prototype.handle_eof=function(t){for(;this._flags.mode===zt;)this.restore_mode();this.handle_whitespace_and_comments(t)},g.Beautifier=Yt;var Zt=g.Beautifier,Qt=E.Options;h.exports=function(t,e){return new Zt(t,e).beautify()},h.exports.defaultOptions=function(){return new Qt};var Jt={exports:{}},te={},ee={},ie=A.Options;function ne(t){ie.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}ne.prototype=new ie,ee.Options=ne;var oe=ee.Options,se=f.Output,ae=N.InputScanner,re=new(0,Q.Directives)(/\/\*/,/\*\//),le=/\r\n|[\r\n]/,de=/\r\n|[\r\n]/g,ce=/\s/,ue=/(?:\s|\n)+/g,pe=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,he=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ge(t,e){this._source_text=t||"",this._options=new oe(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template"]}ge.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},ge.prototype.eatWhitespace=function(t){for(var e=ce.test(this._input.peek()),i=0;ce.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},ge.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},ge.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},ge.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},ge.prototype.indent=function(){this._indentLevel++},ge.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ge.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&le.test(t||"")&&(e=t.match(le)[0]));var i=(t=t.replace(de,"\n")).match(/^[\t ]*/)[0];this._output=new se(this._options,i),this._input=new ae(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,a=!1,r=!1,l=!1,d=!1,c=!1,u=!1,p=this._ch,h=!1;n=""!==this._input.read(ue),o=p,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),p=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var g=this._input.read(pe),f=re.get_directives(g);f&&"start"===f.ignore&&(g+=re.readIgnored(this._input)),this.print_string(g),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(he)),this.eatWhitespace(!0);else if("@"===this._ch||"$"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var m=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);m.match(/[ :]$/)&&(m=this.eatString(": ").replace(/\s$/,""),this.print_string(m),this._output.space_before_token=!0),"extend"===(m=m.replace(/\s$/,""))?d=!0:"import"===m&&(c=!0),m in this.NESTED_AT_RULE?(this._nestedLevel+=1,m in this.CONDITIONAL_GROUP_RULE&&(l=!0)):a||0!==s||-1===m.indexOf(":")||(r=!0,this.indent())}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)r&&(r=!1,this.outdent()),l?(l=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===o?this._output.space_before_token=!1:","!==o&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),c=!1,d=!1,r&&(this.outdent(),r=!1),this.print_string(this._ch),a=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var b=0;b<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;b++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[b])){h=!0;break}!a&&!l||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||d||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),r||(r=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch)this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0);else if(";"===this._ch)h=!1,0===s?(r&&(this.outdent(),r=!1),d=!1,c=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),r&&"$"===o&&this._options.selector_separator_newline?(this._output.add_new_line(),u=!0):(this.eatWhitespace(),s++,this.indent()));else if(")"===this._ch)s&&(s--,this.outdent()),u&&";"===this._input.peek()&&this._options.selector_separator_newline&&(u=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||r&&!u||0!==s||c||d?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||r||0!==s)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(n),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),ce.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var v='"'===o||"'"===o;this.preserveSingleSpace(v||n),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&h&&this._output.add_new_line()}else this.print_string(" "),this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&ce.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},te.Beautifier=ge;var fe=te.Beautifier,me=ee.Options;Jt.exports=function(t,e){return new fe(t,e).beautify()},Jt.exports.defaultOptions=function(){return new me};var be={exports:{}},ve={},ye={},_e=A.Options;function xe(t){_e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}xe.prototype=new _e,ye.Options=xe;var we={},Se=P.Tokenizer,Ce=P.TOKEN,ke=Q.Directives,Ee=tt.TemplatablePattern,Ae=j.Pattern,Le={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:Ce.START,RAW:Ce.RAW,EOF:Ce.EOF},qe=new ke(/<\!--/,/-->/),Te=function(t,e){Se.call(this,t,e),this._current_tag_name="";var i=new Ee(this._input).read_options(this._options),n=new Ae(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(Te.prototype=new Se)._is_comment=function(t){return!1},Te.prototype._is_opening=function(t){return t.type===Le.TAG_OPEN},Te.prototype._is_closing=function(t,e){return t.type===Le.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},Te.prototype._reset=function(){this._current_tag_name=""},Te.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(Le.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(Le.UNKNOWN,this._input.next())},Te.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=qe.get_directives(i))&&"start"===n.ignore&&(i+=qe.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(Le.COMMENT,i)).directives=n));return e},Te.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(Le.COMMENT,i)).directives=null)}return e},Te.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(Le.TAG_OPEN,i)),n},Te.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(Le.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(Le.TAG_OPEN,i))),n},Te.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(Le.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(Le.TAG_CLOSE,"}}"))),n},Te.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(Le.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(Le.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===Le.EQUALS?this._create_token(Le.VALUE,o):this._create_token(Le.ATTRIBUTE,o));return n},Te.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},Te.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===Le.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=Le.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(Le.TEXT,n):null},Te.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(Le.TEXT,e)},we.Tokenizer=Te,we.TOKEN=Le;var Me=ye.Options,Re=f.Output,Oe=we.Tokenizer,Be=we.TOKEN,Ne=/\r\n|[\r\n]/,Ie=/\r\n|[\r\n]/g,De=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new Re(t,e)};De.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},De.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},De.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},De.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},De.prototype.print_preserved_newlines=function(t){var e=0;t.type!==Be.TEXT&&t.previous.type!==Be.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},De.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},De.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},De.prototype.print_newline=function(t){this._output.add_new_line(t)},De.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},De.prototype.indent=function(){this.indent_level++},De.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var Pe=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==Be.EOF&&t.closed!==i;){if(i.type===Be.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===Be.EQUALS&&i.next.next&&i.next.next.type===Be.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function $e(t,e){return-1!==e.indexOf(t)}function ze(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function He(t){this._printer=t,this._current_frame=null}function je(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new Me(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}He.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},He.prototype.record_tag=function(t){var e=new ze(this._current_frame,t,this._printer.indent_level);this._current_frame=e},He.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},He.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},He.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},He.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},je.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&Ne.test(t)&&(e=t.match(Ne)[0]));var i=(t=t.replace(Ie,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new Fe,s=new De(this._options,i),a=new Oe(t,this._options).tokenize();this._tag_stack=new He(s);for(var r=null,l=a.next();l.type!==Be.EOF;)l.type===Be.TAG_OPEN||l.type===Be.COMMENT?o=r=this._handle_tag_open(s,l,o,n):l.type===Be.ATTRIBUTE||l.type===Be.EQUALS||l.type===Be.VALUE||l.type===Be.TEXT&&!o.tag_complete?r=this._handle_inside_tag(s,l,o,a):l.type===Be.TAG_CLOSE?r=this._handle_tag_close(s,l,o):l.type===Be.TEXT?r=this._handle_text(s,l,o):s.add_raw_token(l),n=r,l=a.next();return s._output.get_code(e)},je.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},je.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===Be.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===Be.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===Be.EQUALS||e.type===Be.VALUE&&e.previous.type===Be.EQUALS)&&t.set_space_before_token(!1),e.type===Be.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var a=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var r,l=!0,d=0;do{if((r=n.peek(d)).type===Be.ATTRIBUTE){l=!1;break}d+=1}while(d<4&&r.type!==Be.EOF&&r.type!==Be.TAG_CLOSE);a=!l}a&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},je.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},je.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,a=1,r="",l="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new je(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-t.indent_level);var d=t.get_full_indent(a);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var c=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!c)return void t.add_raw_token(e);r=d+c[1]+"\n",s=c[4],c[5]&&(l=d+c[5]),s=s.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(e.whitespace_before=c[0])}if(s)if(o){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,s=o(d+s,new u)}else{var p=e.whitespace_before;p&&(s=s.replace(new RegExp("\n("+p+")?","g"),"\n")),s=d+s.replace(/\n/g,"\n"+d)}r&&(s=s?r+s+"\n"+l:r+l),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},je.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==Be.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var Fe=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text.split(" ")[0])),this.tag_check=this.tag_check.toLowerCase(),e.type===Be.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};je.prototype._get_tag_open_token=function(t){var e=new Fe(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||$e(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&$e(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&$e(e.tag_check,this._options.content_unformatted),e.is_inline_element=$e(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},je.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=Pe(i.tag_check,e)))),$e(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===Be.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===Be.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},je.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Ue=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],We=["a","audio","del","ins","map","noscript","video"];je.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Ue.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==We.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},ve.Beautifier=je;var Ve=ve.Beautifier,Ge=ye.Options;be.exports=function(t,e,i,n){return new Ve(t,e,i,n).beautify()},be.exports.defaultOptions=function(){return new Ge};var Xe=h.exports,Ye=Jt.exports,Ke=be.exports;function Ze(t,e,i,n){return Ke(t,e,i=i||Xe,n=n||Ye)}Ze.defaultOptions=Ke.defaultOptions,p.js=Xe,p.css=Ye,p.html=Ze,function(t){var e=p;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(u);var Qe=u.exports;const Je=new t;class ti{constructor(t){this.builder=t,this.builderStuff=this.builder.builderStuff;const e=this.builderStuff;let i="";i+='<iframe id="target-upload-cover" name="target-upload-cover" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>',i+='<div class="is-modal editcustomcode" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;"><div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">'+n("Custom Code (Javascript Allowed)")+'</div><textarea id="txtBoxCustomCode" class="inptxt" style="background: #fff;position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;box-sizing:border-box;"></textarea><input id="hidBoxCustomCode" type="hidden" /><button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">'+n("Ok")+'</button></div></div><div class="is-modal editbox" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div class="is-modal-content" style="max-width:380px;min-height:300px;padding:0"><div class="is-modal-bar is-draggable">'+n("Box Settings")+'</div><div class="is-tabs clearfix" style="padding-top:37px;" data-group="boxsettings"><a id="tabBoxGeneral" href="" data-content="divBoxGeneral" class="active">'+n("General")+'</a><a id="tabBoxContentContainer" href="" data-content="divBoxContentContainer">'+n("Content")+'</a><a id="tabBoxContentText" href="" data-content="divBoxContentText">'+n("Text")+'</a><a id="tabBoxImage" href="" data-content="divBoxImage">'+n("Image")+'</a><a id="tabBoxAnimate" href="" data-content="divBoxAnimate">'+n("Animate")+'</a><a id="tabBoxClick" href="" data-content="divBoxClick">'+n("On Click")+'</a></div><div id="divBoxGeneral" class="is-tab-content active" data-group="boxsettings" style="display:flex;padding-top:0"><div id="divBoxSize"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Box Size")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-smaller" style="width:40px;">-</button><button title="'+n("Increase")+'" class="cmd-box-larger" style="width:40px;border-left:none">+</button><br style="clear:both"></div></div>',i+='<div id="divContentSize"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Content Size")+': <span class="val-box-size" style="font-size:12px"></span></div><div style="display: flex;flex-direction: row;flex-wrap: wrap;"><input class="inp-box-size" type="text" style="display:none;width:80px;height:35px;text-align:center;font-size:12px;" /><button class="cmd-box-size" data-value="500" style="width:40px;border-left:none">500</button><button class="cmd-box-size" data-value="600" style="width:40px;border-left:none">600</button><button class="cmd-box-size" data-value="700" style="width:40px;border-left:none">700</button><button class="cmd-box-size" data-value="800" style="width:40px;border-top:none">800</button><button class="cmd-box-size" data-value="900" style="width:40px;border-top:none">900</button><button class="cmd-box-size" data-value="1000" style="width:40px;border-top:none;border-left:none">1000</button><button class="cmd-box-size" data-value="1100" style="width:40px;border-top:none;border-left:none">1100</button><button class="cmd-box-size" data-value="1200" style="width:40px;border-top:none;border-left:none">1200</button><button class="cmd-box-size" data-value="1300" style="width:40px;border-top:none;border-left:none">1300</button><button class="cmd-box-size" data-value="1400" style="width:40px;border-top:none;border-left:none">1400</button><button class="cmd-box-size" data-value="1500" style="width:40px;border-top:none;border-left:none">1500</button><button class="cmd-box-size" data-value="1600" style="width:40px;border-top:none;border-left:none">1600</button><button class="cmd-box-size" data-value="1800" style="width:40px;border-top:none;border-left:none">1800</button><button title="'+n("Clear")+'" class="cmd-box-size" data-value=""><svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button><button title="'+n("Decrease")+'" class="cmd-box-size" data-value="-" style="width:40px;border-top:none;border-left:none">-</button><button title="'+n("Increase")+'"class="cmd-box-size" data-value="+" style="width:40px;border-top:none;border-left:none">+</button><br style="clear:both"></div></div>',i+='<div id="divBoxBackgroundColor"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Background Color")+':</div><div style="display:flex;"><button title="'+n("Background Color")+'" class="input-box-bgcolor is-btn-color" style="margin-right:15px"></button><button title="'+n("Gradient")+'" class="input-box-gradient classic" data-value="+">'+n("Gradient")+'</button></div><div style="padding-top:20px;padding-bottom: 3px;">'+n("Background Image")+':</div><div style="height:auto"><div style="display:flex;align-items:flex-end;"><div class="box-bgimage-preview"></div><label class="label-box-bgimage-grayscale label-checkbox" for="chkBoxBgImageGrayscale" style="margin:0;margin-left:8px;margin-bottom:5px;"><input id="chkBoxBgImageGrayscale" class="chk-box-bgimage-grayscale" type="checkbox" /> '+n("Grayscale")+'</label></div><div style="display:flex;align-items: flex-end;"><button title="'+n("Image")+'" class="input-box-bgimage"><svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg><span>'+n("Image")+'</span></button><button title="'+n("Remove")+'" class="input-box-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button><button title="'+n("Adjust")+'" class="input-box-bgimageadjust"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button></div></div></div><div id="divBoxPickPhoto" class="is-settings" style="padding-top:20px"><button class="cmd-box-pickphoto" data-value="" style="width:100%"><svg class="is-icon-flex" style=""><use xlink:href="#ion-image"></use></svg></button></div><div style="display:flex;justify-content:flex-end;"><button title="'+n("Add Text")+'" class="cmd-box-addtext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#ion-android-add"></use></svg> <span>'+n("Text")+'</span></button><button title="'+n("Remove Text")+'" class="cmd-box-removetext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg> <span>'+n("Clear")+'</span></button></div><p id="divNoBoxSettings" style="text-align: center;display:none;">'+n("This box has no available settings.")+"</p></div>",i+='<div id="divBoxClick" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><label for="inpBoxLinkSource" style="display:block;padding-top:20px;">'+n("Open")+':</label><div class="image-src" style="display:flex"><input id="inpBoxLinkSource" class="input-src" type="text" style="height:38px"><button title="'+n("Select")+'" class="input-select" style="flex:none;width:40px;height:38px;background:transparent;"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button><div class="image-larger5" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;"><form class="form-upload-larger" target="frameTargetBoxLinkUpload" method="post" action="'+this.builder.largerImageHandler+'" enctype="multipart/form-data" style="position:absolute;top:0;left:0;width:100%;height:100%;"><input id="hidRefId5_box" name="hidRefId" type="hidden" value=""><svg class="is-icon-flex" style="position: absolute;top: 10px;left: 15px;"><use xlink:href="#ion-image"></use></svg><input title="'+n("Select")+'" id="fileImage5" name="fileImage" type="file" accept="image/*,video/mp4" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;"></form><iframe id="frameTargetBoxLinkUpload" tabindex="-1" name="frameTargetBoxLinkUpload" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe></div></div><div style="padding-top:20px"><button class="cmd-box-testclick">'+n("Test")+"</button></div></div>",i+='<div id="divBoxContentText" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Text Style")+':</div><div style="display:flex"><button title="'+n("Light")+'" class="cmd-box-textcolor" data-value="light">'+n("Light")+'</button><button title="'+n("Dark")+'" class="cmd-box-textcolor" data-value="dark" style="border-left:none;">'+n("Dark")+'</button><button title="'+n("Not Set")+'" class="cmd-box-textcolor" data-value="" style="border-left:none;">'+n("Not Set")+'</button><br style="clear:both"></div></div><div style="padding-top:20px;"><label for="chkOptimizeTextSize" style="margin:0;"><input id="chkOptimizeTextSize" type="checkbox" /> '+n("Optimize text sizes on large screen.")+"</label></div>",i+='<div id="divContainerTransparency" style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Transparency")+':</div><div style="display:flex"><button title="'+n("Increase")+'" class="cmd-box-textopacity" data-value="+" style="width:40px"> + </button><button title="'+n("Decrease")+'" class="cmd-box-textopacity" data-value="-" style="width:40px;border-left:none;"> - </button><button title="'+n("Not Set")+'" class="cmd-box-textopacity" data-value="" style="border-left:none;">'+n("Not Set")+'</button><br style="clear:both"></div></div><div id="divContainerTextAlign" style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">Align:</div><div style="display:flex"><button title="'+n("Align Left")+'" class="cmd-box-textalign" data-value="left" style="width:40px"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-left"></use></svg></button><button title="'+n("Align Center")+'" class="cmd-box-textalign" data-value="center" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-center"></use></svg></button><button title="'+n("Align Right")+'" class="cmd-box-textalign" data-value="right" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-right"></use></svg></button><button title="'+n("Align Full")+'" class="cmd-box-textalign" data-value="justify" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-full"></use></svg></button><button title="'+n("Not Set")+'" class="cmd-box-textalign" data-value="" style="border-left:none;">'+n("Not Set")+'</button><br style="clear:both"></div></div>',i+=(this.builder.settings.enableContentStyle?'<div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Typography")+':</div><div style="display:flex"><button title="'+n("Change Style")+'" class="cmd-box-typography" data-value="+"> '+n("Change Style")+' </button><br style="clear:both"></div></div>':"")+'</div><div id="divBoxContentContainer" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><div style="padding-top:10px;"><label for="chkParallaxContent" style="margin:0;"><input id="chkParallaxContent" type="checkbox" /> '+n("Parallax")+'</label></div><div style="padding-top:10px;"><label for="chkFadeContent" style="margin:0;"><input id="chkFadeContent" type="checkbox" /> '+n("Fade")+"</label></div>",i+='<div style="display:flex;flex-direction: row;"><div style="display:flex;flex-direction: column;margin-right:20px;"><div style="padding-top:13px;padding-bottom: 3px;">'+n("Position")+':</div><div style="display:flex"><button title="'+n("Top Left")+'" class="cmd-box-content-pos" data-value="topleft" style="width:40px;">↖</button><button title="'+n("Top Center")+'" class="cmd-box-content-pos" data-value="topcenter" style="width:40px;border-left:none;">↑</button><button title="'+n("Top Right")+'" class="cmd-box-content-pos" data-value="topright" style="width:40px;border-left:none;">↗</button></div><div style="display:flex"><button title="'+n("Middle Left")+'" class="cmd-box-content-pos" data-value="middleleft" style="width:40px;border-top:none;">←</button><button title="'+n("Middle Center")+'" class="cmd-box-content-pos" data-value="middlecenter" style="width:40px;border-left:none;border-top:none;">☉</button><button title="'+n("Middle Right")+'" class="cmd-box-content-pos" data-value="middleright" style="width:40px;border-left:none;border-top:none;">→</button></div><div style="display:flex"><button title="'+n("Bottom Left")+'" class="cmd-box-content-pos" data-value="bottomleft" style="width:40px;border-top:none;">↙</button><button title="'+n("Bottom Center")+'" class="cmd-box-content-pos" data-value="bottomcenter" style="width:40px;border-left:none;border-top:none;">↓</button><button title="'+n("Bottom Right")+'" class="cmd-box-content-pos" data-value="bottomright" style="width:40px;border-left:none;border-top:none;">↘</button></div></div><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 1px;">'+n("Height")+':</div><div style="display: flex;flex-direction: row;flex-wrap: wrap;"><button title="'+n("Auto")+'" class="cmd-content-height" data-value="" style="width:60px">Auto</button><button title="'+n("Full")+'" class="cmd-content-height" data-value="100" style="width:40px">Full</button></div><div class="div-content-justify"><div style="padding-top:10px;padding-bottom: 1px;">'+n("Justify")+':</div><div style="display: flex;flex-direction: row;flex-wrap: wrap;"><button title="'+n("Top")+'" class="cmd-content-justify" data-value="flex-start" style="width:40px"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-arrow-bar-to-up"></use></svg></button><button title="'+n("Bottom")+'" class="cmd-content-justify" data-value="flex-end" style="width:40px"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-arrow-bar-to-down"></use></svg></button><button title="'+n("Space Between")+'" class="cmd-content-justify" data-value="space-between" style="width:40px"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-space-between"></use></svg></button></div></div></div></div>',i+='<div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Vertical Adjustment")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-content-edge-y" data-value="-" style="width:40px;">-</button><button title="'+n("Increase")+'" class="cmd-box-content-edge-y" data-value="+" style="width:40px;border-left:none;">+</button><button title="'+n("Not Set")+'" class="cmd-box-content-edge-y" data-value="" style="display:none;width:40px;border-left:none;min-width:100px;">'+n("Not Set")+'</button></div></div><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Horizontal Adjustment")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-content-edge-x" data-value="-" style="width:40px;">-</button><button title="'+n("Increase")+'" class="cmd-box-content-edge-x" data-value="+" style="width:40px;border-left:none;">+</button><button title="'+n("Not Set")+'" class="cmd-box-content-edge-x" data-value="" style="display:none;width:40px;border-left:none;min-width:100px;">'+n("Not Set")+'</button></div></div><div style="padding-top:13px;"><label for="chkAutofitContent" style="margin:0;"><input id="chkAutofitContent" type="checkbox" /> '+n("Autofit Content on Mobile")+"</label></div></div>",i+='<div id="divBoxImage" class="is-tab-content" data-group="boxsettings" style="padding-top:0">'+(null!=this.builder.settings.onCoverImageSelectClick?'<div style="padding-top:20px;"><button class="cmd-box-selectasset" style="width:120px;">'+n("Select Image")+'</button></div><div style="padding-top:20px;"><label for="chkAnimateBg" style="margin:0;"><input id="chkAnimateBg" type="checkbox" /> '+n("Ken Burns Effect")+"</label></div>":'<div style="padding-top:20px;"><label for="chkAnimateBg" style="margin:0;"><input id="chkAnimateBg" type="checkbox" /> '+n("Ken Burns Effect")+"</label></div>")+'<div style="padding-top:10px;"><label for="chkParallaxBg" style="margin:0;"><input id="chkParallaxBg" type="checkbox" /> '+n("Parallax")+" & "+n("Scale")+'</label></div><div style="padding-top:10px;"><label for="chkParallaxBg2" style="margin:0;"><input id="chkParallaxBg2" type="checkbox" /> '+n("Parallax")+" "+n("(visible on preview)")+"</label></div>",i+='<div style="padding-top:20px;padding-bottom: 3px;">'+n("Overlay Color")+':</div><div style="display:flex;"><button title="'+n("Overlay Color")+'" class="input-box-overlaycolor is-btn-color" style="margin-right:15px"></button></div><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Overlay Transparency")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-overlayopacity" data-value="-" style="width:40px;border-left:none;">-</button><button title="'+n("Increase")+'" class="cmd-box-overlayopacity" data-value="+" style="width:40px;">+</button><button title="'+n("None")+'" class="cmd-box-overlayopacity" data-value="0" style="border-left:none;min-width:100px;">'+n("None")+'</button></div></div></div><div id="divBoxAnimate" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><div style="display:flex;flex-direction: column;"><select class="cmd-box-animate"><option value="">'+n("None")+'</option><option value="is-pulse">pulse</option><option value="is-bounceIn">bounceIn</option><option value="is-fadeIn">fadeIn</option><option value="is-fadeInDown">fadeInDown</option><option value="is-fadeInLeft">fadeInLeft</option><option value="is-fadeInRight">fadeInRight</option><option value="is-fadeInUp">fadeInUp</option><option value="is-flipInX">flipInX</option><option value="is-flipInY">flipInY</option><option value="is-slideInUp">slideInUp</option><option value="is-slideInDown">slideInDown</option><option value="is-slideInLeft">slideInLeft</option><option value="is-slideInRight">slideInRight</option><option value="is-zoomIn">zoomIn</option></select><label for="chkAnimOnce" style="margin:10px 0 0;"><input id="chkAnimOnce" type="checkbox" /> '+n("Once")+"</label></div>",i+='<div><label style="padding-top:20px;">'+n("Delay")+': <select class="cmd-box-animatedelay" style="margin-top:3px;"><option value="">'+n("None")+'</option><option value="delay-0ms">0s</option><option value="delay-100ms">100ms</option><option value="delay-200ms">200ms</option><option value="delay-300ms">300ms</option><option value="delay-400ms">400ms</option><option value="delay-500ms">500ms</option><option value="delay-600ms">600ms</option><option value="delay-700ms">700ms</option><option value="delay-800ms">800ms</option><option value="delay-900ms">900ms</option><option value="delay-1000ms">1000ms</option><option value="delay-1100ms">1100ms</option><option value="delay-1200ms">1200ms</option><option value="delay-1300ms">1300ms</option><option value="delay-1400ms">1400ms</option><option value="delay-1500ms">1500ms</option><option value="delay-1600ms">1600ms</option><option value="delay-1700ms">1700ms</option><option value="delay-1800ms">1800ms</option><option value="delay-1900ms">1900ms</option><option value="delay-2000ms">2000ms</option><option value="delay-2100ms">2100ms</option><option value="delay-2200ms">2200ms</option><option value="delay-2300ms">2300ms</option><option value="delay-2400ms">2400ms</option><option value="delay-2500ms">2500ms</option><option value="delay-2600ms">2600ms</option><option value="delay-2700ms">2700ms</option><option value="delay-2800ms">2800ms</option><option value="delay-2900ms">2900ms</option><option value="delay-3000ms">3000ms</option></select></label></div><div style="padding-top:20px"><button class="cmd-box-animate-test" style="width:100%">'+n("Test")+'</button></div></div></div></div><div class="is-modal pickphoto" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width:1000px;height:570px;padding:0;box-sizing:border-box;position:relative;"><div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">'+n("Photos")+'</div><iframe style="position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-top:40px solid transparent;margin:0;box-sizing:border-box;" src="about:blank"></iframe></div></div>',Je.appendHtml(e,i);const o=e.querySelector(".is-modal.editbox");this.modalEditBox=o;const s=e.querySelector(".is-modal.editcustomcode"),a=e.querySelector(".is-modal.editmodule");new r(o);const l=o.querySelectorAll(".is-tabs a");l.forEach((t=>{t.addEventListener("click",(e=>{if(e.preventDefault(),Je.hasClass(t,"active"))return;l.forEach((t=>{Je.removeClass(t,"active")})),Je.addClass(t,"active");let i=t.getAttribute("data-content");o.querySelectorAll(".is-tab-content").forEach((t=>{t.style.display="none"})),o.querySelector("#"+i).style.display="block"}))})),o.querySelector("#tabBoxGeneral").click();o.querySelector(".cmd-box-smaller").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxWidthSmaller(),this.builder.settings.onChange()}));o.querySelector(".cmd-box-larger").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxWidthLarger(),this.builder.settings.onChange()}));o.querySelectorAll(".cmd-box-textcolor").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxTextColor(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-textalign").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxTextAlign(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-textopacity").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxTextOpacity(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-typography").forEach((t=>{t.addEventListener("click",(()=>{setTimeout((()=>{this.builder.hideModal(o),e.querySelector('.is-sidebar > button[data-command="typography"]').click();Je.appendHtml(e,'<div class="is-sidebar-overlay" style="position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,0.000001);z-index: 1000;"></div>');const t=e.querySelector(".is-sidebar-overlay");t&&t.addEventListener("click",(()=>{const t=document.querySelector(".is-sidebar-overlay");t&&(t.remove(),document.body.style.overflowY=""),document.querySelectorAll(".is-sidebar-button.active").forEach((t=>{Je.removeClass(t,"active")})),document.querySelectorAll(".is-sidebar-content.active").forEach((t=>{Je.removeClass(t,"active")}))})),e.querySelector('.is-sidebar > button[data-command="typography"]').setAttribute("data-applyto","box"),e.querySelector(".typo-target-default").style.display="none",e.querySelector(".typo-target-box").style.display="flex"}),10)}))}));o.querySelectorAll(".cmd-box-size").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();const e=this.builder.activeBox.querySelector(".is-container"),i=this.builder.contentSizes;let n,s=t.getAttribute("data-value");if(""===s)return e.style.maxWidth="",e.classList.forEach((t=>{-1!==t.indexOf("is-content-")&&"is-content-left"!==t&&"is-content-right"!==t&&Je.removeClass(e,t)})),Je.addClass(e,"is-content-none"),o.querySelector(".inp-box-size").value="",o.querySelector(".val-box-size").innerHTML="",void this.builder.settings.onChange();if("+"===s||"-"===s){for(let t=0;t<i.length;t++)if(Je.hasClass(e,`is-content-${i[t]}`)){if("+"===s){n=t+1>=i.length?i[t]:i[t+1];break}if("-"===s){n=t-1<0?i[t]:i[t-1];break}}if(!n){const t=e.offsetWidth;for(let e=0;e<i.length;e++){if(i[e]<=t&&t<i[e+1]&&"+"===s){n=i[e+1];break}if(i[e]<t&&t<=i[e+1]&&"-"===s){n=i[e];break}}}}else n=s;n||(n=800),e.style.maxWidth="",e.classList.forEach((t=>{-1!==t.indexOf("is-content-")&&"is-content-left"!==t&&"is-content-right"!==t&&Je.removeClass(e,t)})),Je.addClass(e,"is-content-"+n),o.querySelector(".inp-box-size").value=n,o.querySelector(".val-box-size").innerHTML=n,this.builder.settings.onChange()}))}));const d=o.querySelector(".inp-box-size");d.addEventListener("input",(()=>{this.builder.editor.saveForUndo();const t=[];let e=300;for(;e<=2700;)t.push(e),e+=20;let i=this.builder.activeBox.querySelector(".is-container");i.classList.forEach((t=>{-1!==t.indexOf("is-content-")&&"is-content-left"!==t&&"is-content-right"!==t&&Je.removeClass(i,t)}));let n=d.value;if(!isNaN(n)&&n>=300&&n<=2700){i.style.maxWidth=n+"px";let e=parseInt(window.getComputedStyle(i,null).getPropertyValue("max-width"));for(let i=0;i<=121;i++){let n=t[i];if(n>e){e=n;break}}n=e,n<=300&&(n=300),n>=2700&&(n=2700),Je.addClass(i,"is-content-"+n)}this.builder.settings.onChange()}));o.querySelectorAll(".cmd-content-justify").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value"),i=this.builder.activeBox.querySelector(".is-container");i.style.justifyContent="",Je.removeClass(i,"justify-start"),Je.removeClass(i,"justify-end"),Je.removeClass(i,"justify-between"),"flex-start"===e?Je.addClass(i,"justify-start"):"flex-end"===e?Je.addClass(i,"justify-end"):"space-between"===e&&Je.addClass(i,"justify-between"),o.querySelectorAll(".cmd-content-justify").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(t,"on"),this.builder.settings.onChange()}))}));const c=o.querySelectorAll(".cmd-content-height"),u=o.querySelector(".div-content-justify");c.forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value"),i=this.builder.activeBox.querySelector(".is-container");if(""===e&&(i.style.height="",Je.removeClass(i,"h-full"),Je.removeClass(i,"flex"),Je.removeClass(i,"flex-col"),Je.removeClass(i,"justify-start"),Je.removeClass(i,"justify-end"),Je.removeClass(i,"justify-between"),u.style.display="none"),"100"===e){Je.addClass(i,"h-full"),Je.addClass(i,"flex"),Je.addClass(i,"flex-col"),Je.removeClass(i,"justify-start"),Je.removeClass(i,"justify-end"),Je.addClass(i,"justify-between"),u.style.display="block",o.querySelectorAll(".cmd-content-justify").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(o.querySelector('.cmd-content-justify[data-value="space-between"]'),"on")}o.querySelectorAll(".cmd-content-height").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(t,"on"),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-content-pos").forEach((t=>{t.addEventListener("click",(()=>{let e=this.builder.activeBox,i=e.querySelector(".is-box-centered"),n=e.querySelector(".is-container");this.builder.editor.saveForUndo(),Je.removeClass(e.querySelector(".edge-y--5"),"edge-y--5"),Je.removeClass(e.querySelector(".edge-y--4"),"edge-y--4"),Je.removeClass(e.querySelector(".edge-y--3"),"edge-y--3"),Je.removeClass(e.querySelector(".edge-y--2"),"edge-y--2"),Je.removeClass(e.querySelector(".edge-y--1"),"edge-y--1"),Je.removeClass(e.querySelector(".edge-y-0"),"edge-y-0"),Je.removeClass(e.querySelector(".edge-y-0-25"),"edge-y-0-25"),Je.removeClass(e.querySelector(".edge-y-0-5"),"edge-y-0-5"),Je.removeClass(e.querySelector(".edge-y-0-75"),"edge-y-0-75"),Je.removeClass(e.querySelector(".edge-y-1"),"edge-y-1"),Je.removeClass(e.querySelector(".edge-y-2"),"edge-y-2"),Je.removeClass(e.querySelector(".edge-y-3"),"edge-y-3"),Je.removeClass(e.querySelector(".edge-y-4"),"edge-y-4"),Je.removeClass(e.querySelector(".edge-y-5"),"edge-y-5"),Je.removeClass(e.querySelector(".edge-x--1"),"edge-x--1"),Je.removeClass(e.querySelector(".edge-x--0-75"),"edge-x--0-75"),Je.removeClass(e.querySelector(".edge-x--0-5"),"edge-x--0-5"),Je.removeClass(e.querySelector(".edge-x--0-25"),"edge-x--0-25"),Je.removeClass(e.querySelector(".edge-x-0"),"edge-x-0"),Je.removeClass(e.querySelector(".edge-x-0-25"),"edge-x-0-25"),Je.removeClass(e.querySelector(".edge-x-0-5"),"edge-x-0-5"),Je.removeClass(e.querySelector(".edge-x-0-75"),"edge-x-0-75"),Je.removeClass(e.querySelector(".edge-x-1"),"edge-x-1"),Je.removeClass(e.querySelector(".edge-x-2"),"edge-x-2"),Je.removeClass(e.querySelector(".edge-x-3"),"edge-x-3"),Je.removeClass(e.querySelector(".edge-x-4"),"edge-x-4"),Je.removeClass(e.querySelector(".edge-x-5"),"edge-x-5"),Je.removeClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.removeClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.removeClass(e,"is-content-top"),Je.removeClass(e,"is-content-bottom"),Je.removeClass(e.querySelector(".is-container"),"is-content-left"),Je.removeClass(e.querySelector(".is-container"),"is-content-right");let s=t.getAttribute("data-value");"topleft"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.addClass(e,"is-content-top"),Je.addClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),"topcenter"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.addClass(e,"is-content-top"),Je.removeClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(i,"edge-y-1")),"topright"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.addClass(e,"is-content-top"),Je.addClass(e.querySelector(".is-container"),"is-content-right"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),"middleleft"===s&&(Je.addClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(n,"edge-x-0-5")),"middleright"===s&&(Je.addClass(e.querySelector(".is-container"),"is-content-right"),Je.addClass(n,"edge-x-0-5")),"bottomleft"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.addClass(e,"is-content-bottom"),Je.addClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),"bottomcenter"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.addClass(e,"is-content-bottom"),Je.addClass(i,"edge-y-1")),"bottomright"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.addClass(e,"is-content-bottom"),Je.addClass(e.querySelector(".is-container"),"is-content-right"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),o.querySelectorAll(".cmd-box-content-pos").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(t,"on"),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-content-edge-x").forEach((t=>{t.addEventListener("click",(()=>{let e=this.builder.activeBox.querySelector(".is-container");this.builder.editor.saveForUndo();let i=t.getAttribute("data-value");if("-"===i){if(Je.hasClass(e,"edge-x--1"))return!1;Je.hasClass(e,"edge-x--0-75")?(Je.removeClass(e,"edge-x--0-75"),Je.addClass(e,"edge-x--1")):Je.hasClass(e,"edge-x--0-5")?(Je.removeClass(e,"edge-x--0-5"),Je.addClass(e,"edge-x--0-75")):Je.hasClass(e,"edge-x--0-25")?(Je.removeClass(e,"edge-x--0-25"),Je.addClass(e,"edge-x--0-5")):Je.hasClass(e,"edge-x-0")?(Je.removeClass(e,"edge-x-0"),Je.addClass(e,"edge-x--0-25")):Je.hasClass(e,"edge-x-0-25")?(Je.removeClass(e,"edge-x-0-25"),Je.addClass(e,"edge-x-0")):Je.hasClass(e,"edge-x-0-5")?(Je.removeClass(e,"edge-x-0-5"),Je.addClass(e,"edge-x-0-25")):Je.hasClass(e,"edge-x-0-75")?(Je.removeClass(e,"edge-x-0-75"),Je.addClass(e,"edge-x-0-5")):Je.hasClass(e,"edge-x-1")?(Je.removeClass(e,"edge-x-1"),Je.addClass(e,"edge-x-0-75")):Je.hasClass(e,"edge-x-2")?(Je.removeClass(e,"edge-x-2"),Je.addClass(e,"edge-x-1")):Je.hasClass(e,"edge-x-3")?(Je.removeClass(e,"edge-x-3"),Je.addClass(e,"edge-x-2")):Je.hasClass(e,"edge-x-4")?(Je.removeClass(e,"edge-x-4"),Je.addClass(e,"edge-x-3")):Je.hasClass(e,"edge-x-5")?(Je.removeClass(e,"edge-x-5"),Je.addClass(e,"edge-x-4")):Je.hasClass(e,"edge-x-6")?(Je.removeClass(e,"edge-x-6"),Je.addClass(e,"edge-x-5")):Je.addClass(e,"edge-x-0")}if("+"===i)if(Je.hasClass(e,"edge-x--1"))Je.removeClass(e,"edge-x--1"),Je.addClass(e,"edge-x--0-75");else if(Je.hasClass(e,"edge-x--0-75"))Je.removeClass(e,"edge-x--0-75"),Je.addClass(e,"edge-x--0-5");else if(Je.hasClass(e,"edge-x--0-5"))Je.removeClass(e,"edge-x--0-5"),Je.addClass(e,"edge-x--0-25");else if(Je.hasClass(e,"edge-x--0-25"))Je.removeClass(e,"edge-x--0-25"),Je.addClass(e,"edge-x-0");else if(Je.hasClass(e,"edge-x-0"))Je.removeClass(e,"edge-x-0"),Je.addClass(e,"edge-x-0-25");else if(Je.hasClass(e,"edge-x-0-25"))Je.removeClass(e,"edge-x-0-25"),Je.addClass(e,"edge-x-0-5");else if(Je.hasClass(e,"edge-x-0-5"))Je.removeClass(e,"edge-x-0-5"),Je.addClass(e,"edge-x-0-75");else if(Je.hasClass(e,"edge-x-0-75"))Je.removeClass(e,"edge-x-0-75"),Je.addClass(e,"edge-x-1");else if(Je.hasClass(e,"edge-x-1"))Je.removeClass(e,"edge-x-1"),Je.addClass(e,"edge-x-2");else if(Je.hasClass(e,"edge-x-2"))Je.removeClass(e,"edge-x-2"),Je.addClass(e,"edge-x-3");else if(Je.hasClass(e,"edge-x-3"))Je.removeClass(e,"edge-x-3"),Je.addClass(e,"edge-x-4");else if(Je.hasClass(e,"edge-x-4"))Je.removeClass(e,"edge-x-4"),Je.addClass(e,"edge-x-5");else if(Je.hasClass(e,"edge-x-5"))Je.removeClass(e,"edge-x-5"),Je.addClass(e,"edge-x-6");else{if(Je.hasClass(e,"edge-x-6"))return!1;Je.addClass(e,"edge-x-0")}""===i&&(Je.removeClass(e,"edge-x--1"),Je.removeClass(e,"edge-x--0-75"),Je.removeClass(e,"edge-x--0-5"),Je.removeClass(e,"edge-x--0-25"),Je.removeClass(e,"edge-x-0"),Je.removeClass(e,"edge-x-0-25"),Je.removeClass(e,"edge-x-0-5"),Je.removeClass(e,"edge-x-0-75"),Je.removeClass(e,"edge-x-1"),Je.removeClass(e,"edge-x-2"),Je.removeClass(e,"edge-x-3"),Je.removeClass(e,"edge-x-4"),Je.removeClass(e,"edge-x-5"),Je.removeClass(e,"edge-x-6")),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-content-edge-y").forEach((t=>{t.addEventListener("click",(()=>{let e=this.builder.activeBox.querySelector(".is-box-centered");this.builder.editor.saveForUndo();let i=t.getAttribute("data-value");if("-"===i){if(Je.hasClass(e,"edge-y--5"))return!1;Je.hasClass(e,"edge-y--4")?(Je.removeClass(e,"edge-y--4"),Je.addClass(e,"edge-y--5")):Je.hasClass(e,"edge-y--3")?(Je.removeClass(e,"edge-y--3"),Je.addClass(e,"edge-y--4")):Je.hasClass(e,"edge-y--2")?(Je.removeClass(e,"edge-y--2"),Je.addClass(e,"edge-y--3")):Je.hasClass(e,"edge-y--1")?(Je.removeClass(e,"edge-y--1"),Je.addClass(e,"edge-y--2")):Je.hasClass(e,"edge-y-0")?(Je.removeClass(e,"edge-y-0"),Je.addClass(e,"edge-y--1")):Je.hasClass(e,"edge-y-0-25")?(Je.removeClass(e,"edge-y-0-25"),Je.addClass(e,"edge-y-0")):Je.hasClass(e,"edge-y-0-5")?(Je.removeClass(e,"edge-y-0-5"),Je.addClass(e,"edge-y-0-25")):Je.hasClass(e,"edge-y-0-75")?(Je.removeClass(e,"edge-y-0-75"),Je.addClass(e,"edge-y-0-5")):Je.hasClass(e,"edge-y-1")?(Je.removeClass(e,"edge-y-1"),Je.addClass(e,"edge-y-0-75")):Je.hasClass(e,"edge-y-2")?(Je.removeClass(e,"edge-y-2"),Je.addClass(e,"edge-y-1")):Je.hasClass(e,"edge-y-3")?(Je.removeClass(e,"edge-y-3"),Je.addClass(e,"edge-y-2")):Je.hasClass(e,"edge-y-4")?(Je.removeClass(e,"edge-y-4"),Je.addClass(e,"edge-y-3")):Je.hasClass(e,"edge-y-5")?(Je.removeClass(e,"edge-y-5"),Je.addClass(e,"edge-y-4")):Je.hasClass(e,"edge-y-6")?(Je.removeClass(e,"edge-y-6"),Je.addClass(e,"edge-y-5")):Je.hasClass(e,"edge-y-7")?(Je.removeClass(e,"edge-y-7"),Je.addClass(e,"edge-y-6")):Je.hasClass(e,"edge-y-8")?(Je.removeClass(e,"edge-y-8"),Je.addClass(e,"edge-y-7")):Je.addClass(e,"edge-y-0")}if("+"==i)if(Je.hasClass(e,"edge-y--5"))Je.removeClass(e,"edge-y--5"),Je.addClass(e,"edge-y--4");else if(Je.hasClass(e,"edge-y--4"))Je.removeClass(e,"edge-y--4"),Je.addClass(e,"edge-y--3");else if(Je.hasClass(e,"edge-y--3"))Je.removeClass(e,"edge-y--3"),Je.addClass(e,"edge-y--2");else if(Je.hasClass(e,"edge-y--2"))Je.removeClass(e,"edge-y--2"),Je.addClass(e,"edge-y--1");else if(Je.hasClass(e,"edge-y--1"))Je.removeClass(e,"edge-y--1"),Je.addClass(e,"edge-y-0");else if(Je.hasClass(e,"edge-y-0"))Je.removeClass(e,"edge-y-0"),Je.addClass(e,"edge-y-0-25");else if(Je.hasClass(e,"edge-y-0-25"))Je.removeClass(e,"edge-y-0-25"),Je.addClass(e,"edge-y-0-5");else if(Je.hasClass(e,"edge-y-0-5"))Je.removeClass(e,"edge-y-0-5"),Je.addClass(e,"edge-y-0-75");else if(Je.hasClass(e,"edge-y-0-75"))Je.removeClass(e,"edge-y-0-75"),Je.addClass(e,"edge-y-1");else if(Je.hasClass(e,"edge-y-1"))Je.removeClass(e,"edge-y-1"),Je.addClass(e,"edge-y-2");else if(Je.hasClass(e,"edge-y-2"))Je.removeClass(e,"edge-y-2"),Je.addClass(e,"edge-y-3");else if(Je.hasClass(e,"edge-y-3"))Je.removeClass(e,"edge-y-3"),Je.addClass(e,"edge-y-4");else if(Je.hasClass(e,"edge-y-4"))Je.removeClass(e,"edge-y-4"),Je.addClass(e,"edge-y-5");else if(Je.hasClass(e,"edge-y-5"))Je.removeClass(e,"edge-y-5"),Je.addClass(e,"edge-y-6");else if(Je.hasClass(e,"edge-y-6"))Je.removeClass(e,"edge-y-6"),Je.addClass(e,"edge-y-7");else if(Je.hasClass(e,"edge-y-7"))Je.removeClass(e,"edge-y-7"),Je.addClass(e,"edge-y-8");else{if(Je.hasClass(e,"edge-y-8"))return!1;Je.addClass(e,"edge-y-0")}""==i&&(Je.removeClass(e,"edge-y--5"),Je.removeClass(e,"edge-y--4"),Je.removeClass(e,"edge-y--3"),Je.removeClass(e,"edge-y--2"),Je.removeClass(e,"edge-y--1"),Je.removeClass(e,"edge-y-0"),Je.removeClass(e,"edge-y-0-25"),Je.removeClass(e,"edge-y-0-5"),Je.removeClass(e,"edge-y-0-75"),Je.removeClass(e,"edge-y-1"),Je.removeClass(e,"edge-y-2"),Je.removeClass(e,"edge-y-3"),Je.removeClass(e,"edge-y-4"),Je.removeClass(e,"edge-y-5"),Je.removeClass(e,"edge-y-6"),Je.removeClass(e,"edge-y-7"),Je.removeClass(e,"edge-y-8")),this.builder.settings.onChange()}))}));o.querySelector("#chkOptimizeTextSize").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxOptimizeTextSize(),this.builder.settings.onChange()}));o.querySelector("#chkParallaxContent").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxContainerAnim(),this.builder.settings.onChange()}));o.querySelector("#chkFadeContent").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxContainerAnim(),this.builder.settings.onChange()}));o.querySelector("#chkAutofitContent").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxContentAutofit(),this.builder.settings.onChange()}));o.querySelector(".cmd-box-pickphoto").addEventListener("click",(()=>{const t=o.querySelector(".is-modal.pickphoto");this.builder.showModal(t);const e=this.builder.settings.photoselect;t.querySelector("iframe").setAttribute("src",e)}));o.querySelector("#chkAnimateBg").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxAnimateBg(),this.builder.settings.onChange()}));o.querySelector("#chkParallaxBg").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxParallaxBg(),this.builder.settings.onChange()}));o.querySelector("#chkParallaxBg2").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxParallaxBg2(),this.builder.settings.onChange()}));o.querySelectorAll(".cmd-box-overlayopacity").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxOverlayOpacity(e),this.builder.settings.onChange()}))}));const p=o.querySelector(".cmd-box-selectasset");p&&p.addEventListener("click",(()=>{this.boxSelectAsset()}));const h=o.querySelector(".cmd-box-animate");h.addEventListener("change",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(),Je.removeClass(t,"is-animated"),Je.removeClass(t,"is-pulse"),Je.removeClass(t,"is-bounceIn"),Je.removeClass(t,"is-fadeIn"),Je.removeClass(t,"is-fadeInDown"),Je.removeClass(t,"is-fadeInLeft"),Je.removeClass(t,"is-fadeInRight"),Je.removeClass(t,"is-fadeInUp"),Je.removeClass(t,"is-flipInX"),Je.removeClass(t,"is-flipInY"),Je.removeClass(t,"is-slideInUp"),Je.removeClass(t,"is-slideInDown"),Je.removeClass(t,"is-slideInLeft"),Je.removeClass(t,"is-slideInRight"),Je.removeClass(t,"is-zoomIn"),Je.removeClass(t,"animated"),Je.removeClass(t,"pulse"),Je.removeClass(t,"bounceIn"),Je.removeClass(t,"fadeIn"),Je.removeClass(t,"fadeInDown"),Je.removeClass(t,"fadeInLeft"),Je.removeClass(t,"fadeInRight"),Je.removeClass(t,"fadeInUp"),Je.removeClass(t,"flipInX"),Je.removeClass(t,"flipInY"),Je.removeClass(t,"slideInUp"),Je.removeClass(t,"slideInDown"),Je.removeClass(t,"slideInLeft"),Je.removeClass(t,"slideInRight"),Je.removeClass(t,"zoomIn"),t.removeAttribute("data-scroll"),Je.removeClass(t,"is-inview"),""!==h.value?(Je.addClass(t,"is-animated"),Je.addClass(t,h.value),t.style.transition="none",t.style.opacity=0,setTimeout((()=>{t.style.transition="",t.style.opacity="",t.setAttribute("data-scroll",""),this.builder.settings.onChange(),this.builder.settings.onRender()}),30)):(this.builder.settings.onChange(),this.builder.settings.onRender())}));o.querySelector(".cmd-box-animate-test").addEventListener("click",(()=>{const t=this.builder.activeBox;Je.removeClass(t,"animated"),Je.removeClass(t,"pulse"),Je.removeClass(t,"bounceIn"),Je.removeClass(t,"fadeIn"),Je.removeClass(t,"fadeInDown"),Je.removeClass(t,"fadeInLeft"),Je.removeClass(t,"fadeInRight"),Je.removeClass(t,"fadeInUp"),Je.removeClass(t,"flipInX"),Je.removeClass(t,"flipInY"),Je.removeClass(t,"slideInUp"),Je.removeClass(t,"slideInDown"),Je.removeClass(t,"slideInLeft"),Je.removeClass(t,"slideInRight"),Je.removeClass(t,"zoomIn"),t.removeAttribute("data-scroll"),Je.removeClass(t,"is-inview"),""!==h.value?(Je.addClass(t,"is-animated"),Je.addClass(t,h.value),t.style.transition="none",t.style.opacity=0,setTimeout((()=>{t.style.transition="",t.style.opacity="",t.setAttribute("data-scroll",""),this.builder.settings.onChange(),this.builder.settings.onRender()}),30)):(this.builder.settings.onChange(),this.builder.settings.onRender())}));const g=o.querySelector("#chkAnimOnce");g.addEventListener("click",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(),g.checked?Je.addClass(t,"once"):Je.removeClass(t,"once"),this.builder.settings.onChange(),this.builder.settings.onRender()}));const f=o.querySelector(".cmd-box-animatedelay");f.addEventListener("change",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(),Je.removeClass(t,"delay-0ms"),Je.removeClass(t,"delay-100ms"),Je.removeClass(t,"delay-200ms"),Je.removeClass(t,"delay-300ms"),Je.removeClass(t,"delay-400ms"),Je.removeClass(t,"delay-500ms"),Je.removeClass(t,"delay-600ms"),Je.removeClass(t,"delay-700ms"),Je.removeClass(t,"delay-800ms"),Je.removeClass(t,"delay-900ms"),Je.removeClass(t,"delay-1000ms"),Je.removeClass(t,"delay-1100ms"),Je.removeClass(t,"delay-1200ms"),Je.removeClass(t,"delay-1300ms"),Je.removeClass(t,"delay-1400ms"),Je.removeClass(t,"delay-1500ms"),Je.removeClass(t,"delay-1600ms"),Je.removeClass(t,"delay-1700ms"),Je.removeClass(t,"delay-1800ms"),Je.removeClass(t,"delay-1900ms"),Je.removeClass(t,"delay-2000ms"),Je.removeClass(t,"delay-2100ms"),Je.removeClass(t,"delay-2200ms"),Je.removeClass(t,"delay-2300ms"),Je.removeClass(t,"delay-2400ms"),Je.removeClass(t,"delay-2500ms"),Je.removeClass(t,"delay-2600ms"),Je.removeClass(t,"delay-2700ms"),Je.removeClass(t,"delay-2800ms"),Je.removeClass(t,"delay-2900ms"),Je.removeClass(t,"delay-3000ms"),""!==f.value&&Je.addClass(t,f.value),this.builder.settings.onChange()}));const m=o.querySelector(".input-box-bgimage");m&&m.addEventListener("click",(()=>{const t=this.builder.activeBox.querySelector(".is-overlay-bg");let e="";t&&t.style.backgroundImage&&-1!==t.style.backgroundImage.indexOf("url(")&&(e=t.style.backgroundImage.slice(4,-1).replace(/["']/g,"")),this.builder.editor.openImagePicker(e,(t=>{this.boxImage(t);const e=this.builder.activeBox,i=e.querySelector(".is-overlay"),n=e.querySelector(".is-overlay-bg");n.style.filter="",i.style.filter="";o.querySelector(".chk-box-bgimage-grayscale").checked=!1,n.style.backgroundPosition="50% 60%",n.removeAttribute("data-scale"),n.removeAttribute("data-x"),n.removeAttribute("data-y"),n.style.top="",n.style.bottom="",n.style.left="",n.style.right="",n.style.width="",n.style.height=""}),m)}));const b=o.querySelector(".input-box-bgimageadjust");b&&b.addEventListener("click",(()=>{const t=this.builder.activeBox.querySelector(".is-overlay-bg");this.builder.editor.openImageAdjust(t,b)}));const v=o.querySelector(".chk-box-bgimage-grayscale");v.addEventListener("click",(()=>{const t=this.builder.activeBox,e=t.querySelector(".is-overlay"),i=t.querySelector(".is-overlay-bg");v.checked?(i.style.filter="grayscale(1)",e.style.filter="grayscale(1)"):(i.style.filter&&(i.style.filter=i.style.filter.replace("grayscale(1)","")),e.style.filter&&(e.style.filter=e.style.filter.replace("grayscale(1)","")))}));o.querySelector(".cmd-box-addtext").addEventListener("click",(()=>{const t=this.builder.activeBox,e=t.querySelector(".is-overlay");Je.appendHtml(e,'\n <div class="is-boxes">\n <div class="is-box-centered">\n <div class="is-container container" style="max-width: 440px;">\n \n </div>\n </div>\n </div>\n ',"afterend");let i=t.querySelector(".is-container");this.builder.editor.applyBehaviorOn(i),this.builder.onChange(),this.edit()}));o.querySelector(".cmd-box-removetext").addEventListener("click",(()=>{this.builder.editor.util.confirm(n("Are you sure you want to remove all text/content in this box?"),(t=>{if(t){const t=this.builder.activeBox.querySelector(".is-overlay").nextElementSibling;t.parentNode.removeChild(t),this.edit()}}))}));const y=o.querySelector(".input-box-bgremove");y&&y.addEventListener("click",(()=>{this.boxImage("")}));const _=this.builder.editor.colorpicker(),x=o.querySelector(".input-box-bgcolor");x.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeBox;let e=x.style.backgroundColor,i=t.querySelector(".is-overlay");_.open((e=>{t.style.backgroundColor="",t.style.backgroundImage="",i.style.backgroundColor=e,i.style.backgroundImage="",x.style.backgroundColor=e}),e)})),o.querySelector(".input-box-gradient").addEventListener("click",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(!0);let e=t.querySelector(".is-overlay");this.builder.editor.gradientpicker().open(e,(()=>{t.style.backgroundColor="",t.style.backgroundImage=""}))}));const w=o.querySelector(".input-box-overlaycolor");w.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeBox;let e=t.querySelector(".is-overlay");e||(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"));let i=e.querySelector(".is-overlay-bg");i||(e.insertAdjacentHTML("beforeend",'<div class="is-overlay-bg"></div>'),i=e.querySelector(".is-overlay-bg"));let n=i.querySelector(".is-overlay-color");n||(i.insertAdjacentHTML("beforeend",`<div class="is-overlay-color ${this.builder.cssClasses.opacity.opacity_5}"></div>`),n=i.querySelector(".is-overlay-color"));let o=n.style.backgroundColor;_.open((t=>{if("none"!==n.style.display&&0!==n.style.opacity||(n.style.display="block",n.style.opacity=.1),""===t){let t=i.querySelector(".is-overlay-color");t&&t.parentNode.removeChild(t)}else{let e=i.querySelector(".is-overlay-color");e||(i.insertAdjacentHTML("beforeend",`<div class="is-overlay-color ${this.builder.cssClasses.opacity.opacity_5}"></div>`),e=i.querySelector(".is-overlay-color")),e.style.backgroundColor=t}return w.style.backgroundColor=t,!1}),o)}));let S=this.builder.settings.largerImageHandler,C=this.builder.settings.onLargerImageUpload,k=this.builder.settings.onImageSelectClick,E=this.builder.settings.imageselect,A=this.builder.settings.onFileSelectClick,L=this.builder.settings.fileselect;""!==S||C||(o.querySelector(".image-larger5").style.display="none"),k||""!==E||(o.querySelector(".input-select").style.display="none");const q=o.querySelector(".input-src");try{this.builder.editor.dom.observeElement(q,"value",((t,e)=>{const i=this.builder.activeBox;let n=i.getAttribute("data-modal-url");n||(n=""),n!==e&&(this.builder.editor.saveForUndo(),this.builder.editor.dom.addClass(i,"block-click"),i.setAttribute("data-modal-url",e),this.builder.onChange())}))}catch(t){}if(k||E||A||L){const t=o.querySelector(".input-select");t&&t.addEventListener("click",(()=>{this.builder.editor.openAsset(o.querySelector(".input-src"),"media",t)}))}let T=o.querySelector("#fileImage5");T.addEventListener("change",(t=>{let e=T;for(;"form"!==e.nodeName.toLowerCase();)e=e.parentNode;let i=e;this.builder.editor.dom.addClass(i,"please-wait"),o.querySelector("#hidRefId5_box").value=this.builder.settings.customval,C?C(t):i.submit(),T.value=""})),q.addEventListener("focus",(()=>{this.builder.editor.saveForUndo(!0)})),q.addEventListener("keyup",(()=>{const t=this.builder.activeBox;""===q.value?(this.builder.editor.dom.removeClass(t,"block-click"),t.removeAttribute("data-modal-url")):(this.builder.editor.dom.addClass(t,"block-click"),t.setAttribute("data-modal-url",q.value)),this.builder.onChange()})),o.querySelector(".cmd-box-testclick").addEventListener("click",(()=>{const t=this.builder.activeBox;this.builder.editor.openMedia(t)}));s.querySelector(".input-ok").addEventListener("click",(()=>{let t=this.builder.activeBox.querySelector(".is-overlay-content[data-module]");this.builder.editor.saveForUndo();const i=e.querySelector("#hidBoxCustomCode"),n=e.querySelector("#txtBoxCustomCode");i.value=n.value,t.setAttribute("data-html",encodeURIComponent(i.value));let o=document.createRange();t.innerHTML="",t.appendChild(o.createContextualFragment(i.value)),this.builder.settings.onRender(),this.builder.settings.onChange(),this.builder.hideModal(s)}));a.querySelector(".input-ok").addEventListener("click",(()=>{let t=this.builder.doc.querySelector('[data-module-active="1"]');this.builder.editor.saveForUndo();let i=a.querySelector("iframe");i.contentWindow.construct&&i.contentWindow.construct(),this.builder.editor.saveForUndo();const n=e.querySelector("#hidModuleCode"),o=e.querySelector("#hidModuleSettings");t.setAttribute("data-html",encodeURIComponent(n.value)),t.setAttribute("data-settings",encodeURIComponent(o.value));let s=document.createRange();t.innerHTML="",t.appendChild(s.createContextualFragment(n.value)),this.builder.settings.onRender(),this.builder.settings.onChange(),this.builder.hideModal(a)}))}edit(){this.targetBox=null,this.builder.sidebar.closeSidebar();const t=this.builderStuff.querySelector(".is-modal.editbox"),e=this.builder.activeBox;let i=e.querySelector(".is-overlay");const n=e.querySelector(".is-overlay-bg"),o=e.querySelector(".is-video-bg"),s=e.querySelector(".is-overlay-content");let a=!1;if(n){this.builder.editor.dom.elementChildren(n).forEach((t=>{Je.hasClass(t,"is-overlay-color")||(a=!0)}))}if(n?(""==this.builder.settings.photoselect?t.querySelector("#divBoxPickPhoto").style.display="none":t.querySelector("#divBoxPickPhoto").style.display="block",a?(t.querySelector("#chkAnimateBg").parentNode.parentNode.style.display="none",t.querySelector("#chkParallaxBg").parentNode.parentNode.style.display="none"):t.querySelector("#chkAnimateBg").parentNode.parentNode.style.display=""):t.querySelector("#divBoxPickPhoto").style.display="none",this.builder.settings.enableAnimation?t.querySelector("#tabBoxAnimate").style.display="":t.querySelector("#tabBoxAnimate").style.display="none",e.querySelector(".is-container")){e.querySelector(".is-container .is-module")?t.querySelector("#tabBoxContentText").style.display="none":t.querySelector("#tabBoxContentText").style.display="";let i=window.getComputedStyle(e,null).getPropertyValue("display");"table"===i||"table-cell"===i||"flex"===i?(t.querySelector("#tabBoxContentContainer").style.display="",t.querySelector("#divContentSize").style.display=""):(t.querySelector("#tabBoxContentContainer").style.display="none",t.querySelector("#divContentSize").style.display="none")}else t.querySelector("#tabBoxContentText").style.display="none",t.querySelector("#tabBoxContentContainer").style.display="none",t.querySelector("#divContentSize").style.display="none";let r="middle";(Je.hasClass(e,"is-content-top")||e.querySelector(".is-content-top"))&&(r="top"),(Je.hasClass(e,"is-content-bottom")||e.querySelector(".is-content-bottom"))&&(r="bottom");const l=e.querySelector(".is-builder");let d="center";if(l&&(Je.hasClass(l,"is-content-left")&&(d="left"),Je.hasClass(l,"is-content-right")&&(d="right")),t.querySelectorAll(".cmd-box-content-pos").forEach((t=>{Je.removeClass(t,"on")})),"top"===r&&"left"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="topleft"]'),"on"),"top"===r&&"center"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="topcenter"]'),"on"),"top"===r&&"right"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="topright"]'),"on"),"middle"===r&&"left"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="middleleft"]'),"on"),"middle"===r&&"center"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="middlecenter"]'),"on"),"middle"===r&&"right"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="middleright"]'),"on"),"bottom"===r&&"left"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="bottomleft"]'),"on"),"bottom"===r&&"center"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="bottomcenter"]'),"on"),"bottom"===r&&"right"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="bottomright"]'),"on"),t.querySelector("#divContainerTransparency").style.display="",t.querySelector("#divContainerTextAlign").style.display="",s&&(t.querySelector("#tabBoxContentText").style.display="",e.querySelector(".is-container")||(t.querySelector("#divContainerTransparency").style.display="none",t.querySelector("#divContainerTextAlign").style.display="none")),o?t.querySelector("#divBoxBackgroundColor").style.display="none":(t.querySelector("#divBoxBackgroundColor").style.display="",a&&(t.querySelector("#divBoxBackgroundColor").style.display="none")),n&&(Je.hasClass(n,"is-scale-animated")?t.querySelector("#chkAnimateBg").checked=!0:t.querySelector("#chkAnimateBg").checked=!1,n.getAttribute("data-top-bottom")||n.getAttribute("data-bottom-top")?t.querySelector("#chkParallaxBg").checked=!0:t.querySelector("#chkParallaxBg").checked=!1,"fixed"===n.style.backgroundAttachment?t.querySelector("#chkParallaxBg2").checked=!0:t.querySelector("#chkParallaxBg2").checked=!1),Je.hasClass(e,"is-section")?t.querySelector("#divBoxSize").style.display="none":t.querySelector("#divBoxSize").style.display="block",t.querySelector("#chkParallaxContent").checked=!1,t.querySelector("#chkFadeContent").checked=!1,l){let e=l.getAttribute("data-bottom-top");e&&(-1!==e.indexOf("translateY")&&(t.querySelector("#chkParallaxContent").checked=!0),-1!==e.indexOf("opacity")&&(t.querySelector("#chkFadeContent").checked=!0))}t.querySelector("#chkOptimizeTextSize").checked=!1,l&&Je.hasClass(l,"v2")&&(t.querySelector("#chkOptimizeTextSize").checked=!0),t.querySelector("#chkAutofitContent").checked=!1,Je.hasClass(e,"box-autofit")&&(t.querySelector("#chkAutofitContent").checked=!0),Je.addClass(e,"box-active"),this.builder.showModal(t,!1,(()=>{Je.removeClass(e,"box-active")})),t.focus(),l&&(t.querySelector(".val-box-size").innerHTML="",l.classList.forEach((e=>{if(-1!==e.indexOf("is-content-")&&"is-content-left"!==e&&"is-content-right"!==e){let i=e.replace("is-content-","");t.querySelector(".val-box-size").innerHTML=i}})));const c=t.querySelector(".cmd-box-animate");c.value="",Je.hasClass(e,"is-pulse")&&(c.value="is-pulse"),Je.hasClass(e,"is-bounceIn")&&(c.value="is-bounceIn"),Je.hasClass(e,"is-fadeIn")&&(c.value="is-fadeIn"),Je.hasClass(e,"is-fadeInDown")&&(c.value="is-fadeInDown"),Je.hasClass(e,"is-fadeInLeft")&&(c.value="is-fadeInLeft"),Je.hasClass(e,"is-fadeInRight")&&(c.value="is-fadeInRight"),Je.hasClass(e,"is-fadeInUp")&&(c.value="is-fadeInUp"),Je.hasClass(e,"is-flipInX")&&(c.value="is-flipInX"),Je.hasClass(e,"is-flipInY")&&(c.value="is-flipInY"),Je.hasClass(e,"is-slideInUp")&&(c.value="is-slideInUp"),Je.hasClass(e,"is-slideInDown")&&(c.value="is-slideInDown"),Je.hasClass(e,"is-slideInLeft")&&(c.value="is-slideInLeft"),Je.hasClass(e,"is-slideInRight")&&(c.value="is-slideInRight"),Je.hasClass(e,"is-zoomIn")&&(c.value="is-zoomIn");const u=t.querySelector("#chkAnimOnce");Je.hasClass(e,"once")?u.checked=!0:u.checked=!1;const p=t.querySelector(".cmd-box-animatedelay");Je.hasClass(e,"delay-0ms")&&(p.value="delay-0ms"),Je.hasClass(e,"delay-100ms")&&(p.value="delay-100ms"),Je.hasClass(e,"delay-200ms")&&(p.value="delay-20ms"),Je.hasClass(e,"delay-300ms")&&(p.value="delay-300ms"),Je.hasClass(e,"delay-400ms")&&(p.value="delay-400ms"),Je.hasClass(e,"delay-500ms")&&(p.value="delay-500ms"),Je.hasClass(e,"delay-600ms")&&(p.value="delay-600ms"),Je.hasClass(e,"delay-700ms")&&(p.value="delay-700ms"),Je.hasClass(e,"delay-800ms")&&(p.value="delay-800ms"),Je.hasClass(e,"delay-900ms")&&(p.value="delay-900ms"),Je.hasClass(e,"delay-1000ms")&&(p.value="delay-1000ms"),Je.hasClass(e,"delay-1100ms")&&(p.value="delay-1100ms"),Je.hasClass(e,"delay-1200ms")&&(p.value="delay-1200ms"),Je.hasClass(e,"delay-1300ms")&&(p.value="delay-1300ms"),Je.hasClass(e,"delay-1400ms")&&(p.value="delay-1400ms"),Je.hasClass(e,"delay-1500ms")&&(p.value="delay-1500ms"),Je.hasClass(e,"delay-1600ms")&&(p.value="delay-1600ms"),Je.hasClass(e,"delay-1700ms")&&(p.value="delay-1700ms"),Je.hasClass(e,"delay-1800ms")&&(p.value="delay-1800ms"),Je.hasClass(e,"delay-1900ms")&&(p.value="delay-1900ms"),Je.hasClass(e,"delay-2000ms")&&(p.value="delay-2000ms"),Je.hasClass(e,"delay-2100ms")&&(p.value="delay-2100ms"),Je.hasClass(e,"delay-2200ms")&&(p.value="delay-2200ms"),Je.hasClass(e,"delay-2300ms")&&(p.value="delay-2300ms"),Je.hasClass(e,"delay-2400ms")&&(p.value="delay-2400ms"),Je.hasClass(e,"delay-2500ms")&&(p.value="delay-2500ms"),Je.hasClass(e,"delay-2600ms")&&(p.value="delay-2600ms"),Je.hasClass(e,"delay-2700ms")&&(p.value="delay-2700ms"),Je.hasClass(e,"delay-2800ms")&&(p.value="delay-2800ms"),Je.hasClass(e,"delay-2900ms")&&(p.value="delay-2900ms"),Je.hasClass(e,"delay-3000ms")&&(p.value="delay-3000ms"),t.querySelector("#tabBoxImage").style.display="none";let h="";n&&n.style.backgroundImage&&-1!==n.style.backgroundImage.indexOf("url(")&&(h=n.style.backgroundImage.slice(4,-1).replace(/["']/g,""),t.querySelector("#tabBoxImage").style.display="inline-block");const g=t.querySelector(".box-bgimage-preview"),f=t.querySelector(".input-box-bgimageadjust"),m=t.querySelector(".label-box-bgimage-grayscale"),b=t.querySelector(".chk-box-bgimage-grayscale");f.style.display="none",m.style.display="none";const v=t.querySelector(".input-box-bgremove");v.style.display="none",b.checked=!1,""!==h?(g.innerHTML=`<img src="${h}">`,i&&i.style.filter&&-1!==i.style.filter.indexOf("grayscale")&&(b.checked=!0),n&&n.style.filter&&-1!==n.style.filter.indexOf("grayscale")&&(b.checked=!0,i.style.filter="grayscale(1)",n.style.filter=n.style.filter.replace("grayscale(1)","")),f.style.display="flex",v.style.display="flex",m.style.display="flex"):g.innerHTML="";const y=e.querySelector(".is-overlay-color"),_=t.querySelector(".input-box-overlaycolor");_.style.backgroundColor=y?y.style.backgroundColor:"transparent";const x=t.querySelector(".input-src");h=e.getAttribute("data-modal-url"),x.value=""!==h?h:"","none"===t.querySelector("#divBoxSize").style.display&&"none"===t.querySelector("#divBoxBackgroundColor").style.display&&"none"===t.querySelector("#tabBoxContentText").style.display&&"none"===t.querySelector("#tabBoxContentContainer").style.display&&"none"===t.querySelector("#tabBoxImage").style.display&&"none"===t.querySelector("#tabBoxAnimate").style.display&&"none"===t.querySelector("#tabBoxCustomHtml").style.display?t.querySelector("#divNoBoxSettings").style.display="block":t.querySelector("#divNoBoxSettings").style.display="none",i||(e.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),i=e.querySelector(".is-overlay")),Je.hasClass(e,"is-bg-light")&&(Je.removeClass(e,"is-bg-light"),i.style.backgroundColor||(i.style.backgroundColor="rgb(255, 255, 255)")),Je.hasClass(e,"is-bg-dark")&&(Je.removeClass(e,"is-bg-dark"),i.style.backgroundColor||(i.style.backgroundColor="rgb(17, 17, 17)")),Je.hasClass(e,"is-bg-grey")&&(Je.removeClass(e,"is-bg-grey"),i.style.backgroundColor||(i.style.backgroundColor="rgb(238, 239, 240)"));let w=t.querySelector(".input-box-bgcolor"),S=i.style.backgroundColor;S||(S=window.getComputedStyle(e,null).getPropertyValue("background-color"),"rgba(0, 0, 0, 0)"===S&&(S="")),w.style.backgroundColor=S;const C=t.querySelector(".cmd-box-addtext"),k=t.querySelector(".cmd-box-removetext");l?(C.style.display="none",k.style.display="flex"):(C.style.display="flex",k.style.display="none");let E=t.querySelectorAll(".cmd-content-height"),A=t.querySelector(".div-content-justify");E.forEach((t=>{Je.removeClass(t,"on")})),t.querySelectorAll(".cmd-content-justify").forEach((t=>{Je.removeClass(t,"on")})),l&&("100%"===l.style.height||Je.hasClass(l,"h-full")?(Je.addClass(t.querySelector('.cmd-content-height[data-value="100"]'),"on"),A.style.display="block",("flex-start"===l.style.justifyContent||Je.hasClass(l,"justify-start"))&&Je.addClass(t.querySelector('.cmd-content-justify[data-value="flex-start"]'),"on"),("flex-end"===l.style.justifyContent||Je.hasClass(l,"justify-end"))&&Je.addClass(t.querySelector('.cmd-content-justify[data-value="flex-end"]'),"on"),("space-between"===l.style.justifyContent||Je.hasClass(l,"justify-between"))&&Je.addClass(t.querySelector('.cmd-content-justify[data-value="space-between"]'),"on")):(Je.addClass(t.querySelector('.cmd-content-height[data-value=""]'),"on"),A.style.display="none"))}async editModule(){const t=this.builder.builderStuff;let e=this.builder.activeBox.querySelector(".is-overlay-content[data-module]");this.builder.wrapperEl.querySelectorAll("[data-module-active]").forEach((t=>{t.removeAttribute("data-module-active")})),e.setAttribute("data-module-active","1");let i=e.getAttribute("data-module");if("code"===i)if(this.builder.settings.htmlSyntaxHighlighting){let i=decodeURIComponent(e.getAttribute("data-html"));i=(0,Qe.html)(i),t.querySelector("#txtBoxCustomCode").value=i;let n=t.querySelectorAll("[data-source-active]");n.forEach((t=>{t.removeAttribute("data-source-active")})),n=t.querySelectorAll("[data-source-ok]"),n.forEach((t=>{t.removeAttribute("data-source-ok")})),n=t.querySelectorAll("[data-source-cancel]"),n.forEach((t=>{t.removeAttribute("data-source-cancel")}));let o=t.querySelector("#txtBoxCustomCode");o.setAttribute("data-source-active","1"),o.setAttribute("data-source-ok",".editcustomcode .input-ok"),o.setAttribute("data-source-cancel",".editcustomcode"),this.builder.editor.viewHtmlNormal()}else{const i=t.querySelector(".is-modal.editcustomcode");this.builder.showModal(i);let n=decodeURIComponent(e.getAttribute("data-html"));n=(0,Qe.html)(n);let o=t.querySelector("#txtBoxCustomCode");o.value=n,o.focus()}else{const t=document.querySelector(".is-modal.editmodule"),o=t.querySelector("iframe");o.style.opacity=0,o.style.transition="opacity 0.1s ease";let s=await fetch(this.builder.settings.modulePath+i+".html");s=await s.text();let a=o.contentWindow.document;a.open(),a.write(s),a.close(),this.builder.showModal(t),setTimeout((()=>{o.style.opacity=1}),200);let r=e.getAttribute("data-module-desc");const l=t.querySelector(".is-modal-bar");l.innerHTML=r||n("Module Settings");let d=e.getAttribute("data-dialog-width");d&&""!=d||(d="900px");let c=e.getAttribute("data-dialog-height");c&&""!=c||(c="570px"),t.childNodes.forEach((t=>{Je.hasClass(t,"is-modal-overlay")||(t.style.maxWidth=d,t.style.height=c)}))}}refreshModule(){const t=document.querySelector(".is-modal.editmodule"),e=this.builderStuff;let i=this.builder.doc.querySelector('[data-module-active="1"]'),n=t.querySelector("iframe");n.contentWindow.construct&&n.contentWindow.construct();const o=e.querySelector("#hidModuleCode"),s=e.querySelector("#hidModuleSettings");i.setAttribute("data-html",encodeURIComponent(o.value)),i.setAttribute("data-settings",encodeURIComponent(s.value));let a=document.createRange();i.innerHTML="",i.appendChild(a.createContextualFragment(o.value)),this.builder.settings.onRender(),this.builder.settings.onChange()}boxWidthSmaller(){let t,e;if(t=this.builder.activeBox,t.nextElementSibling){if(Je.hasClass(t,"is-box-1"))return;if(e=t.nextElementSibling,Je.hasClass(e,"is-box-12"))return;return this.boxMinus(t),this.boxPlus(e),!1}if(t.previousElementSibling){if(Je.hasClass(t,"is-box-1"))return;if(e=t.previousElementSibling,Je.hasClass(e,"is-box-12"))return;return this.boxMinus(t),this.boxPlus(e),!1}}boxWidthLarger(){let t,e;if(t=this.builder.activeBox,t.nextElementSibling){if(e=t.nextElementSibling,Je.hasClass(e,"is-box-1"))return;if(Je.hasClass(t,"is-box-12"))return;return this.boxPlus(t),this.boxMinus(e),!1}if(t.previousElementSibling){if(e=t.previousElementSibling,Je.hasClass(e,"is-box-1"))return;if(Je.hasClass(t,"is-box-12"))return;return this.boxPlus(t),this.boxMinus(e),!1}}boxPlus(t){for(let e=1;e<12;e++)if(Je.hasClass(t,"is-box-"+e))return Je.removeClass(t,"is-box-"+e),void Je.addClass(t,"is-box-"+(e+1))}boxMinus(t){for(let e=12;e>1;e--)if(Je.hasClass(t,"is-box-"+e))return Je.removeClass(t,"is-box-"+e),void Je.addClass(t,"is-box-"+(e-1))}boxTextColor(t){let e=this.builder.activeBox;"light"==t&&(Je.removeClass(e,"is-dark-text"),Je.addClass(e,"is-light-text")),"dark"==t&&(Je.removeClass(e,"is-light-text"),Je.addClass(e,"is-dark-text")),""==t&&(Je.removeClass(e,"is-dark-text"),Je.removeClass(e,"is-light-text"))}boxTextAlign(t){let e=this.builder.activeBox,i=e.querySelector(".center");Je.removeClass(i,"center"),e.querySelectorAll(".is-builder > div > div, .is-builder > div > div > *").forEach((t=>{t.style.textAlign="",Je.removeClass(t,this.builder.cssClasses.textAlign.left),Je.removeClass(t,this.builder.cssClasses.textAlign.center),Je.removeClass(t,this.builder.cssClasses.textAlign.right),Je.removeClass(t,this.builder.cssClasses.textAlign.justify),this.builder.editor.dom.doFunction(t,(t=>{t.closest(".is-section-tool")||t.closest(".is-box-tool")||t.closest(".is-tool")||t.closest(".is-rowadd-tool")||(t.style.textAlign="",Je.removeClass(t,this.builder.cssClasses.textAlign.left),Je.removeClass(t,this.builder.cssClasses.textAlign.center),Je.removeClass(t,this.builder.cssClasses.textAlign.right),Je.removeClass(t,this.builder.cssClasses.textAlign.justify))}),!0)})),"right"==t?(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-center"),Je.removeClass(e,"is-align-justify"),Je.addClass(e,"is-align-right")):"center"==t?(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-justify"),Je.addClass(e,"is-align-center")):"left"==t?(Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-center"),Je.removeClass(e,"is-align-justify"),Je.addClass(e,"is-align-left")):"justify"==t?(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-center"),Je.addClass(e,"is-align-justify")):""==t&&(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-center"),Je.removeClass(e,"is-align-justify"))}boxTextOpacity(t){let e=this.builder.activeBox.querySelector(".is-box-centered");if("+"!==t)if("-"!==t)Je.removeClass(e,"is-opacity-20"),Je.removeClass(e,"is-opacity-25"),Je.removeClass(e,"is-opacity-30"),Je.removeClass(e,"is-opacity-35"),Je.removeClass(e,"is-opacity-40"),Je.removeClass(e,"is-opacity-45"),Je.removeClass(e,"is-opacity-50"),Je.removeClass(e,"is-opacity-55"),Je.removeClass(e,"is-opacity-60"),Je.removeClass(e,"is-opacity-65"),Je.removeClass(e,"is-opacity-70"),Je.removeClass(e,"is-opacity-75"),Je.removeClass(e,"is-opacity-80"),Je.removeClass(e,"is-opacity-85"),Je.removeClass(e,"is-opacity-90"),Je.removeClass(e,"is-opacity-95"),"0.7"==t&&Je.addClass(e,"is-opacity-70"),"0.75"==t&&Je.addClass(e,"is-opacity-75"),"0.8"==t&&Je.addClass(e,"is-opacity-80"),"0.85"==t&&Je.addClass(e,"is-opacity-85"),"0.90"==t&&Je.addClass(e,"is-opacity-90"),"0.95"==t&&Je.addClass(e,"is-opacity-95");else{if(Je.hasClass(e,"is-opacity-20"))return;Je.hasClass(e,"is-opacity-25")?(Je.removeClass(e,"is-opacity-25"),Je.addClass(e,"is-opacity-20")):Je.hasClass(e,"is-opacity-30")?(Je.removeClass(e,"is-opacity-30"),Je.addClass(e,"is-opacity-25")):Je.hasClass(e,"is-opacity-35")?(Je.removeClass(e,"is-opacity-35"),Je.addClass(e,"is-opacity-30")):Je.hasClass(e,"is-opacity-40")?(Je.removeClass(e,"is-opacity-40"),Je.addClass(e,"is-opacity-35")):Je.hasClass(e,"is-opacity-45")?(Je.removeClass(e,"is-opacity-45"),Je.addClass(e,"is-opacity-40")):Je.hasClass(e,"is-opacity-50")?(Je.removeClass(e,"is-opacity-50"),Je.addClass(e,"is-opacity-45")):Je.hasClass(e,"is-opacity-55")?(Je.removeClass(e,"is-opacity-55"),Je.addClass(e,"is-opacity-50")):Je.hasClass(e,"is-opacity-60")?(Je.removeClass(e,"is-opacity-60"),Je.addClass(e,"is-opacity-55")):Je.hasClass(e,"is-opacity-65")?(Je.removeClass(e,"is-opacity-65"),Je.addClass(e,"is-opacity-60")):Je.hasClass(e,"is-opacity-70")?(Je.removeClass(e,"is-opacity-70"),Je.addClass(e,"is-opacity-65")):Je.hasClass(e,"is-opacity-75")?(Je.removeClass(e,"is-opacity-75"),Je.addClass(e,"is-opacity-70")):Je.hasClass(e,"is-opacity-80")?(Je.removeClass(e,"is-opacity-80"),Je.addClass(e,"is-opacity-75")):Je.hasClass(e,"is-opacity-85")?(Je.removeClass(e,"is-opacity-85"),Je.addClass(e,"is-opacity-80")):Je.hasClass(e,"is-opacity-90")?(Je.removeClass(e,"is-opacity-90"),Je.addClass(e,"is-opacity-85")):Je.hasClass(e,"is-opacity-95")?(Je.removeClass(e,"is-opacity-95"),Je.addClass(e,"is-opacity-90")):Je.addClass(e,"is-opacity-95")}else Je.hasClass(e,"is-opacity-20")?(Je.removeClass(e,"is-opacity-20"),Je.addClass(e,"is-opacity-25")):Je.hasClass(e,"is-opacity-25")?(Je.removeClass(e,"is-opacity-25"),Je.addClass(e,"is-opacity-30")):Je.hasClass(e,"is-opacity-30")?(Je.removeClass(e,"is-opacity-30"),Je.addClass(e,"is-opacity-35")):Je.hasClass(e,"is-opacity-35")?(Je.removeClass(e,"is-opacity-35"),Je.addClass(e,"is-opacity-40")):Je.hasClass(e,"is-opacity-40")?(Je.removeClass(e,"is-opacity-40"),Je.addClass(e,"is-opacity-45")):Je.hasClass(e,"is-opacity-45")?(Je.removeClass(e,"is-opacity-45"),Je.addClass(e,"is-opacity-50")):Je.hasClass(e,"is-opacity-50")?(Je.removeClass(e,"is-opacity-50"),Je.addClass(e,"is-opacity-55")):Je.hasClass(e,"is-opacity-55")?(Je.removeClass(e,"is-opacity-55"),Je.addClass(e,"is-opacity-60")):Je.hasClass(e,"is-opacity-60")?(Je.removeClass(e,"is-opacity-60"),Je.addClass(e,"is-opacity-65")):Je.hasClass(e,"is-opacity-65")?(Je.removeClass(e,"is-opacity-65"),Je.addClass(e,"is-opacity-70")):Je.hasClass(e,"is-opacity-70")?(Je.removeClass(e,"is-opacity-70"),Je.addClass(e,"is-opacity-75")):Je.hasClass(e,"is-opacity-75")?(Je.removeClass(e,"is-opacity-75"),Je.addClass(e,"is-opacity-80")):Je.hasClass(e,"is-opacity-80")?(Je.removeClass(e,"is-opacity-80"),Je.addClass(e,"is-opacity-85")):Je.hasClass(e,"is-opacity-85")?(Je.removeClass(e,"is-opacity-85"),Je.addClass(e,"is-opacity-90")):Je.hasClass(e,"is-opacity-90")?(Je.removeClass(e,"is-opacity-90"),Je.addClass(e,"is-opacity-95")):Je.hasClass(e,"is-opacity-95")&&Je.removeClass(e,"is-opacity-95")}boxAnimateBg(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");e&&(this.modalEditBox.querySelector("#chkAnimateBg").checked?(Je.addClass(e,"is-scale-animated"),Je.addClass(e,"is-appeared")):(Je.removeClass(e,"is-scale-animated"),Je.removeClass(e,"is-appeared")))}boxParallaxBg(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");if(e)if(this.modalEditBox.querySelector("#chkParallaxBg").checked)e.setAttribute("data-bottom-top","transform:translateY(-120px) scale(1);"),e.setAttribute("data-top-bottom","transform:translateY(50px) scale(1.4)"),this.builder.settings.onRender();else{Je.removeClass(e,"skrollable"),Je.removeClass(e,"skrollable-between"),e.removeAttribute("data-bottom-top"),e.removeAttribute("data-top-bottom"),e.style.transform="translateY(0) scale(1)",e.style.transform="";let i=e.outerHTML;e.parentNode.removeChild(e),Je.appendHtml(t,i)}}boxParallaxBg2(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");e&&(this.modalEditBox.querySelector("#chkParallaxBg2").checked?e.style.backgroundAttachment="fixed":e.style.backgroundAttachment="")}boxOptimizeTextSize(){let t=this.builder.activeBox.querySelector(".is-builder");this.modalEditBox.querySelector("#chkOptimizeTextSize").checked?Je.addClass(t,"v2"):Je.removeClass(t,"v2")}boxContentAutofit(){let t=this.builder.activeBox;this.modalEditBox.querySelector("#chkAutofitContent").checked?Je.addClass(t,"box-autofit"):Je.removeClass(t,"box-autofit")}boxContainerAnim(){let t=this.builder.activeBox,e=this.builder.activeSection,i=t.querySelector(".is-builder"),n="20%",o=parseInt(window.getComputedStyle(e,null).getPropertyValue("min-height"));parseInt(o)<=50&&(n="10%");let s=this.modalEditBox.querySelector("#chkParallaxContent").checked,a=this.modalEditBox.querySelector("#chkFadeContent").checked;i.removeAttribute("data-100-bottom"),i.removeAttribute("data-center"),s&&!a?(i.setAttribute("data-bottom-top",`transform:translateY(-${n})`),i.removeAttribute("data-100-bottom"),i.setAttribute("data-top-bottom",`transform:translateY(${n})`)):a&&!s?(i.setAttribute("data-bottom-top","opacity:0"),i.setAttribute("data-100-bottom","opacity:1"),i.removeAttribute("data-top-bottom")):a&&s?(i.setAttribute("data-bottom-top",`transform:translateY(-${n});opacity:0;`),i.setAttribute("data-100-bottom","opacity:1"),i.setAttribute("data-top-bottom",`transform:translateY(${n})`)):(Je.removeClass(i,"skrollable"),Je.removeClass(i,"skrollable-between"),i.removeAttribute("data-bottom-top"),i.removeAttribute("data-100-bottom"),i.removeAttribute("data-top-bottom"),i.style.transform=""),this.builder.settings.onRender()}setElementClass(t,e,i,n){let o;for(let n=0;n<Object.keys(i).length;n++){let s=Object.values(i)[n];if(Je.hasClass(t,s)){if("+"===e){if(n+1===Object.keys(i).length)return;o=Object.values(i)[n+1];break}if("-"===e){if(n-1<0)return;o=Object.values(i)[n-1];break}}}if(o){for(let e=0;e<Object.keys(i).length;e++){let n=Object.values(i)[e];Je.removeClass(t,n)}Je.addClass(t,o)}else Je.addClass(t,n)}removeElementClass(t,e){for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];Je.removeClass(t,n)}}boxOverlayOpacity(t){let e=this.builder.activeBox.querySelector(".is-overlay");if(!e)return;let i=e.querySelector(".is-overlay-color");if(!i){e.querySelector(".is-overlay-bg").insertAdjacentHTML("afterbegin",`<div class="is-overlay-color ${this.builder.cssClasses.opacity.opacity_5}"></div>`),i=e.querySelector(".is-overlay-color")}if(this.builder.useCssClasses){const e=this.builder.cssClasses.opacity;"0"===t?(this.removeElementClass(i,e),Je.addClass(i,e.opacity_0)):this.setElementClass(i,t,e,e.opacity_10),i.style.opacity="",i.style.display=""}else{if("+"===t){let t=i.style.opacity;i.style.opacity=t?"0.01"===t?.025:"0.025"===t?.04:"0.04"===t?.055:"0.055"===t?.07:"0.07"===t?.085:"0.085"===t?.1:"0.1"===t?.125:"0.125"===t?.15:"0.15"===t?.2:"0.2"===t?.25:"0.25"===t?.3:"0.3"===t?.35:"0.35"===t?.4:"0.4"===t?.45:"0.45"===t?.5:"0.5"===t?.55:"0.55"===t||"0.6"===t?.6:.15:.1}if("-"===t){let t=i.style.opacity;i.style.opacity=t?"0.01"===t||"0.025"===t?.01:"0.04"===t?.025:"0.055"===t?.04:"0.07"===t?.055:"0.085"===t?.07:"0.1"===t?.085:"0.125"===t?.1:"0.15"===t?.125:"0.2"===t?.15:"0.25"===t?.2:"0.3"===t?.25:"0.35"===t?.3:"0.4"===t?.35:"0.45"===t?.4:"0.5"===t?.45:"0.55"===t?.5:"0.6"===t?.55:.15:.085}"0"===t&&(i.style.opacity="0")}return!1}boxSelectAsset(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");return e?(this.builder.settings.onCoverImageSelectClick&&this.builder.settings.onCoverImageSelectClick(e),!1):void 0}boxImage(t,e){const i=this.builderStuff,n=i.querySelector(".waiting-indicator"),o=i.querySelector(".waiting-indicator-overlay");if(n&&n.parentNode.removeChild(n),o&&o.parentNode.removeChild(o),e)return void alert(e);let s;this.targetBox?(s=this.targetBox,this.targetBox=null):s=this.builder.activeBox;const a=this.modalEditBox;this.builder.editor.saveForUndo();let r=s.querySelector(".is-overlay");r||(s.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),r=s.querySelector(".is-overlay"));const l=a.querySelector(".box-bgimage-preview"),d=a.querySelector(".input-box-bgimageadjust");d.style.display="none";const c=a.querySelector(".label-box-bgimage-grayscale");c.style.display="none";const u=a.querySelector(".input-box-bgremove");if(u.style.display="none",""!==t){let e=r.querySelector(".is-overlay-bg");e||(r.insertAdjacentHTML("beforeend",'<div class="is-overlay-bg"></div>'),e=r.querySelector(".is-overlay-bg")),e.style.backgroundImage="url('"+t+"')",e.style.backgroundPosition="50% 60%",l.innerHTML=`<img src="${t}">`,d.style.display="flex",u.style.display="flex",c.style.display="flex",e.style.filter="",r.style.filter="";a.querySelector(".chk-box-bgimage-grayscale").checked=!1,e.style.backgroundPosition="50% 60%",e.removeAttribute("data-scale"),e.removeAttribute("data-x"),e.removeAttribute("data-y"),e.style.top="",e.style.bottom="",e.style.left="",e.style.right="",e.style.width="",e.style.height="",a.querySelector("#tabBoxImage").style.display="inline-block"}else{let t=r.querySelector(".is-overlay-bg");t&&t.parentNode.removeChild(t);let e=r.querySelector(".is-overlay-color");e&&e.parentNode.removeChild(e);let i=r.querySelector(".is-overlay-content");i&&""===i.innerHTML&&i.parentNode.removeChild(i),l.innerHTML="";a.querySelector(".input-box-overlaycolor").style.backgroundColor="",a.querySelector("#tabBoxImage").style.display="none"}this.builder.onRender(),this.builder.onChange()}}var ei="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ii={exports:{}};!function(t,e){t.exports=function(){var t="object",e="function",i="undefined",n=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],o=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function r(i,n){var o=typeof i[n];return o==e||!(o!=t||!i[n])||"unknown"==o}function l(e,i){return!(typeof e[i]!=t||!e[i])}function d(t,e){return typeof t[e]!=i}function c(t){return function(e,i){for(var n=i.length;n--;)if(!t(e,i[n]))return!1;return!0}}var u=c(r),p=c(l),h=c(d);function g(t){return t&&u(t,a)&&h(t,s)}function f(t){return l(t,"body")?t.body:t.getElementsByTagName("body")[0]}var m,b,v={},y=typeof window!=i&&typeof document!=i,_={isHostMethod:r,isHostObject:l,isHostProperty:d,areHostMethods:u,areHostObjects:p,areHostProperties:h,isTextRange:g,getBody:f,forEach:[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var i=0,n=t.length;i<n;++i)e(t[i],i)}},x={version:"1.3.0",initialized:!1,isBrowser:y,supported:!0,util:_,features:{},modules:v,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==i||rangyAutoInitialize}};function w(t){typeof console!=i&&r(console,"log")&&console.log(t)}function S(t,e){y&&e?alert(t):w(t)}function C(t){x.initialized=!0,x.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,x.config.alertOnFail)}function k(t){S("Rangy warning: "+t,x.config.alertOnWarn)}x.fail=C,x.warn=k,{}.hasOwnProperty?(_.extend=m=function(t,e,i){var n,o;for(var s in e)e.hasOwnProperty(s)&&(n=t[s],o=e[s],i&&null!==n&&"object"==typeof n&&null!==o&&"object"==typeof o&&m(n,o,!0),t[s]=o);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},_.createOptions=function(t,e){var i={};return m(i,e),t&&m(i,t),i}):C("hasOwnProperty not supported"),y||C("Rangy can only run in a browser"),function(){var t;if(y){var e=document.createElement("div");e.appendChild(document.createElement("span"));var i=[].slice;try{1==i.call(e.childNodes,0)[0].nodeType&&(t=function(t){return i.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],i=0,n=t.length;i<n;++i)e[i]=t[i];return e}),_.toArray=t}(),y&&(r(document,"addEventListener")?b=function(t,e,i){t.addEventListener(e,i,!1)}:r(document,"attachEvent")?b=function(t,e,i){t.attachEvent("on"+e,i)}:C("Document does not have required addEventListener or attachEvent method"),_.addListener=b);var E=[];function A(t){return t.message||t.description||String(t)}function L(){if(y&&!x.initialized){var t,e=!1,i=!1;r(document,"createRange")&&(t=document.createRange(),u(t,o)&&h(t,n)&&(e=!0));var s=f(document);if(s&&"body"==s.nodeName.toLowerCase())if(s&&r(s,"createTextRange")&&g(t=s.createTextRange())&&(i=!0),e||i){var a;for(var l in x.initialized=!0,x.features={implementsDomRange:e,implementsTextRange:i},v)(a=v[l])instanceof O&&a.init(a,x);for(var d=0,c=E.length;d<c;++d)try{E[d](x)}catch(t){w("Rangy init listener threw an exception. Continuing. Detail: "+A(t))}}else C("Neither Range nor TextRange are available");else C("No body element found")}}function q(t,e,i){i&&(t+=" in module "+i.name),x.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function T(t,e,i,n){t[e]=function(){return q(e,i,n),t[i].apply(t,_.toArray(arguments))}}_.deprecationNotice=q,_.createAliasForDeprecatedMethod=T,x.init=L,x.addInitListener=function(t){x.initialized?t(x):E.push(t)};var M=[];function R(t){t=t||window,L();for(var e=0,i=M.length;e<i;++e)M[e](t)}function O(t,e,i){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=i}function B(t,e,i){var n=new O(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{i(x,e),e.supported=!0}catch(e){w("Module '"+t+"' failed to load: "+A(e)),e.stack&&w(e.stack)}}}));return v[t]=n,n}function N(){}function I(){}x.addShimListener=function(t){M.push(t)},y&&(x.shim=x.createMissingNativeApi=R,T(x,"createMissingNativeApi","shim")),O.prototype={init:function(){for(var t,e,i=this.dependencies||[],n=0,o=i.length;n<o;++n){if(e=i[n],!((t=v[e])&&t instanceof O))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){x.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){x.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},x.createModule=function(t){var e,i;2==arguments.length?(e=arguments[1],i=[]):(e=arguments[2],i=arguments[1]);var n=B(t,i,e);x.initialized&&x.supported&&n.init()},x.createCoreModule=function(t,e,i){B(t,e,i)},x.RangePrototype=N,x.rangePrototype=new N,x.selectionPrototype=new I,x.createCoreModule("DomUtil",[],(function(t,e){var i="undefined",n=t.util,o=n.getBody;n.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),n.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var s=document.createElement("div");n.areHostMethods(s,["insertBefore","appendChild","cloneNode"]||!n.areHostObjects(s,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),n.isHostProperty(s,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");n.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||!n.areHostObjects(s,["previousSibling","nextSibling","childNodes","parentNode"])||!n.areHostProperties(a,["data"]))||e.fail("Incomplete Text Node implementation");var r=function(t,e){for(var i=t.length;i--;)if(t[i]===e)return!0;return!1};function l(t){var e;return typeof t.namespaceURI==i||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function d(t){var e=t.parentNode;return 1==e.nodeType?e:null}function c(t){for(var e=0;t=t.previousSibling;)++e;return e}function u(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function p(t,e){var i,n=[];for(i=t;i;i=i.parentNode)n.push(i);for(i=e;i;i=i.parentNode)if(r(n,i))return i;return null}function h(t,e,i){for(var n=i?e:e.parentNode;n;){if(n===t)return!0;n=n.parentNode}return!1}function g(t,e){return h(t,e,!0)}function f(t,e,i){for(var n,o=i?t:t.parentNode;o;){if((n=o.parentNode)===e)return o;o=n}return null}function m(t){var e=t.nodeType;return 3==e||4==e||8==e}function b(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function v(t,e){var i=e.nextSibling,n=e.parentNode;return i?n.insertBefore(t,i):n.appendChild(t),t}function y(t,e,i){var n=t.cloneNode(!1);if(n.deleteData(0,e),t.deleteData(e,t.length-e),v(n,t),i)for(var o,s=0;o=i[s++];)o.node==t&&o.offset>e?(o.node=n,o.offset-=e):o.node==t.parentNode&&o.offset>c(t)&&++o.offset;return n}function _(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=i)return t.ownerDocument;if(typeof t.document!=i)return t.document;if(t.parentNode)return _(t.parentNode);throw e.createError("getDocument: no document found for node")}function x(t){var n=_(t);if(typeof n.defaultView!=i)return n.defaultView;if(typeof n.parentWindow!=i)return n.parentWindow;throw e.createError("Cannot get a window object for node")}function w(t){if(typeof t.contentDocument!=i)return t.contentDocument;if(typeof t.contentWindow!=i)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function S(t){if(typeof t.contentWindow!=i)return t.contentWindow;if(typeof t.contentDocument!=i)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function C(t){return t&&n.isHostMethod(t,"setTimeout")&&n.isHostObject(t,"document")}function k(t,e,i){var o;if(t?n.isHostProperty(t,"nodeType")?o=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?w(t):_(t):C(t)&&(o=t.document):o=document,!o)throw e.createError(i+"(): Parameter must be a Window object or DOM node");return o}function E(t){for(var e;e=t.parentNode;)t=e;return t}function A(t,i,n,o){var s,a,r,l,d;if(t==n)return i===o?0:i<o?-1:1;if(s=f(n,t,!0))return i<=c(s)?-1:1;if(s=f(t,n,!0))return c(s)<o?-1:1;if(!(a=p(t,n)))throw new Error("comparePoints error: nodes have no common ancestor");if((r=t===a?a:f(t,a,!0))===(l=n===a?a:f(n,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(d=a.firstChild;d;){if(d===r)return-1;if(d===l)return 1;d=d.nextSibling}}var L,q=!1;function T(t){try{return t.parentNode,!1}catch(t){return!0}}function M(t){if(!t)return"[No node]";if(q&&T(t))return"[Broken node]";if(m(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+c(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function R(t){for(var e,i=_(t).createDocumentFragment();e=t.firstChild;)i.appendChild(e);return i}function O(t,e,i){var n=o(t),s=t.createElement("div");s.contentEditable=""+!!i,e&&(s.innerHTML=e);var a=n.firstChild;return a?n.insertBefore(s,a):n.appendChild(s),s}function B(t){return t.parentNode.removeChild(t)}function N(t){this.root=t,this._next=t}function I(t){return new N(t)}function D(t,e){this.node=t,this.offset=e}function P(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var i=e.firstChild;e.innerHTML="<br />",q=T(i),t.features.crashyTextNodes=q}(),typeof window.getComputedStyle!=i?L=function(t,e){return x(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=i?L=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),N.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,i=this._current=this._next;if(this._current)if(t=i.firstChild)this._next=t;else{for(e=null;i!==this.root&&!(e=i.nextSibling);)i=i.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},D.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+M(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},P.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},P.prototype.toString=function(){return this.message},t.dom={arrayContains:r,isHtmlNamespace:l,parentElement:d,getNodeIndex:c,getNodeLength:u,getCommonAncestor:p,isAncestorOf:h,isOrIsAncestorOf:g,getClosestAncestorIn:f,isCharacterDataNode:m,isTextOrCommentNode:b,insertAfter:v,splitDataNode:y,getDocument:_,getWindow:x,getIframeWindow:S,getIframeDocument:w,getBody:o,isWindow:C,getContentDocument:k,getRootContainer:E,comparePoints:A,isBrokenNode:T,inspectNode:M,getComputedStyleProperty:L,createTestElement:O,removeNode:B,fragmentFromNodeChildren:R,createIterator:I,DomPosition:D},t.DOMException=P})),x.createCoreModule("DomRange",["DomUtil"],(function(t,e){var i=t.dom,n=t.util,o=i.DomPosition,s=t.DOMException,a=i.isCharacterDataNode,r=i.getNodeIndex,l=i.isOrIsAncestorOf,d=i.getDocument,c=i.comparePoints,u=i.splitDataNode,p=i.getClosestAncestorIn,h=i.getNodeLength,g=i.arrayContains,f=i.getRootContainer,m=t.features.crashyTextNodes,b=i.removeNode;function v(t,e){return 3!=t.nodeType&&(l(t,e.startContainer)||l(t,e.endContainer))}function y(t){return t.document||d(t.startContainer)}function _(t){return f(t.startContainer)}function x(t){return new o(t.parentNode,r(t))}function w(t){return new o(t.parentNode,r(t)+1)}function S(t,e,n){var o=11==t.nodeType?t.firstChild:t;return a(e)?n==e.length?i.insertAfter(t,e):e.parentNode.insertBefore(t,0==n?e:u(e,n)):n>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[n]),o}function C(t,e,i){if(Y(t),Y(e),y(e)!=y(t))throw new s("WRONG_DOCUMENT_ERR");var n=c(t.startContainer,t.startOffset,e.endContainer,e.endOffset),o=c(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return i?n<=0&&o>=0:n<0&&o>0}function k(t){for(var e,i,n,o=y(t.range).createDocumentFragment();i=t.next();){if(e=t.isPartiallySelectedSubtree(),i=i.cloneNode(!e),e&&(n=t.getSubtreeIterator(),i.appendChild(k(n)),n.detach()),10==i.nodeType)throw new s("HIERARCHY_REQUEST_ERR");o.appendChild(i)}return o}function E(t,e,n){var o,s,a,r;for(n=n||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(n.stop=!0);if(E(r=t.getSubtreeIterator(),e,n),r.detach(),n.stop)return}else for(o=i.createIterator(a);s=o.next();)if(!1===e(s))return void(n.stop=!0)}function A(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(A(e=t.getSubtreeIterator()),e.detach()):t.remove()}function L(t){for(var e,i,n=y(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),i=t.getSubtreeIterator(),e.appendChild(L(i)),i.detach()):t.remove(),10==e.nodeType)throw new s("HIERARCHY_REQUEST_ERR");n.appendChild(e)}return n}function q(t,e,i){var n,o=!(!e||!e.length),s=!!i;o&&(n=new RegExp("^("+e.join("|")+")$"));var r=[];return E(new M(t,!1),(function(e){if((!o||n.test(e.nodeType))&&(!s||i(e))){var l=t.startContainer;if(e!=l||!a(l)||t.startOffset!=l.length){var d=t.endContainer;e==d&&a(d)&&0==t.endOffset||r.push(e)}}})),r}function T(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+i.inspectNode(t.startContainer)+":"+t.startOffset+", "+i.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function M(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var i=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==i||a(this.sc)?p(this.sc,i,!0):this.sc.childNodes[this.so],this._last=this.ec!==i||a(this.ec)?p(this.ec,i,!0):this.ec.childNodes[this.eo-1])}}M.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,i=this._current;!a(i)||i!==this.sc&&i!==this.ec?i.parentNode&&b(i):(t=i===this.sc?this.so:0)!=(e=i===this.ec?this.eo:i.length)&&i.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return v(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new mt(y(this.range));var e=this._current,i=e,n=0,o=e,s=h(e);l(e,this.sc)&&(i=this.sc,n=this.so),l(e,this.ec)&&(o=this.ec,s=this.eo),ft(t,i,n,o,s)}return new M(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var R=[1,3,4,5,7,8,10],O=[2,9,11],B=[5,6,10,12],N=[1,3,4,5,7,8,10,11],I=[1,3,4,5,7,8];function D(t){return function(e,i){for(var n,o=i?e:e.parentNode;o;){if(n=o.nodeType,g(t,n))return o;o=o.parentNode}return null}}var P=D([9,11]),$=D(B),z=D([6,10,12]);function H(t,e){if(z(t,e))throw new s("INVALID_NODE_TYPE_ERR")}function j(t,e){if(!g(e,t.nodeType))throw new s("INVALID_NODE_TYPE_ERR")}function F(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new s("INDEX_SIZE_ERR")}function U(t,e){if(P(t,!0)!==P(e,!0))throw new s("WRONG_DOCUMENT_ERR")}function W(t){if($(t,!0))throw new s("NO_MODIFICATION_ALLOWED_ERR")}function V(t,e){if(!t)throw new s(e)}function G(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function X(t){return!!t.startContainer&&!!t.endContainer&&!(m&&(i.isBrokenNode(t.startContainer)||i.isBrokenNode(t.endContainer)))&&f(t.startContainer)==f(t.endContainer)&&G(t.startContainer,t.startOffset)&&G(t.endContainer,t.endOffset)}function Y(t){if(!X(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var K=document.createElement("style"),Z=!1;try{K.innerHTML="<b>x</b>",Z=3==K.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=Z;var Q=Z?function(t){var e=this.startContainer,n=d(e);if(!e)throw new s("INVALID_STATE_ERR");var o=null;return 1==e.nodeType?o=e:a(e)&&(o=i.parentElement(e)),(o=null===o||"HTML"==o.nodeName&&i.isHtmlNamespace(d(o).documentElement)&&i.isHtmlNamespace(o)?n.createElement("body"):o.cloneNode(!1)).innerHTML=t,i.fragmentFromNodeChildren(o)}:function(t){var e=y(this).createElement("body");return e.innerHTML=t,i.fragmentFromNodeChildren(e)};function J(t,e){Y(t);var i=t.startContainer,n=t.startOffset,o=t.endContainer,s=t.endOffset,l=i===o;a(o)&&s>0&&s<o.length&&u(o,s,e),a(i)&&n>0&&n<i.length&&(i=u(i,n,e),l?(s-=n,o=i):o==i.parentNode&&s>=r(i)&&s++,n=0),t.setStartAndEnd(i,n,o,s)}function tt(t){Y(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var et=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],it=0,nt=1,ot=2,st=3,at=0,rt=1,lt=2,dt=3;function ct(t){t.START_TO_START=it,t.START_TO_END=nt,t.END_TO_END=ot,t.END_TO_START=st,t.NODE_BEFORE=at,t.NODE_AFTER=rt,t.NODE_BEFORE_AND_AFTER=lt,t.NODE_INSIDE=dt}function ut(t){ct(t),ct(t.prototype)}function pt(t,e){return function(){Y(this);var i,n=this.startContainer,o=this.startOffset,s=this.commonAncestorContainer,a=new M(this,!0);n!==s&&(n=(i=w(p(n,s,!0))).node,o=i.offset),E(a,W),a.reset();var r=t(a);return a.detach(),e(this,n,o,n,o),r}}function ht(e,i){function o(t,e){return function(i){j(i,R),j(f(i),O);var n=(t?x:w)(i);(e?s:l)(this,n.node,n.offset)}}function s(t,e,n){var o=t.endContainer,s=t.endOffset;e===t.startContainer&&n===t.startOffset||(f(e)==f(o)&&1!=c(e,n,o,s)||(o=e,s=n),i(t,e,n,o,s))}function l(t,e,n){var o=t.startContainer,s=t.startOffset;e===t.endContainer&&n===t.endOffset||(f(e)==f(o)&&-1!=c(e,n,o,s)||(o=e,s=n),i(t,o,s,e,n))}var d=function(){};d.prototype=t.rangePrototype,e.prototype=new d,n.extend(e.prototype,{setStart:function(t,e){H(t,!0),F(t,e),s(this,t,e)},setEnd:function(t,e){H(t,!0),F(t,e),l(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],n=t[1],o=e,s=n;switch(t.length){case 3:s=t[2];break;case 4:o=t[2],s=t[3]}i(this,e,n,o,s)},setBoundary:function(t,e,i){this["set"+(i?"Start":"End")](t,e)},setStartBefore:o(!0,!0),setStartAfter:o(!1,!0),setEndBefore:o(!0,!1),setEndAfter:o(!1,!1),collapse:function(t){Y(this),t?i(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):i(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){H(t,!0),i(this,t,0,t,h(t))},selectNode:function(t){H(t,!1),j(t,R);var e=x(t),n=w(t);i(this,e.node,e.offset,n.node,n.offset)},extractContents:pt(L,i),deleteContents:pt(A,i),canSurroundContents:function(){Y(this),W(this.startContainer),W(this.endContainer);var t=new M(this,!0),e=t._first&&v(t._first,this)||t._last&&v(t._last,this);return t.detach(),!e},splitBoundaries:function(){J(this)},splitBoundariesPreservingPositions:function(t){J(this,t)},normalizeBoundaries:function(){Y(this);var t,e=this.startContainer,n=this.startOffset,o=this.endContainer,s=this.endOffset,l=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(o=t,s=t.length,t.appendData(e.data),b(e))},d=function(t){var i=t.previousSibling;if(i&&i.nodeType==t.nodeType){e=t;var a=t.length;if(n=i.length,t.insertData(0,i.data),b(i),e==o)s+=n,o=e;else if(o==t.parentNode){var l=r(t);s==l?(o=t,s=a):s>l&&s--}}},c=!0;if(a(o))s==o.length?l(o):0==s&&(t=o.previousSibling)&&t.nodeType==o.nodeType&&(s=t.length,e==o&&(c=!1),t.appendData(o.data),b(o),o=t);else{if(s>0){var u=o.childNodes[s-1];u&&a(u)&&l(u)}c=!this.collapsed}if(c){if(a(e))0==n?d(e):n==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(o==t&&(o=e,s+=e.length),e.appendData(t.data),b(t));else if(n<e.childNodes.length){var p=e.childNodes[n];p&&a(p)&&d(p)}}else e=o,n=s;i(this,e,n,o,s)},collapseToPoint:function(t,e){H(t,!0),F(t,e),this.setStartAndEnd(t,e)}}),ut(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:i.getCommonAncestor(t.startContainer,t.endContainer)}function ft(t,e,n,o,s){t.startContainer=e,t.startOffset=n,t.endContainer=o,t.endOffset=s,t.document=i.getDocument(e),gt(t)}function mt(t){this.startContainer=t,this.startOffset=0,this.endContainer=t,this.endOffset=0,this.document=t,gt(this)}n.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var i,n,o,s;Y(this),U(this.startContainer,e.startContainer);var a=t==st||t==it?"start":"end",r=t==nt||t==it?"start":"end";return i=this[a+"Container"],n=this[a+"Offset"],o=e[r+"Container"],s=e[r+"Offset"],c(i,n,o,s)},insertNode:function(t){if(Y(this),j(t,N),W(this.startContainer),l(t,this.startContainer))throw new s("HIERARCHY_REQUEST_ERR");var e=S(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(Y(this),this.collapsed)return y(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=y(this).createDocumentFragment()).appendChild(t),e;var i=new M(this,!0);return t=k(i),i.detach(),t},canSurroundContents:function(){Y(this),W(this.startContainer),W(this.endContainer);var t=new M(this,!0),e=t._first&&v(t._first,this)||t._last&&v(t._last,this);return t.detach(),!e},surroundContents:function(t){if(j(t,I),!this.canSurroundContents())throw new s("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);S(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){Y(this);for(var t,e=new mt(y(this)),i=et.length;i--;)e[t=et[i]]=this[t];return e},toString:function(){Y(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],i=new M(this,!0);return E(i,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),i.detach(),e.join("")},compareNode:function(t){Y(this);var e=t.parentNode,i=r(t);if(!e)throw new s("NOT_FOUND_ERR");var n=this.comparePoint(e,i),o=this.comparePoint(e,i+1);return n<0?o>0?lt:at:o>0?rt:dt},comparePoint:function(t,e){return Y(this),V(t,"HIERARCHY_REQUEST_ERR"),U(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)<0?-1:c(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return tt(this)},intersectsNode:function(t,e){if(Y(this),f(t)!=_(this))return!1;var i=t.parentNode,n=r(t);if(!i)return!0;var o=c(i,n,this.endContainer,this.endOffset),s=c(i,n+1,this.startContainer,this.startOffset);return e?o<=0&&s>=0:o<0&&s>0},isPointInRange:function(t,e){return Y(this),V(t,"HIERARCHY_REQUEST_ERR"),U(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)>=0&&c(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return C(this,t,!1)},intersectsOrTouchesRange:function(t){return C(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=c(this.startContainer,this.startOffset,t.startContainer,t.startOffset),i=c(this.endContainer,this.endOffset,t.endContainer,t.endOffset),n=this.cloneRange();return-1==e&&n.setStart(t.startContainer,t.startOffset),1==i&&n.setEnd(t.endContainer,t.endOffset),n}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==c(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==c(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new s("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==dt},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,h(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var i=e.getNodes([3]);if(i.length>0){e.setStart(i[0],0);var n=i.pop();return e.setEnd(n,n.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return Y(this),q(this,t,e)},getDocument:function(){return y(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var n=y(this),o=t.createRange(n);e=e||i.getBody(n),o.selectNodeContents(e);var s=this.intersection(o),a=0,r=0;return s&&(o.setEnd(s.startContainer,s.startOffset),r=(a=o.toString().length)+s.toString().length),{start:a,end:r,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,i=0;this.setStart(e,0),this.collapse(!0);for(var n,o,s,a,r=[e],l=!1,d=!1;!d&&(n=r.pop());)if(3==n.nodeType)o=i+n.length,!l&&t.start>=i&&t.start<=o&&(this.setStart(n,t.start-i),l=!0),l&&t.end>=i&&t.end<=o&&(this.setEnd(n,t.end-i),d=!0),i=o;else for(s=(a=n.childNodes).length;s--;)r.push(a[s])},getName:function(){return"DomRange"},equals:function(t){return mt.rangesEqual(this,t)},isValid:function(){return X(this)},inspect:function(){return T(this)},detach:function(){}}),ht(mt,ft),n.extend(mt,{rangeProperties:et,RangeIterator:M,copyComparisonConstants:ut,createPrototypeRange:ht,inspect:T,toHtml:tt,getRangeDocument:y,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=mt})),x.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var i,n,o=t.dom,s=t.util,a=o.DomPosition,r=t.DomRange,l=o.getBody,d=o.getContentDocument,c=o.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var n,a,c=r.rangeProperties;function u(t){for(var e,i=c.length;i--;)t[e=c[i]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function p(t,e,i,n,o){var s=t.startContainer!==e||t.startOffset!=i,a=t.endContainer!==n||t.endOffset!=o,r=!t.equals(t.nativeRange);(s||a||r)&&(t.setEnd(n,o),t.setStart(e,i))}i=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,u(this)},r.createPrototypeRange(i,p),(n=i.prototype).selectNode=function(t){this.nativeRange.selectNode(t),u(this)},n.cloneContents=function(){return this.nativeRange.cloneContents()},n.surroundContents=function(t){this.nativeRange.surroundContents(t),u(this)},n.collapse=function(t){this.nativeRange.collapse(t),u(this)},n.cloneRange=function(){return new i(this.nativeRange.cloneRange())},n.refresh=function(){u(this)},n.toString=function(){return this.nativeRange.toString()};var h=document.createTextNode("test");l(document).appendChild(h);var g=document.createRange();g.setStart(h,0),g.setEnd(h,0);try{g.setStart(h,1),n.setStart=function(t,e){this.nativeRange.setStart(t,e),u(this)},n.setEnd=function(t,e){this.nativeRange.setEnd(t,e),u(this)},a=function(t){return function(e){this.nativeRange[t](e),u(this)}}}catch(t){n.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(i){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}u(this)},n.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(i){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}u(this)},a=function(t,e){return function(i){try{this.nativeRange[t](i)}catch(n){this.nativeRange[e](i),this.nativeRange[t](i)}u(this)}}}n.setStartBefore=a("setStartBefore","setEndBefore"),n.setStartAfter=a("setStartAfter","setEndAfter"),n.setEndBefore=a("setEndBefore","setStartBefore"),n.setEndAfter=a("setEndAfter","setStartAfter"),n.selectNodeContents=function(t){this.setStartAndEnd(t,0,o.getNodeLength(t))},g.selectNodeContents(h),g.setEnd(h,3);var f=document.createRange();f.selectNodeContents(h),f.setEnd(h,4),f.setStart(h,2),-1==g.compareBoundaryPoints(g.START_TO_END,f)&&1==g.compareBoundaryPoints(g.END_TO_START,f)?n.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:n.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var m=document.createElement("div");m.innerHTML="123";var b=m.firstChild,v=l(document);v.appendChild(m),g.setStart(b,1),g.setEnd(b,2),g.deleteContents(),"13"==b.data&&(n.deleteContents=function(){this.nativeRange.deleteContents(),u(this)},n.extractContents=function(){var t=this.nativeRange.extractContents();return u(this),t}),v.removeChild(m),v=null,s.isHostMethod(g,"createContextualFragment")&&(n.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),l(document).removeChild(h),n.getName=function(){return"WrappedRange"},t.WrappedRange=i,t.createNativeRange=function(t){return(t=d(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var u=function(t){var e=t.parentElement(),i=t.duplicate();i.collapse(!0);var n=i.parentElement();(i=t.duplicate()).collapse(!1);var s=i.parentElement(),a=n==s?n:o.getCommonAncestor(n,s);return a==e?a:o.getCommonAncestor(e,a)},p=function(t){return 0==t.compareEndPoints("StartToEnd",t)},h=function(t,e,i,n,s){var r=t.duplicate();r.collapse(i);var l=r.parentElement();if(o.isOrIsAncestorOf(e,l)||(l=e),!l.canHaveHTML){var d=new a(l.parentNode,o.getNodeIndex(l));return{boundaryPosition:d,nodeInfo:{nodeIndex:d.offset,containerElement:d.node}}}var u=o.getDocument(l).createElement("span");u.parentNode&&o.removeNode(u);for(var p,h,g,f,m,b=i?"StartToStart":"StartToEnd",v=s&&s.containerElement==l?s.nodeIndex:0,y=l.childNodes.length,_=y,x=_;x==y?l.appendChild(u):l.insertBefore(u,l.childNodes[x]),r.moveToElementText(u),0!=(p=r.compareEndPoints(b,t))&&v!=_;){if(-1==p){if(_==v+1)break;v=x}else _=_==v+1?v:x;x=Math.floor((v+_)/2),l.removeChild(u)}if(m=u.nextSibling,-1==p&&m&&c(m)){var w;if(r.setEndPoint(i?"EndToStart":"EndToEnd",t),/[\r\n]/.test(m.data)){var S=r.duplicate(),C=S.text.replace(/\r\n/g,"\r").length;for(w=S.moveStart("character",C);-1==(p=S.compareEndPoints("StartToEnd",S));)w++,S.moveStart("character",1)}else w=r.text.length;f=new a(m,w)}else h=(n||!i)&&u.previousSibling,f=(g=(n||i)&&u.nextSibling)&&c(g)?new a(g,0):h&&c(h)?new a(h,h.data.length):new a(l,o.getNodeIndex(u));return o.removeNode(u),{boundaryPosition:f,nodeInfo:{nodeIndex:x,containerElement:l}}},g=function(t,e){var i,n,s,a,r=t.offset,d=o.getDocument(t.node),u=l(d).createTextRange(),p=c(t.node);return p?n=(i=t.node).parentNode:(i=r<(a=t.node.childNodes).length?a[r]:null,n=t.node),(s=d.createElement("span")).innerHTML="&#feff;",i?n.insertBefore(s,i):n.appendChild(s),u.moveToElementText(s),u.collapse(!e),n.removeChild(s),p&&u[e?"moveStart":"moveEnd"]("character",r),u};(n=function(t){this.textRange=t,this.refresh()}).prototype=new r(document),n.prototype.refresh=function(){var t,e,i,n=u(this.textRange);p(this.textRange)?e=t=h(this.textRange,n,!0,!0).boundaryPosition:(t=(i=h(this.textRange,n,!0,!1)).boundaryPosition,e=h(this.textRange,n,!1,!1,i.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},n.prototype.getName=function(){return"WrappedTextRange"},r.copyComparisonConstants(n);var f=function(t){if(t.collapsed)return g(new a(t.startContainer,t.startOffset),!0);var e=g(new a(t.startContainer,t.startOffset),!0),i=g(new a(t.endContainer,t.endOffset),!1),n=l(r.getRangeDocument(t)).createTextRange();return n.setEndPoint("StartToStart",e),n.setEndPoint("EndToEnd",i),n};if(n.rangeToTextRange=f,n.prototype.toTextRange=function(){return f(this)},t.WrappedTextRange=n,!t.features.implementsDomRange||t.config.preferTextRange){var m=Function("return this;")();void 0===m.Range&&(m.Range=n),t.createNativeRange=function(t){return t=d(t,e,"createNativeRange"),l(t).createTextRange()},t.WrappedRange=n}}t.createRange=function(i){return i=d(i,e,"createRange"),new t.WrappedRange(t.createNativeRange(i))},t.createRangyRange=function(t){return t=d(t,e,"createRangyRange"),new r(t)},s.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),s.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var i=e.document;void 0===i.createRange&&(i.createRange=function(){return t.createRange(i)}),i=e=null}))})),x.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var i,n,o="boolean",s="number",a=t.dom,r=t.util,l=r.isHostMethod,d=t.DomRange,c=t.WrappedRange,u=t.DOMException,p=a.DomPosition,h=t.features,g="Control",f=a.getDocument,m=a.getBody,b=d.rangesEqual;function v(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function y(t,i){if(t){if(a.isWindow(t))return t;if(t instanceof X)return t.win;var n=a.getContentDocument(t,e,i);return a.getWindow(n)}return window}function _(t){return y(t,"getWinSelection").getSelection()}function x(t){return y(t,"getDocSelection").document.selection}function w(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var S=l(window,"getSelection"),C=r.isHostObject(document,"selection");h.implementsWinGetSelection=S,h.implementsDocSelection=C;var k=C&&(!S||t.config.preferTextRange);if(k)i=x,t.isSelectionValid=function(t){var e=y(t,"isSelectionValid").document,i=e.selection;return"None"!=i.type||f(i.createRange().parentElement())==e};else{if(!S)return e.fail("Neither document.selection or window.getSelection() detected."),!1;i=_,t.isSelectionValid=function(){return!0}}t.getNativeSelection=i;var E=i();if(!E)return e.fail("Native selection was null (possibly issue 138?)"),!1;var A=t.createNativeRange(document),L=m(document),q=r.areHostProperties(E,["anchorNode","focusNode","anchorOffset","focusOffset"]);h.selectionHasAnchorAndFocus=q;var T=l(E,"extend");h.selectionHasExtend=T;var M=typeof E.rangeCount==s;h.selectionHasRangeCount=M;var R=!1,O=!0,B=T?function(e,i){var n=d.getRangeDocument(i),o=t.createRange(n);o.collapseToPoint(i.endContainer,i.endOffset),e.addRange(H(o)),e.extend(i.startContainer,i.startOffset)}:null;r.areHostMethods(E,["addRange","getRangeAt","removeAllRanges"])&&typeof E.rangeCount==s&&h.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var i=e.rangeCount,n=i>1,o=[],s=w(e),r=0;r<i;++r)o[r]=e.getRangeAt(r);var l=a.createTestElement(document,"",!1),d=l.appendChild(document.createTextNode(" ")),c=document.createRange();if(c.setStart(d,1),c.collapse(!0),e.removeAllRanges(),e.addRange(c),O=1==e.rangeCount,e.removeAllRanges(),!n){var u=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(u&&parseInt(u[1])>=36)R=!1;else{var p=c.cloneRange();c.setStart(d,0),p.setEnd(d,3),p.setStart(d,2),e.addRange(c),e.addRange(p),R=2==e.rangeCount}}for(a.removeNode(l),e.removeAllRanges(),r=0;r<i;++r)0==r&&s?B?B(e,o[r]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(o[r])):e.addRange(o[r])}}(),h.selectionSupportsMultipleRanges=R,h.collapsedNonEditableSelectionsSupported=O;var N,I,D=!1;function P(t,e,i){var n=i?"end":"start",o=i?"start":"end";t.anchorNode=e[n+"Container"],t.anchorOffset=e[n+"Offset"],t.focusNode=e[o+"Container"],t.focusOffset=e[o+"Offset"]}function $(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function z(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0}function H(e){var i;return e instanceof d?((i=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),i.setStart(e.startContainer,e.startOffset)):e instanceof c?i=e.nativeRange:h.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(i=e),i}function j(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,i=t.length;e<i;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function F(t){var i=t.getNodes();if(!j(i))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return i[0]}function U(t){return!!t&&void 0!==t.text}function W(t,e){var i=new c(e);t._ranges=[i],P(t,i,!1),t.rangeCount=1,t.isCollapsed=i.collapsed}function V(e){if(e._ranges.length=0,"None"==e.docSelection.type)z(e);else{var i=e.docSelection.createRange();if(U(i))W(e,i);else{e.rangeCount=i.length;for(var n,o=f(i.item(0)),s=0;s<e.rangeCount;++s)(n=t.createRange(o)).selectNode(i.item(s)),e._ranges.push(n);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,P(e,e._ranges[e.rangeCount-1],!1)}}}function G(t,i){for(var n=t.docSelection.createRange(),o=F(i),s=f(n.item(0)),a=m(s).createControlRange(),r=0,l=n.length;r<l;++r)a.add(n.item(r));try{a.add(o)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),V(t)}function X(t,e,i){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=i,this.refresh()}function Y(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0}L&&l(L,"createControlRange")&&(N=L.createControlRange(),r.areHostProperties(N,["item","add"])&&(D=!0)),h.implementsControlRange=D,n=q?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},l(E,"getRangeAt")?I=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:q&&(I=function(e){var i=f(e.anchorNode),n=t.createRange(i);return n.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),n.collapsed!==this.isCollapsed&&n.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),n}),X.prototype=t.selectionPrototype;var K=[];function Z(t,e){for(var i,n,o=K.length;o--;)if(n=(i=K[o]).selection,"deleteAll"==e)Y(n);else if(i.win==t)return"delete"==e?(K.splice(o,1),!0):n;return"deleteAll"==e&&(K.length=0),null}var Q=function(t){if(t&&t instanceof X)return t.refresh(),t;var e=Z(t=y(t,"getNativeSelection")),n=i(t),o=C?x(t):null;return e?(e.nativeSelection=n,e.docSelection=o,e.refresh()):(e=new X(n,o,t),K.push({win:t,selection:e})),e};t.getSelection=Q,r.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var J,tt=X.prototype;function et(t,i){for(var n,o=f(i[0].startContainer),s=m(o).createControlRange(),a=0,r=i.length;a<r;++a){n=F(i[a]);try{s.add(n)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}s.select(),V(t)}if(!k&&q&&r.areHostMethods(E,["removeAllRanges","addRange"])){tt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),z(this)};var it=function(t,e){B(t.nativeSelection,e),t.refresh()};tt.addRange=M?function(e,i){if(D&&C&&this.docSelection.type==g)G(this,e);else if(v(i)&&T)it(this,e);else{var o;R?o=this.rangeCount:(this.removeAllRanges(),o=0);var s=H(e).cloneRange();try{this.nativeSelection.addRange(s)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==o+1){if(t.config.checkSelectionRanges){var a=I(this.nativeSelection,this.rangeCount-1);a&&!b(a,e)&&(e=new c(a))}this._ranges[this.rangeCount-1]=e,P(this,e,nt(this.nativeSelection)),this.isCollapsed=n(this)}else this.refresh()}}:function(t,e){v(e)&&T?it(this,t):(this.nativeSelection.addRange(H(t)),this.refresh())},tt.setRanges=function(t){if(D&&C&&t.length>1)et(this,t);else{this.removeAllRanges();for(var e=0,i=t.length;e<i;++e)this.addRange(t[e])}}}else{if(!(l(E,"empty")&&l(A,"select")&&D&&k))return e.fail("No means of selecting a Range or TextRange was found"),!1;tt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=f(this.anchorNode);else if(this.docSelection.type==g){var e=this.docSelection.createRange();e.length&&(t=f(e.item(0)))}t&&(m(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}z(this)},tt.addRange=function(e){this.docSelection.type==g?G(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,P(this,e,!1))},tt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?et(this,t):e&&this.addRange(t[0])}}if(tt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new u("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},k)J=function(e){var i;t.isSelectionValid(e.win)?i=e.docSelection.createRange():(i=m(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==g?V(e):U(i)?W(e,i):z(e)};else if(l(E,"getRangeAt")&&typeof E.rangeCount==s)J=function(e){if(D&&C&&e.docSelection.type==g)V(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var i=0,o=e.rangeCount;i<o;++i)e._ranges[i]=new t.WrappedRange(e.nativeSelection.getRangeAt(i));P(e,e._ranges[e.rangeCount-1],nt(e.nativeSelection)),e.isCollapsed=n(e)}else z(e)};else{if(!q||typeof E.isCollapsed!=o||typeof A.collapsed!=o||!h.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;J=function(t){var e,i=t.nativeSelection;i.anchorNode?(e=I(i,0),t._ranges=[e],t.rangeCount=1,$(t),t.isCollapsed=n(t)):z(t)}}tt.refresh=function(t){var e=t?this._ranges.slice(0):null,i=this.anchorNode,n=this.anchorOffset;if(J(this),t){var o=e.length;if(o!=this._ranges.length)return!0;if(this.anchorNode!=i||this.anchorOffset!=n)return!0;for(;o--;)if(!b(e[o],this._ranges[o]))return!0;return!1}};var nt,ot=function(t,e){var i=t.getAllRanges();t.removeAllRanges();for(var n=0,o=i.length;n<o;++n)b(e,i[n])||t.addRange(i[n]);t.rangeCount||z(t)};function st(t,e){if(t.win.document!=f(e))throw new u("WRONG_DOCUMENT_ERR")}function at(e){return function(i,n){var o;this.rangeCount?(o=this.getRangeAt(0))["set"+(e?"Start":"End")](i,n):(o=t.createRange(this.win.document)).setStartAndEnd(i,n),this.setSingleRange(o,this.isBackward())}}function rt(t){var e=[],i=new p(t.anchorNode,t.anchorOffset),n=new p(t.focusNode,t.focusOffset),o="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var s=0,a=t.rangeCount;s<a;++s)e[s]=d.inspect(t.getRangeAt(s));return"["+o+"(Ranges: "+e.join(", ")+")(anchor: "+i.inspect()+", focus: "+n.inspect()+"]"}tt.removeRange=D&&C?function(t){if(this.docSelection.type==g){for(var e=this.docSelection.createRange(),i=F(t),n=f(e.item(0)),o=m(n).createControlRange(),s=!1,a=0,r=e.length;a<r;++a)e.item(a)!==i||s?o.add(e.item(a)):s=!0;o.select(),V(this)}else ot(this,t)}:function(t){ot(this,t)},!k&&q&&h.implementsDomRange?(nt=w,tt.isBackward=function(){return nt(this)}):nt=tt.isBackward=function(){return!1},tt.isBackwards=tt.isBackward,tt.toString=function(){for(var t=[],e=0,i=this.rangeCount;e<i;++e)t[e]=""+this._ranges[e];return t.join("")},tt.collapse=function(e,i){st(this,e);var n=t.createRange(e);n.collapseToPoint(e,i),this.setSingleRange(n),this.isCollapsed=!0},tt.collapseToStart=function(){if(!this.rangeCount)throw new u("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},tt.collapseToEnd=function(){if(!this.rangeCount)throw new u("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},tt.selectAllChildren=function(e){st(this,e);var i=t.createRange(e);i.selectNodeContents(e),this.setSingleRange(i)},tt.deleteFromDocument=function(){if(D&&C&&this.docSelection.type==g){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var i=this.getAllRanges();if(i.length){this.removeAllRanges();for(var n=0,o=i.length;n<o;++n)i[n].deleteContents();this.addRange(i[o-1])}}},tt.eachRange=function(t,e){for(var i=0,n=this._ranges.length;i<n;++i)if(t(this.getRangeAt(i)))return e},tt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},tt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},tt.callMethodOnEachRange=function(t,e){var i=[];return this.eachRange((function(n){i.push(n[t].apply(n,e||[]))})),i},tt.setStart=at(!0),tt.setEnd=at(!1),t.rangePrototype.select=function(t){Q(this.getDocument()).setSingleRange(this,t)},tt.changeEachRange=function(t){var e=[],i=this.isBackward();this.eachRange((function(i){t(i),e.push(i)})),this.removeAllRanges(),i&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},tt.containsNode=function(t,e){return this.eachRange((function(i){return i.containsNode(t,e)}),!0)||!1},tt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},tt.moveToBookmark=function(e){for(var i,n,o=[],s=0;i=e.rangeBookmarks[s++];)(n=t.createRange(this.win)).moveToBookmark(i),o.push(n);e.backward?this.setSingleRange(o[0],"backward"):this.setRanges(o)},tt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},tt.restoreRanges=function(t){this.removeAllRanges();for(var e,i=0;e=t.ranges[i];++i)this.addRange(e,t.backward&&0==i)},tt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(d.toHtml(e))})),t.join("")},h.implementsTextRange&&(tt.getNativeTextRange=function(){var i;if(i=this.docSelection){var n=i.createRange();if(U(n))return n;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),tt.getName=function(){return"WrappedSelection"},tt.inspect=function(){return rt(this)},tt.detach=function(){Z(this.win,"delete"),Y(this)},X.detachAll=function(){Z(null,"deleteAll")},X.inspect=rt,X.isDirectionBackward=v,t.Selection=X,t.selectionPrototype=tt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return Q(t)}),t=null}))}));var D=!1,P=function(t){D||(D=!0,!x.initialized&&x.config.autoInitialize&&L())};return y&&("complete"==document.readyState?P():(r(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",P,!1),b(window,"load",P))),x}()}(ii);var ni=ii.exports;class oi{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}confirm(t,e,i,n){const o=this.dom;let s="";s=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(s=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const a=this.builder.builderStuff;let r=a.querySelector(".is-confirm");r||(o.appendHtml(a,s),r=a.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let l=r.querySelector(".is-confirm .input-ok");o.addEventListener(l,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let d=r.querySelector(".is-confirm .input-cancel");o.addEventListener(d,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()}))}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const o=e=>{if(!t.contains(e.target)&&!i.contains(e.target)){const i=document.querySelector(".pickcolormore.active");if(i&&i.contains(e.target))return;this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o)}},s=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))};t.addEventListener("keydown",s),document.addEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",o)}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",this.handlePopClickOut)}showPop(t,e,i){const n=this.dom;let o=document.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(o,(e=>{e!==t&&(e.style.display="",n.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),this.clearAllEventListener(t),t.style.display="flex",n.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",this.handlePopClickOut)}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n){const o=this.dom;o.addClass(t,"active"),t.setAttribute("aria-hidden",!1);const s=e=>{if(27===e.keyCode){o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",s);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}};t.addEventListener("keydown",s);let a=t.querySelector(".is-tab-content.active");a?(a.focus(),this.builder.tabs.setupTabKey(a)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const l=t.querySelector(".is-modal-overlay");if(l&&l.parentNode.removeChild(l),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");o.addEventListener(e,"click",(()=>{this.hideModal(t),t.removeEventListener("keydown",s);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}))}}const d=()=>{o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",s);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()},c=t.querySelector(".is-modal-close");c&&o.addEventListener(c,"click",d)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active")}refreshModuleLayout(t){let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let i=document.createRange();i.setStart(t,0),t.appendChild(i.createContextualFragment(e));let n=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(n,(e=>{t.getAttribute("data-html-"+o)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+o))),o++}))}fixLayout(t){const e=this.dom;Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||(t.style.width="",t.style.flex="")}));let i=2;t.querySelector(".is-row-overlay")&&(i=3);const n=t.childElementCount-i,o=this.builder.opts.row,s=this.builder.opts.cols,a=this.builder.opts.colequal;if(a.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=s.length-1;i++)e.removeClass(t,s[i]);for(let i=0;i<=a.length-1;i++)if(a[i].length===n){e.addClass(t,a[i][0]);break}1===n&&e.addClass(t,s[s.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==o&&s.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){i++;for(var o=0;o<=s.length-1;o++)e.removeClass(t,s[o]);1===n&&e.addClass(t,s[11]),2===n&&e.addClass(t,s[5]),3===n&&e.addClass(t,s[3]),4===n&&e.addClass(t,s[2]),5===n&&(5===i?e.addClass(t,s[3]):e.addClass(t,s[1])),6===n&&e.addClass(t,s[1]),7===n&&(i>=6?e.addClass(t,s[0]):e.addClass(t,s[1])),8===n&&(i>=5?e.addClass(t,s[0]):e.addClass(t,s[1])),9===n&&(i>=4?e.addClass(t,s[0]):e.addClass(t,s[1])),10===n&&(i>=3?e.addClass(t,s[0]):e.addClass(t,s[1])),11===n&&(i>=2?e.addClass(t,s[0]):e.addClass(t,s[1])),12===n&&e.addClass(t,s[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const o=this.cellSelected();let s;if(o)s=o.parentNode;else{if(s=this.builder.doc.querySelector(".row-active"),!s)return;e="row"}if("cell"===e||"cell-left"===e||"cell-right"===e){let a=4;this.builder.maxColumns&&(a=this.builder.maxColumns);let r,l=2;if(s.querySelector(".is-row-overlay")&&(l=3),s.childElementCount>=a+l)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),r=this.createElementFromHTML(t)}else{r=o.cloneNode(!0),r.removeAttribute("data-noedit"),r.removeAttribute("data-protected"),r.removeAttribute("data-module"),r.removeAttribute("data-module-desc"),r.removeAttribute("data-dialog-width"),r.removeAttribute("data-html"),r.removeAttribute("data-settings");for(let t=1;t<=20;t++)r.removeAttribute("data-html-"+t);r.removeAttribute("data-noedit"),n.removeClass(r,"cell-active"),n.removeClass(r,"is-light-text"),n.removeClass(r,"is-dark-text"),n.removeClass(r,"padding-0"),n.removeClass(r,"p-0"),r.removeAttribute("data-click"),r.removeAttribute("style"),i&&r.setAttribute(i,""),r.innerHTML=t}s.insertBefore(r,o),"cell"!==e&&"cell-right"!==e||n.moveAfter(r,o);let d=this.builder.doc.querySelector(".builder-active");d&&this.builder.applyBehaviorOn(d),this.fixLayout(s),r.click()}if("row"===e){let e,o;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let s=this.builder.opts.cellFormat,a=s.indexOf("</");t=s.substring(0,a)+t+s.substring(a);let r=n.elementChildren(e);for(;r.length>0&&(r=r[0],n.elementChildren(r).length>0);)r=n.elementChildren(r);r.innerHTML=t,o=r.firstChild,i&&o.setAttribute(i,"")}else o=n.createElement("div"),n.addClass(o,this.builder.opts.cols[this.builder.opts.cols.length-1]),o.innerHTML=t,i&&o.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,o);s.parentNode.insertBefore(e,s),n.moveAfter(e,s);let a=this.builder.doc.querySelector(".builder-active");a&&this.builder.applyBehaviorOn(a),o.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i=e;i.insertAdjacentHTML("afterend",t);let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n);let o=i.nextElementSibling;if("img"===o.tagName.toLowerCase()){let t=setInterval((()=>{o.complete&&(o.click(),clearInterval(t))}),30)}else o.click();let s=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(s)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let o,s,a,r,l=!1;const d=this.builder.builderStuff.querySelector(".quickadd").getAttribute("data-mode");if(!e||"cell"!==d&&"cell-left"!==d&&"cell-right"!==d){if(e&&"row"===d){let e;if(a=document.createElement("div"),a.className=this.builder.opts.cols[this.builder.opts.cols.length-1],a.innerHTML=t,i&&a.setAttribute("data-noedit",""),o=document.createElement("div"),o.className=this.builder.opts.row,o.appendChild(a),s=this.builder.cellSelected(),s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}e.parentNode.insertBefore(o,e),n.moveAfter(o,e);let d=this.builder.doc.querySelector(".builder-active");d&&this.builder.applyBehaviorOn(d),a.click(),o.className=o.className.replace("row-outline",""),r=this.builder.doc.querySelector(".is-column-tool"),r.className=r.className.replace("active","")}else{if(e)return void(i?this.addContent(t,d,"data-noedit"):this.addContent(t,d));{var c=document.createElement("div");c.innerHTML=t;var u=c.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(u,(e=>{t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId());for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t})),1===c.childNodes.length&&1===c.childNodes[0].childNodes.length&&("cell"===d||"cell-left"===d||"cell-right"===d)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+2)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=c.childNodes[0].childNodes[0];var p=document.createRange();t.parentNode.insertBefore(p.createContextualFragment(n.outerHTML),t),"cell"!==d&&"cell-right"!==d||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let o=this.builder.doc.querySelector(".builder-active");return o||(o=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(o),this.fixLayout(e),"cell"===d||"cell-right"===d?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(s=this.builder.activeCol,s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}p=document.createRange(),e.parentNode.insertBefore(p.createContextualFragment(c.innerHTML),e.nextSibling),o=c.childNodes[0],o=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),a=o.querySelector("div"),a&&a.click(),o.className=o.className.replace("row-outline",""),r=this.builder.doc.querySelector(".is-column-tool"),r.className=r.className.replace("active","")}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,d,"data-noedit"):this.addContent(t,d)}clearActiveCell(){const t=this.builder.builderStuff;if(!t)return;if(t.getAttribute("preventDevault"))return void setTimeout((()=>{t.removeAttribute("preventDevault")}),30);let e=this.builder.doc.getElementsByClassName("cell-active");for(;e.length;)e[0].classList.remove("cell-active");for(e=this.builder.doc.getElementsByClassName("row-outline");e.length;)e[0].classList.remove("row-outline");for(e=this.builder.doc.getElementsByClassName("row-active");e.length;)e[0].classList.remove("row-active");for(e=this.builder.doc.getElementsByClassName("builder-active");e.length;)e[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")})),o=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")}));let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-column-tool")||e.classList.contains("is-element-tool")||(e.style.display="",t.removeClass(e,"active"))}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)})),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none"}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none"}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff,n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"icon-active")}));let o=this.builder.doc.querySelectorAll(".elm-inspected");if(Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-inspected")})),o=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-active")})),i.querySelector(".is-element-tool").style.display="",i.querySelector("#divLinkTool").style.display="",t){this.builder.activeIcon=null,this.builder.inspectedElement=null,this.builder.activeElement=null;let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let o=i.querySelector(".elementrte-more-options");o&&(o.style.display="");let s=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(s,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;if(e.getAttribute("preventDevault"))return void setTimeout((()=>{e.removeAttribute("preventDevault")}),30);let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));var s=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(s,(e=>{t.removeClass(e,"active")}));let a=this.builder.doc.querySelectorAll("[data-saveforundo]");Array.prototype.forEach.call(a,(t=>{t.removeAttribute("data-saveforundo")})),a=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-inspected")}));let r=e.querySelector(".is-rte-tool");r&&(r.style.display="none");let l=e.querySelector(".is-elementrte-tool");l&&(l.style.display="none");let d=e.querySelector(".rte-more-options");d&&(d.style.display="");let c=e.querySelector(".elementrte-more-options");c&&(c.style.display=""),a=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-active")}));let u=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(u,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}));let p=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(p,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display=""}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){const t=this.dom.getSelection();if(!t)return;const e=t.anchorNode;if(e){const s=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement,a=s&&s.innerText===t.toString();let r=!1;for(var i=[],n=ni.getSelection(),o=0;o<n.rangeCount;++o)i=i.concat(n.getRangeAt(o).getNodes());const l=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(i.forEach((t=>{if(t.tagName){const e=t.tagName.toLowerCase();-1!==l.indexOf(e)&&(r=!0)}})),this.builder.selectionMulti=!!r,a||""===t.toString().trim()){this.builder.selectionElm=s;let t=s.nodeName.toLowerCase();this.builder.activeLink="a"===t?s:null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let o=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)o.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),o=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(o,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let s,a=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<a.length;t++)i=new RegExp("<"+a[t]+".*?"+a[t]+"(.*?)>","gi"),n=n.replace(i,"");s=e?["style","start"]:["start"];for(let t=0;t<s.length;t++){let e=new RegExp(" "+s[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/ /gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const e=this.dom,i=e.elementChildren(t);let n=!0;if(i.forEach((t=>{e.hasClass(t,"row-add-initial")||e.hasClass(t,"dummy-space")||(n=!1)})),n){let i=t.querySelector(".row-add-initial");i||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,i=t.querySelector(".row-add-initial")),i.addEventListener("click",(()=>{this.clearActiveCell();const n=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"builder-active")})),e.addClass(t,"builder-active"),e.addClass(i,"row-active");let o=this.builder.builderStuff.querySelector(".quickadd");o.querySelector(".is-pop-tabs").style.display="none";const s=window.innerHeight;let a,r;if(this.builder.iframe){let t=this.builder.iframe.getBoundingClientRect().top,e=this.builder.iframe.getBoundingClientRect().left;a=i.getBoundingClientRect().top+t,r=i.getBoundingClientRect().left+(i.offsetWidth*this.builder.opts.zoom/2-11)+e}else a=i.getBoundingClientRect().top,r=i.getBoundingClientRect().left+i.offsetWidth*this.builder.opts.zoom/2-11;o.style.display="flex",this.showPop(o,!1,i);const l=o.offsetWidth,d=o.offsetHeight;s-a>d?(a=a+i.offsetHeight*this.builder.opts.zoom-19,o.style.top=a+window.pageYOffset+27+"px",o.style.left=r-l/2+7+"px",e.removeClass(o,"arrow-bottom"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-top"),e.addClass(o,"center")):(o.style.top=a+window.pageYOffset-d-8+"px",o.style.left=r-l/2+7+"px",e.removeClass(o,"arrow-top"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-bottom"),e.addClass(o,"center")),o.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var o=this.builder.doc.createElement("div");o.innerHTML=t;for(var s,a,r=this.builder.doc.createDocumentFragment();s=o.firstChild;)a=r.appendChild(s);var l=r.firstChild;n.insertNode(r),a&&((n=n.cloneRange()).setStartAfter(a),e?n.setStartBefore(l):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var d=i.createRange();d.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",d),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var o=document.createRange();o.setStart(t,0),t.appendChild(o.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s))),s++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(t){let e=this.builder.colTool.columnTool,i=this.builder.activeCol;t?(e.style.transition="all 100ms ease",setTimeout((()=>{e.style.top=i.getBoundingClientRect().top-29+this.builder.win.pageYOffset+"px",e.style.left=i.getBoundingClientRect().left-1+"px",setTimeout((()=>{e.style.transition=""}),100)}),10)):(e.style.top=i.getBoundingClientRect().top-29+this.builder.win.pageYOffset+"px",e.style.left=i.getBoundingClientRect().left-1+"px")}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),o=(n>>16)+e;o>255?o=255:o<0&&(o=0);var s=(n>>8&255)+e;s>255?s=255:s<0&&(s=0);var a=(255&n)+e;return a>255?a=255:a<0&&(a=0),(i?"#":"")+String("000000"+(a|s<<8|o<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'<button class="style-helper"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <input type="text" class="style-helper-input" style="display:none;">\n <label class="style-helper-label" style="display:none;"></label>\n <input class="style-helper-checkbox" type="checkbox" style="display:none;">\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" style="display:none;"><option value=""></option></select>\n ');const t=this.builder.builderStuff.querySelector(".style-helper"),e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-label"),n=this.builder.builderStuff.querySelector(".style-helper-select"),o=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=this.getUIStyleValue(t,"modal-color","background-color"),this.builder.styleModalBackground=this.getUIStyleValue(t,"modal-background","background-color"),this.builder.styleButtonPickColorBorder=this.getUIStyleValue(t,"button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=this.getUIStyleValue(t,"button-pickcolor-background","background-color"),this.builder.styleToolBackground=window.getComputedStyle(t,null).getPropertyValue("background-color"),this.builder.styleButtonColor=window.getComputedStyle(t,null).getPropertyValue("color"),this.builder.styleButtonSvgFill=window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill"),this.builder.styleButtonBackgroundHover=this.getUIStyleValue(t,"hover","background-color"),this.builder.styleSnippetColor=this.getUIStyleValue(t,"snippet-color","background-color"),this.builder.styleSnippetBackground=this.getUIStyleValue(t,"snippet-background","background-color"),this.builder.styleSnippetTabsBackground=this.getUIStyleValue(t,"snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=this.getUIStyleValue(t,"snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=this.getUIStyleValue(t,"snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=this.getUIStyleValue(t,"snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=this.getUIStyleValue(t,"snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=this.getUIStyleValue(t,"snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=this.getUIStyleValue(t,"snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=this.getUIStyleValue(t,"snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=this.getUIStyleValue(t,"snippet-more-item-color","background-color"),this.builder.styleTabsBackground=this.getUIStyleValue(t,"tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=this.getUIStyleValue(t,"tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=this.getUIStyleValue(t,"tab-item-color","background-color"),this.builder.styleTabsMoreBackground=this.getUIStyleValue(t,"tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=this.getUIStyleValue(t,"tabs-more-border","border"),this.builder.styleTabsMoreItemColor=this.getUIStyleValue(t,"tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=this.getUIStyleValue(t,"tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=this.getUIStyleValue(t,"separator-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(n.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleLabelColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(o,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(o,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(o,"hover","background-color"),this.builder.styleOutlineColor=this.getUIStyleValue(t,"outline-color","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let o=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),o}getFontFamilyStyle(t){return`\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n `}refreshFontFamilyStyle1(){let t=this.builder.rte.rteFontFamilyOptions.querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}refreshFontFamilyStyle2(){let t=this.builder.builderStuff.querySelector(".is-modal.pickfontfamily").querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(!0),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}getFontPreview(){let t=this.builder.fontAssetPath,e="";return e=`\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${t}arial.png"></li>\n\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${t}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${t}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${t}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${t}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${t}serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abel, sans-serif"><div></div><img src="${t}abel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abril Fatface"><div></div><img src="${t}abril_fatface.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Advent Pro, sans-serif" data-font-style="300"><div></div><img src="${t}advent_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aladin, cursive"><div></div><img src="${t}aladin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya, serif" data-font-style="400,400i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}alegreya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya Sans SC, sans-serif" data-font-style="300,700"><div></div><img src="${t}alegreya_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya SC, serif" data-font-style="400,400i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}alegreya_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alice, serif"><div></div><img src="${t}alice.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allerta Stencil, sans-serif"><div></div><img src="${t}allerta_stencil.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allura, cursive"><div></div><img src="${t}allura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Almendra Display, cursive"><div></div><img src="${t}almendra_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Amatic SC, cursive" data-font-style="400,700"><div></div><img src="${t}amatic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Andika, sans-serif"><div></div><img src="${t}andika.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anonymous Pro, monospace" data-font-style="400,400i,700,700i"><div></div><img src="${t}anonymous_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Architects Daughter, cursive"><div></div><img style="transform:scale(1.1);" src="${t}architects_daughter.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arimo, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}arimo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arsenal, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}arsenal.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Assistant" data-font-style="300,700"><div></div><img src="${t}assistant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aubrey, cursive"><div></div><img src="${t}aubrey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anton, sans-serif"><div></div><img src="${t}anton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Archivo Narrow, sans-serif"><div></div><img src="${t}archivo_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bad Script, cursive"><div></div><img src="${t}bad_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="BenchNine, sans-serif"><div></div><img src="${t}benchNine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bevan, cursive"><div></div><img src="${t}bevan.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bigelow Rules, cursive"><div></div><img src="${t}bigelow_rules.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bilbo, cursive"><div></div><img src="${t}bilbo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bonbon, cursive"><div></div><img src="${t}bonbon.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bowlby One SC, cursive"><div></div><img src="${t}bowlby_one_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cabin Condensed, sans-serif"><div></div><img src="${t}cabin_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Carrois Gothic SC, sans-serif"><div></div><img src="${t}carrois_gothic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Caveat, cursive" data-font-style="400,700"><div></div><img src="${t}caveat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Chewy, cursive"><div></div><img src="${t}chewy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cinzel, serif"><div></div><img src="${t}cinzel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Comfortaa, cursive" data-font-style="300"><div></div><img src="${t}comfortaa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Concert One, cursive"><div></div><img src="${t}concert_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant, serif" data-font-style="300,300i,600,600i,700,700i"><div></div><img src="${t}cormorant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Garamond, serif" data-font-style="300,300i,600,600i,700,700i"><div></div><img src="${t}cormorant_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Infant, serif" data-font-style="300,300i,600,600i,700,700i"><div></div><img src="${t}cormorant_infant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant SC, serif" data-font-style="300,600,700"><div></div><img src="${t}cormorant_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Unicase, serif" data-font-style="300,600,700"><div></div><img src="${t}cormorant_unicase.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cousine" data-font-style="400,700"><div></div><img src="${t}cousine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Crafty Girls, cursive"><div></div><img src="${t}crafty_girls.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cuprum, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}cuprum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cutive Mono, monospace"><div></div><img src="${t}cutive_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Devonshire, cursive"><div></div><img src="${t}devonshire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Didact Gothic, sans-serif"><div></div><img src="${t}didact_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Diplomata SC, cursive"><div></div><img src="${t}diplomata_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Dosis, sans-serif" data-font-style="200"><div></div><img src="${t}dosis.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="EB Garamond, serif" data-font-style="400,400i,600,600i,700,700i,800,800i"><div></div><img src="${t}eb_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="El Messiri, sans-serif" data-font-style="400,600,700"><div></div><img src="${t}el_messiri.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Elsie, cursive" data-font-style="400,900"><div></div><img src="${t}elsie.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Encode Sans, sans-serif" data-font-style="300,700"><div></div><img src="${t}encode_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Exo, sans-serif" data-font-style="100"><div></div><img src="${t}exo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Exo 2', sans-serif" data-font-style="200,200i,600,600i,700,700i,800,800i,900,900i" data-font-display="swap"><div></div><img src="${t}exo_2.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Felipa, cursive"><div></div><img src="${t}felipa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Code, monospace" data-font-style="300,500,600,700"><div></div><img src="${t}fira_code.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Mono, monospace" data-font-style="400,500,700"><div></div><img src="${t}fira_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans, sans-serif" data-font-style="200,200i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}fira_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Condensed, sans-serif" data-font-style="200,200i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}fira_sans_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Extra Condensed, sans-serif" data-font-style="200,200i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}fira_sans_extra_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fjalla One, sans-serif"><div></div><img src="${t}fjalla_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Forum, cursive"><div></div><img src="${t}forum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Frank Ruhl Libre" data-font-style="300,700"><div></div><img src="${t}frank_ruhl_libre.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fredericka the Great, cursive"><div></div><img src="${t}fredericka_the_great.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gabriela, serif"><div></div><img src="${t}gabriela.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gilda Display, serif"><div></div><img src="${t}gilda_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Give You Glory, cursive"><div></div><img style="transform:scale(1.3);" src="${t}give_you_glory.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gruppo, cursive"><div></div><img src="${t}gruppo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Handlee, cursive"><div></div><img src="${t}handlee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Happy Monkey, cursive"><div></div><img src="${t}happy_monkey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Hind" data-font-style="300,700"><div></div><img src="${t}hind.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Mono, monospace" data-font-style="300,300i,500,500i,600,600i,700,700i"><div></div><img src="${t}ibm_plex_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Sans, sans-serif" data-font-style="300,300i,500,500i,600,600i,700,700i"><div></div><img src="${t}ibm_plex_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Serif, serif" data-font-style="300,300i,500,500i,600,600i,700,700i"><div></div><img src="${t}ibm_plex_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Iceland, cursive"><div></div><img src="${t}iceland.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Inconsolata, monospace" data-font-style="400,700"><div></div><img src="${t}inconsolata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Josefin Sans, sans-serif" data-font-style="300,700"><div></div><img src="${t}josefin_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Istok Web, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}istok_web.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julee, cursive"><div></div><img src="${t}julee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julius Sans One, sans-serif"><div></div><img src="${t}julius_sans_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Junge, serif"><div></div><img src="${t}junge.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Jura, sans-serif" data-font-style="300,600,700"><div></div><img src="${t}jura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Just Me Again Down Here, cursive"><div></div><img style="transform:scale(1.1);" src="${t}just_me_again_down_here.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kaushan Script, cursive"><div></div><img src="${t}kaushan_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kelly Slab, cursive"><div></div><img src="${t}kelly_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kite One, sans-serif"><div></div><img src="${t}kite_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi, sans-serif"><div></div><img src="${t}kosugi.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi Maru, sans-serif"><div></div><img src="${t}kosugi_maru.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kurale, serif"><div></div><img src="${t}kurale.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lato, sans-serif" data-font-style="300,700"><div></div><img src="${t}lato.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ledger, serif" data-font-style="300,700" data-font-display="swap"><div></div><img src="${t}ledger.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lekton, sans-serif" data-font-style="400,700"><div></div><img src="${t}lekton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Life Savers, cursive"><div></div><img src="${t}life_savers.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Literata, serif" data-font-style="400,400i,600,600i,700,700i"><div></div><img src="${t}literata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster, cursive"><div></div><img src="${t}lobster.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster Two, cursive"><div></div><img src="${t}lobster_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Londrina Shadow, cursive"><div></div><img src="${t}londrina_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lora, serif" data-font-style="400,700"><div></div><img src="${t}lora.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lovers Quarrel, cursive"><div></div><img style="transform:scale(1.1);" src="${t}lovers_quarrel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS 1p', sans-serif" data-font-style="300,500,700,800,900" data-font-display="swap"><div></div><img src="${t}m_plus_1p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS Rounded 1c', sans-serif" data-font-style="300,500,700,800,900" data-font-display="swap"><div></div><img src="${t}m_plus_rounded_1c.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Macondo, cursive"><div></div><img src="${t}macondo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marcellus SC, serif"><div></div><img src="${t}marcellus_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marck Script, cursive"><div></div><img src="${t}marck_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Martel, serif" data-font-style="300,700"><div></div><img src="${t}martel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Maven Pro, sans-serif"><div></div><img src="${t}maven_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather, serif" data-font-style="300,700"><div></div><img src="${t}merriweather.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather Sans" data-font-style="300,700"><div></div><img src="${t}merriweather_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Mogra, cursive"><div></div><img src="${t}mogra.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Monoton, cursive"><div></div><img src="${t}monoton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montez, cursive"><div></div><img src="${t}montez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat, sans-serif" data-font-style="300,400,700"><div></div><img src="${t}montserrat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Alternates, sans-serif" data-font-style="300,300i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}montserrat_alternates.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Subrayada, sans-serif"><div></div><img src="${t}montserrat_subrayada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neucha, cursive"><div></div><img src="${t}neucha.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neuton, serif" data-font-style="200,700"><div></div><img src="${t}neuton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nixie One, cursive"><div></div><img src="${t}nixie_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nothing You Could Do, cursive"><div></div><img style="transform:scale(1.1);" src="${t}nothing_you_could_do.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}noto_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans SC, sans-serif" data-font-style="300,500,700,900"><div></div><img src="${t}noto_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif, serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}noto_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif TC, serif" data-font-style="300,600,700,900"><div></div><img src="${t}noto_serif_tc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nunito, sans-serif" data-font-style="200,200i,600,600i,700,700i,800,800i,900,900i"><div></div><img src="${t}nunito.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Old Standard TT, serif" data-font-style="400,400i,700"><div></div><img src="${t}old_standard_tt.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans, sans-serif" data-font-style="300,400,600,800"><div></div><img src="${t}open_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans Condensed, sans-serif" data-font-style="300,300i,700"><div></div><img src="${t}open_sans_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oranienbaum, serif"><div></div><img src="${t}oranienbaum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oswald, sans-serif" data-font-style="300,400,700"><div></div><img src="${t}oswald.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oxygen, sans-serif" data-font-style="300,700"><div></div><img src="${t}oxygen.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pacifico, cursive"><div></div><img src="${t}pacifico.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pangolin, cursive"><div></div><img src="${t}pangolin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Passion One, cursive"><div></div><img src="${t}passion_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pathway Gothic One, sans-serif"><div></div><img src="${t}pathway_gothic_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pattaya, sans-serif"><div></div><img src="${t}pattaya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Petit Formal Script, cursive"><div></div><img style="transform:scale(1.1);" src="${t}petit_formal_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Philosopher, sans-serif"><div></div><img src="${t}philosopher.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Play, sans-serif" data-font-style="400,700"><div></div><img src="${t}play.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display, serif" data-font-style="400,400i,700,700i,900,900i"><div></div><img src="${t}playfair_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display SC, serif" data-font-style="400,400i,700,700i,900,900i"><div></div><img src="${t}playfair_display_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Podkova, serif" data-font-style="400,600,700,800"><div></div><img src="${t}podkova.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Poiret One, cursive"><div></div><img src="${t}poiret_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pompiere, cursive"><div></div><img style="transform:scale(1.1);" src="${t}pompiere.png"></li>\n `,e+=`<li role="option" tabindex="0" data-provider="google" data-font-family="Poppins, sans-serif" data-font-style="400,600"><div></div><img src="${t}poppins.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prata, serif"><div></div><img src="${t}prata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Press Start 2P', cursive" data-font-display="swap"><div></div><img src="${t}press_start_2p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prosto One, cursive"><div></div><img src="${t}prosto_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Mono, monospace"><div></div><img src="${t}pt_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}pt_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Caption, sans-serif" data-font-style="400,700"><div></div><img src="${t}pt_sans_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Narrow, sans-serif" data-font-style="400,700"><div></div><img src="${t}pt_sans_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif, serif" data-font-style="400,700"><div></div><img src="${t}pt_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif Caption, serif" data-font-style="400,700"><div></div><img src="${t}pt_serif_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento Sans, sans-serif"><div></div><img src="${t}quattrocento_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento, serif"><div></div><img src="${t}quattrocento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quicksand, sans-serif"><div></div><img src="${t}quicksand.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Qwigley, cursive"><div></div><img src="${t}qwigley.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway, sans-serif" data-font-style="100"><div></div><img src="${t}raleway.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway Dots, sans-serif"><div></div><img src="${t}raleway_dots.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Redressed, cursive"><div></div><img src="${t}redressed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ribeye Marrow, cursive"><div></div><img src="${t}ribeye_marrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Righteous, cursive"><div></div><img src="${t}righteous.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto, sans-serif" data-font-style="300"><div></div><img src="${t}roboto.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Condensed, sans-serif" data-font-style="300,300i,700,700i"><div></div><img src="${t}roboto_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Mono, monospace" data-font-style="300,700"><div></div><img src="${t}roboto_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Slab, serif" data-font-style="200,600,700,800,900"><div></div><img src="${t}roboto_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rochester, cursive"><div></div><img src="${t}rochester.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rouge Script, cursive"><div></div><img src="${t}rouge_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik, sans-serif" data-font-style="300,300i,500,500i,700,700i,900,900i"><div></div><img src="${t}rubik.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik Mono One, sans-serif"><div></div><img src="${t}rubik_mono_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ruslan Display, cursive"><div></div><img src="${t}ruslan_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Russo One, sans-serif"><div></div><img src="${t}russo_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sacramento, cursive"><div></div><img src="${t}sacramento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sanchez, serif"><div></div><img src="${t}sanchez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Satisfy, cursive"><div></div><img src="${t}satisfy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sawarabi Gothic, sans-serif"><div></div><img src="${t}sawarabi_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Scada, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}scada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seaweed Script, cursive"><div></div><img src="${t}seaweed_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seymour One, sans-serif"><div></div><img src="${t}seymour_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Shadows Into Light Two, cursive"><div></div><img src="${t}shadows_into_light_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Six Caps, sans-serif"><div></div><img src="${t}six_caps.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Snowburst One, cursive"><div></div><img src="${t}snowburst_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Code Pro, monospace" data-font-style="300,700"><div></div><img src="${t}source_code_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Sans Pro, sans-serif" data-font-style="200"><div></div><img src="${t}source_sans_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Special Elite, cursive"><div></div><img src="${t}special_elite.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral, serif" data-font-style="200,200i,600,600i,700,700i,800,800i"><div></div><img src="${t}spectral.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral SC, serif" data-font-style="300,300i,600,600i,700,700i,800,800i"><div></div><img src="${t}spectral_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Squada One, cursive"><div></div><img src="${t}squada_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stalinist One, cursive"><div></div><img src="${t}stalinist_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stint Ultra Expanded, cursive"><div></div><img src="${t}stint_ultra_expanded.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Syncopate, sans-serif"><div></div><img src="${t}syncopate.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tangerine, cursive"><div></div><img src="${t}tangerine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tenor Sans, sans-serif"><div></div><img src="${t}tenor_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tinos, serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}tinos.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu, sans-serif" data-font-style="300,300i,500,500i,700,700i"><div></div><img src="${t}ubuntu.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Condensed, sans-serif"><div></div><img src="${t}ubuntu_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Mono, monospace" data-font-style="400,700"><div></div><img src="${t}ubuntu_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Underdog, cursive"><div></div><img src="${t}underdog.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="UnifrakturMaguntia, cursive"><div></div><img src="${t}unifrakturmaguntia.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vast Shadow, cursive"><div></div><img src="${t}vast_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Viga, sans-serif"><div></div><img src="${t}viga.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn, serif" data-font-style="400,400i,600,600i,700,700i,900,900i"><div></div><img src="${t}vollkorn.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn SC, serif" data-font-style="400,600,700,900"><div></div><img src="${t}vollkorn_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Voltaire, sans-serif"><div></div><img src="${t}voltaire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Wire One, sans-serif"><div></div><img src="${t}wire_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yanone Kaffeesatz, sans-serif" data-font-style="300,700"><div></div><img src="${t}yanone_kaffeesatz.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yeseva One, cursive"><div></div><img src="${t}yeseva_one.png"></li>\n `,e}getFontFamilyHTML(t){return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style id="mainstyle">\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n ${this.getFontPreview()}\n </ul>\n\n <script type="text/javascript">\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.rte-fontfamily-options.active, .pickfontfamily.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}getFontFamilyEmail(t){let e=this.builder.fontAssetPath;return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style>\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${e}arial.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${e}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${e}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${e}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${e}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${e}serif.png"></li>\n </ul>\n\n <script type="text/javascript">\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.is-rte-pop.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}}class si{constructor(t){this.builder=t}getScale(t){let e=window.getComputedStyle(t).transform.split("(")[1];e=e.split(")")[0],e=e.split(",");let i=e[0],n=e[1];return Math.sqrt(i*i+n*n)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,o,s,a=e.split(" ");for(i=0,o=a.length;i<o;++i){if(!a[i])continue;let e=a[i],o="",r=t.className.split(" ");for(n=0,s=r.length;n<s;++n)r[n]&&r[n]!==e&&(o+=r[n]+" ");t.className=o.trim()}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let o=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(o,e)){let s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,{get:function(){return s.get.apply(this,arguments)},set:function(){let t=this[e];s.set.apply(this,arguments);let o=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,o),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelection();if(!n)return;const o=n.anchorNode;if(o){const l=o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE?o:o.parentElement,d=l&&l.innerText===n.toString();let c,u=!1;for(var s=[],a=ni.getSelection(),r=0;r<a.rangeCount;++r)s=s.concat(a.getRangeAt(r).getNodes());const p=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(s.forEach((t=>{if(t.tagName){const e=t.tagName.toLowerCase();-1!==p.indexOf(e)&&(u=!0,i(!0,t))}})),u)return;c=d||""===n.toString().trim()?this.updateSelection(t,e,l):this.replaceSelection(t,e,n,l),i&&i(!0,c)}else i&&i(!1)}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const o=i.getRangeAt(0),s=o.extractContents(),a=this.createSpan(n,t,e);return a.appendChild(s),this.cleanChildren(t,a),this.cleanUnusedSpan(a),o.insertNode(a),i.selectAllChildren(a),this.checkStyleIfSameAsParent(a,t),a}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,o=this.findParentStyle(t,e);if(o&&(n=o.style[e]),i===n){t.style[e]="";let o=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=o}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const o=this.getSelection();if(!o)return;const s=o.anchorNode;if(s){let d=s.nodeType!==Node.TEXT_NODE&&s.nodeType!==Node.COMMENT_NODE?s:s.parentElement;const c=d&&d.innerText===o.toString();let u=!1;for(var a=[],r=ni.getSelection(),l=0;l<r.rangeCount;++l)a=a.concat(r.getRangeAt(l).getNodes());const p=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(a.forEach((i=>{if(i.tagName){const n=i.tagName.toLowerCase();if(-1!==p.indexOf(n)){u=!0;for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}}})),u)return;(i||c||""===o.toString().trim())&&("block"===n&&"inline"===this.getStyle(d,"display")&&(d=this.getParentBlock(d)),this.updateSelectionClass(t,e,d))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}execCommandToggle(t,e,i){const n=this.getSelection();if(!n)return;const o=n.anchorNode;if(o){const l=o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE?o:o.parentElement,d=l&&l.innerText===n.toString();let c=!1;for(var s=[],a=ni.getSelection(),r=0;r<a.rangeCount;++r)s=s.concat(a.getRangeAt(r).getNodes());const u=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(s.forEach((n=>{if(n.tagName){const o=n.tagName.toLowerCase();if(-1!==u.indexOf(o)){if(c=!0,"fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)?t="uppercase":this.hasClass(n,i.textTransform.lowercase)?t="lowercase":this.hasClass(n,i.textTransform.capitalize)?t="capitalize":this.hasClass(n,i.textTransform.normal)&&(t="normal"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t?this.addClass(n,i.textTransform.uppercase):"uppercase"===t?this.addClass(n,i.textTransform.lowercase):"lowercase"===t?this.addClass(n,i.textTransform.capitalize):"capitalize"===t||"normal"===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}}})),c)return;d||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,l):this.replaceSelectionToggle(t,e,i,n,l)}}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)?t="uppercase":this.hasClass(n,i.textTransform.lowercase)?t="lowercase":this.hasClass(n,i.textTransform.capitalize)?t="capitalize":this.hasClass(n,i.textTransform.normal)&&(t="normal"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t?this.addClass(n,i.textTransform.uppercase):"uppercase"===t?this.addClass(n,i.textTransform.lowercase):"lowercase"===t?this.addClass(n,i.textTransform.capitalize):"capitalize"===t?this.addClass(n,i.textTransform.normal):"normal"===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,o){const s=n.getRangeAt(0),a=s.extractContents(),r=document.createElement("span");if("fontWeight"===t){let t=!1;o.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(o,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(o,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(r,i.fontWeight.defaultNormal):this.addClass(r,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;o.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(o,i.fontStyle.normal)&&(t=!1)),t?this.addClass(r,i.fontStyle.normal):this.addClass(r,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;o.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(r,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;o.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(r,i.textDecoration.linethrough)}if("textTransform"===t){let t="";o.closest(`.${i.textTransform.uppercase}`)?t="uppercase":o.closest(`.${i.textTransform.lowercase}`)?t="lowercase":o.closest(`.${i.textTransform.capitalize}`)?t="capitalize":o.closest(`.${i.textTransform.normal}`)&&(t="normal"),""===t?this.addClass(r,i.textTransform.uppercase):"uppercase"===t?this.addClass(r,i.textTransform.lowercase):"lowercase"===t?this.addClass(r,i.textTransform.capitalize):"capitalize"===t?this.addClass(r,i.textTransform.normal):"normal"===t&&this.addClass(r,i.textTransform.uppercase)}if("extend"===t){let t=!1;o.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(r,i.extend[e])}return r.appendChild(a),this.cleanChildrenToggle(t,e,r,i),this.cleanUnusedSpan(r),s.insertNode(r),n.selectAllChildren(r),r}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const o=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));o&&o.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let o=Array.prototype.filter.call(n,(t=>0===t.attributes.length));o&&o.length>0&&o.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}}var ai={exports:{}},ri={},li={exports:{}},di={},ci={};function ui(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function pi(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function hi(t,e){this.__indent_cache=new pi(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new ui(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}ui.prototype.clone_empty=function(){var t=new ui(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},ui.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},ui.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},ui.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},ui.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},ui.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},ui.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},ui.prototype.is_empty=function(){return 0===this.__items.length},ui.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},ui.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},ui.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},ui.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},ui.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},ui.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},ui.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},pi.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},pi.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},pi.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},pi.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},hi.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},hi.prototype.get_line_number=function(){return this.__lines.length},hi.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},hi.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},hi.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},hi.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},hi.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},hi.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},hi.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},hi.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},hi.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},hi.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},hi.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},hi.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},hi.prototype.just_added_newline=function(){return this.current_line.is_empty()},hi.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},hi.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new ui(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},ci.Output=hi;var gi={};gi.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var fi={};!function(t){var e="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",i="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",n="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+i+"])";t.identifier=new RegExp(o+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),t.identifierStart=new RegExp(o),t.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+e+i+n+"])+"),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")}(fi);var mi={},bi={};function vi(t,e){this.raw_options=yi(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function yi(t,e){var i,n={};for(i in t=_i(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function _i(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}vi.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},vi.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},vi.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},vi.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},vi.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},vi.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},vi.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},bi.Options=vi,bi.normalizeOpts=_i,bi.mergeOpts=yi;var xi=bi.Options,wi=["before-newline","after-newline","preserve-newline"];function Si(t){xi.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",wi),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}Si.prototype=new xi,mi.Options=Si;var Ci={},ki={},Ei=RegExp.prototype.hasOwnProperty("sticky");function Ai(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}Ai.prototype.restart=function(){this.__position=0},Ai.prototype.back=function(){this.__position>0&&(this.__position-=1)},Ai.prototype.hasNext=function(){return this.__position<this.__input_length},Ai.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},Ai.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},Ai.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||Ei&&t.sticky||i.index!==e&&(i=null),i},Ai.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},Ai.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},Ai.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},Ai.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},Ai.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},Ai.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},Ai.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&Ei&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},Ai.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},Ai.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},Ai.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},ki.InputScanner=Ai;var Li={},qi={};function Ti(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}Ti.prototype.restart=function(){this.__position=0},Ti.prototype.isEmpty=function(){return 0===this.__tokens_length},Ti.prototype.hasNext=function(){return this.__position<this.__tokens_length},Ti.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},Ti.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},Ti.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},qi.TokenStream=Ti;var Mi={},Ri={};function Oi(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}Oi.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},Oi.prototype.read_match=function(){return this._input.match(this._match_pattern)},Oi.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},Oi.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},Oi.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},Oi.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},Oi.prototype._create=function(){return new Oi(this._input,this)},Oi.prototype._update=function(){},Ri.Pattern=Oi;var Bi=Ri.Pattern;function Ni(t,e){Bi.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Ni.prototype=new Bi,Ni.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},Ni.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},Ni.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},Ni.prototype._create=function(){return new Ni(this._input,this)},Ni.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},Mi.WhitespacePattern=Ni;var Ii=ki.InputScanner,Di=gi.Token,Pi=qi.TokenStream,$i=Mi.WhitespacePattern,zi={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Hi=function(t,e){this._input=new Ii(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new $i(this._input)};Hi.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new Pi,this._reset();for(var e=new Di(zi.START,""),i=null,n=[],o=new Pi;e.type!==zi.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new Pi),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Hi.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Hi.prototype._reset=function(){},Hi.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(zi.RAW,i):this._create_token(zi.EOF,"")},Hi.prototype._is_comment=function(t){return!1},Hi.prototype._is_opening=function(t){return!1},Hi.prototype._is_closing=function(t,e){return!1},Hi.prototype._create_token=function(t,e){return new Di(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Hi.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Li.Tokenizer=Hi,Li.TOKEN=zi;var ji={};function Fi(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Fi.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Fi.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},ji.Directives=Fi;var Ui={},Wi=Ri.Pattern,Vi={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Gi(t,e){Wi.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Vi),this._excluded=Object.assign({},Vi),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new Wi(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Gi.prototype=new Wi,Gi.prototype._create=function(){return new Gi(this._input,this)},Gi.prototype._update=function(){this.__set_templated_pattern()},Gi.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Gi.prototype.read_options=function(t){var e=this._create();for(var i in Vi)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Gi.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Gi.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Gi.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Gi.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Ui.TemplatablePattern=Gi;var Xi=ki.InputScanner,Yi=Li.Tokenizer,Ki=Li.TOKEN,Zi=ji.Directives,Qi=fi,Ji=Ri.Pattern,tn=Ui.TemplatablePattern;function en(t,e){return-1!==e.indexOf(t)}var nn={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:Ki.START,RAW:Ki.RAW,EOF:Ki.EOF},on=new Zi(/\/\*/,/\*\//),sn=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,an=/[0-9]/,rn=/[^\d\.]/,ln=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),dn=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";dn=(dn="\\?\\.(?!\\d) "+(dn=dn.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var cn,un=new RegExp(dn),pn="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),hn=pn.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),gn=new RegExp("^(?:"+hn.join("|")+")$"),fn=function(t,e){Yi.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new Ji(this._input),n=new tn(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(Qi.identifier).matching(Qi.identifierMatch),number:i.matching(sn),punct:i.matching(un),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(Qi.lineBreak),shebang:i.starting_with(/#!/).until_after(Qi.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(fn.prototype=new Yi)._is_comment=function(t){return t.type===nn.COMMENT||t.type===nn.BLOCK_COMMENT||t.type===nn.UNKNOWN},fn.prototype._is_opening=function(t){return t.type===nn.START_BLOCK||t.type===nn.START_EXPR},fn.prototype._is_closing=function(t,e){return(t.type===nn.END_BLOCK||t.type===nn.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},fn.prototype._reset=function(){cn=!1},fn.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(nn.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(nn.UNKNOWN,this._input.next())},fn.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(Qi.allLineBreaks,"\n"),t.type!==nn.DOT&&(t.type!==nn.RESERVED||"set"!==t.text&&"get"!==t.text)&&gn.test(e)?"in"===e||"of"===e?this._create_token(nn.OPERATOR,e):this._create_token(nn.RESERVED,e):this._create_token(nn.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(nn.WORD,e):void 0},fn.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(nn.START_EXPR,t):")"===t||"]"===t?e=this._create_token(nn.END_EXPR,t):"{"===t?e=this._create_token(nn.START_BLOCK,t):"}"===t?e=this._create_token(nn.END_BLOCK,t):";"===t?e=this._create_token(nn.SEMICOLON,t):"."===t&&rn.test(this._input.peek(1))?e=this._create_token(nn.DOT,t):","===t&&(e=this._create_token(nn.COMMA,t)),e&&this._input.next(),e},fn.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(nn.EQUALS,t):"?."===t?this._create_token(nn.DOT,t):this._create_token(nn.OPERATOR,t)},fn.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(nn.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(nn.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(an)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(nn.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(Qi.newline);)e+=this._input.next();return cn=!0,this._create_token(nn.COMMENT,e)}}else if(cn&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return cn=!1,this._create_token(nn.COMMENT,e);return null},fn.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=on.get_directives(i);n&&"start"===n.ignore&&(i+=on.readIgnored(this._input)),i=i.replace(Qi.allLineBreaks,"\n"),(e=this._create_token(nn.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(nn.COMMENT,i))}return e},fn.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new Xi(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Qi.allLineBreaks,"\n"),this._create_token(nn.STRING,e)}return null},fn.prototype._allow_regexp_or_xml=function(t){return t.type===nn.RESERVED&&en(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===nn.END_EXPR&&")"===t.text&&t.opened.previous.type===nn.RESERVED&&en(t.opened.previous.text,["if","while","for"])||en(t.type,[nn.COMMENT,nn.START_EXPR,nn.START_BLOCK,nn.START,nn.END_BLOCK,nn.OPERATOR,nn.EQUALS,nn.EOF,nn.SEMICOLON,nn.COMMA])},fn.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(Qi.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(Qi.identifier)),this._create_token(nn.STRING,i)}return null},fn.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),a=0;n;){var r=!!n[1],l=n[2];if(!(!!n[n.length-1]||"![CDATA["===l.slice(0,8))&&(l===o||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(r?--a:++a),i+=n[0],a<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(Qi.allLineBreaks,"\n"),this._create_token(nn.STRING,i)}}return null},fn.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),a="";this._input.hasNext();){if((a=this._input.next())===t||!e&&Qi.newline.test(a)){this._input.back();break}"\\"===a&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),a+=this._input.next()):i&&("${"===i&&"$"===a&&"{"===this._input.peek()&&(a+=this._input.next()),i===a&&(a+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next()))),s+=a+=o.read()}return s},Ci.Tokenizer=fn,Ci.TOKEN=nn,Ci.positionable_operators=ln.slice(),Ci.line_starters=pn.slice();var mn=ci.Output,bn=gi.Token,vn=fi,yn=mi.Options,_n=Ci.Tokenizer,xn=Ci.line_starters,wn=Ci.positionable_operators,Sn=Ci.TOKEN;function Cn(t,e){return-1!==e.indexOf(t)}function kn(t,e){return t&&t.type===Sn.RESERVED&&t.text===e}function En(t,e){return t&&t.type===Sn.RESERVED&&Cn(t.text,e)}var An=["case","return","do","if","throw","else","await","break","continue","async"],Ln=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),qn=[Ln.before_newline,Ln.preserve_newline],Tn="BlockStatement",Mn="Statement",Rn="ObjectLiteral",On="ArrayLiteral",Bn="ForInitializer",Nn="Conditional",In="Expression";function Dn(t,e){e.multiline_frame||e.mode===Bn||e.mode===Nn||t.remove_indent(e.start_line_index)}function Pn(t){return t===On}function $n(t){return Cn(t,[In,Bn,Nn])}function zn(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new yn(e)}zn.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new bn(Sn.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},zn.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new mn(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Tn);var i=new _n(t,this._options);return this._tokens=i.tokenize(),t},zn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&vn.lineBreak.test(t||"")&&(e=t.match(vn.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},zn.prototype.handle_token=function(t,e){t.type===Sn.START_EXPR?this.handle_start_expr(t):t.type===Sn.END_EXPR?this.handle_end_expr(t):t.type===Sn.START_BLOCK?this.handle_start_block(t):t.type===Sn.END_BLOCK?this.handle_end_block(t):t.type===Sn.WORD||t.type===Sn.RESERVED?this.handle_word(t):t.type===Sn.SEMICOLON?this.handle_semicolon(t):t.type===Sn.STRING?this.handle_string(t):t.type===Sn.EQUALS?this.handle_equals(t):t.type===Sn.OPERATOR?this.handle_operator(t):t.type===Sn.COMMA?this.handle_comma(t):t.type===Sn.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===Sn.COMMENT?this.handle_comment(t,e):t.type===Sn.DOT?this.handle_dot(t):t.type===Sn.EOF?this.handle_eof(t):(t.type,Sn.UNKNOWN,this.handle_unknown(t,e))},zn.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&Pn(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var a=1;a<i;a+=1)this.print_newline(!0,e)}};var Hn=["async","break","continue","return","throw","yield"];zn.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(Cn(this._flags.last_token.text,wn)||Cn(t.text,wn)){var n=Cn(this._flags.last_token.text,wn)&&Cn(this._options.operator_position,qn)||Cn(t.text,wn);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(En(this._flags.last_token,Hn))return;this._output.set_wrap_point()}}},zn.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==Sn.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==Mn||this._flags.if_block&&kn(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},zn.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||Pn(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},zn.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===Sn.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},zn.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},zn.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},zn.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},zn.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Mn&&Dn(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},zn.prototype.start_of_object_property=function(){return this._flags.parent.mode===Rn&&this._flags.mode===Mn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||En(this._flags.last_token,["get","set"]))},zn.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||En(this._flags.last_token,["var","let","const"])&&t.type===Sn.WORD)||kn(this._flags.last_token,"do"))||!(this._flags.parent.mode===Rn&&this._flags.mode===Mn)&&En(this._flags.last_token,Hn)&&!t.newlines)||kn(this._flags.last_token,"else")&&!(kn(t,"if")&&!t.comments_before))||this._flags.last_token.type===Sn.END_EXPR&&(this._previous_flags.mode===Bn||this._previous_flags.mode===Nn))||this._flags.last_token.type===Sn.WORD&&this._flags.mode===Tn&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==Sn.WORD&&t.type!==Sn.RESERVED)||this._flags.mode===Rn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||En(this._flags.last_token,["get","set"])))&&(this.set_mode(Mn),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,En(t,["do","for","if","while"])),!0)},zn.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=In;if("["===t.text){if(this._flags.last_token.type===Sn.WORD||")"===this._flags.last_token.text)return En(this._flags.last_token,xn)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=On,Pn(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),Cn(this._flags.last_token.type,[Sn.START_EXPR,Sn.END_EXPR,Sn.WORD,Sn.OPERATOR,Sn.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Sn.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Bn):Cn(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Nn):Cn(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(Cn(this._flags.last_token.text,xn)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Sn.EQUALS||this._flags.last_token.type===Sn.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===Sn.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);En(i,["async","function"])||"*"===i.text&&En(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Rn&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===Sn.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(Cn(this._last_last_text,["function","yield"])||this._flags.mode===Rn&&Cn(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===Sn.START_BLOCK?this.print_newline():this._flags.last_token.type!==Sn.END_EXPR&&this._flags.last_token.type!==Sn.START_EXPR&&this._flags.last_token.type!==Sn.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==Sn.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},zn.prototype.handle_end_expr=function(t){for(;this._flags.mode===Mn;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&Pn(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==Sn.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),Dn(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Nn&&(this._previous_flags.mode=In,this._flags.do_block=!1,this._flags.do_while=!1)},zn.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===Sn.END_EXPR?(this.set_mode(Tn),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Tn):i&&(Cn(i.text,[":",","])&&Cn(e.type,[Sn.STRING,Sn.WORD,Sn.RESERVED])||Cn(e.text,["get","set","..."])&&Cn(i.type,[Sn.WORD,Sn.RESERVED]))?Cn(this._last_last_text,["class","interface"])?this.set_mode(Tn):this.set_mode(Rn):this._flags.last_token.type===Sn.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(Tn):Cn(this._flags.last_token.type,[Sn.EQUALS,Sn.START_EXPR,Sn.COMMA,Sn.OPERATOR])||En(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Rn):this.set_mode(Tn);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===Sn.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do{if(s+=1,(a=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==Sn.EOF&&(a.type!==Sn.END_BLOCK||a.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Sn.OPERATOR&&(o||this._flags.last_token.type===Sn.EQUALS||En(this._flags.last_token,An)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!Pn(this._previous_flags.mode)||this._flags.last_token.type!==Sn.START_EXPR&&this._flags.last_token.type!==Sn.COMMA||((this._flags.last_token.type===Sn.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Sn.COMMA||this._flags.last_token.type===Sn.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Sn.OPERATOR&&this._flags.last_token.type!==Sn.START_EXPR&&(this._flags.last_token.type!==Sn.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},zn.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===Mn;)this.restore_mode();var e=this._flags.last_token.type===Sn.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(Pn(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},zn.prototype.handle_word=function(t){if(t.type===Sn.RESERVED)if(Cn(t.text,["set","get"])&&this._flags.mode!==Rn)t.type=Sn.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=Sn.WORD;else if(Cn(t.text,["as","from"])&&!this._flags.import_block)t.type=Sn.WORD;else if(this._flags.mode===Rn){":"===this._tokens.peek().text&&(t.type=Sn.WORD)}if(this.start_of_statement(t)?En(this._flags.last_token,["var","let","const"])&&t.type===Sn.WORD&&(this._flags.declaration_statement=!0):!t.newlines||$n(this._flags.mode)||this._flags.last_token.type===Sn.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===Sn.EQUALS||!this._options.preserve_newlines&&En(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(kn(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&kn(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Mn;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&En(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==Sn.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==Sn.COMMA&&this._flags.last_token.type!==Sn.START_EXPR&&this._flags.last_token.type!==Sn.EQUALS&&this._flags.last_token.type!==Sn.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),kn(t,"function"))return(Cn(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!Cn(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==Sn.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===Sn.RESERVED||this._flags.last_token.type===Sn.WORD?En(this._flags.last_token,["get","set","new","export"])||En(this._flags.last_token,Hn)||kn(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Sn.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!$n(this._flags.mode)&&!Pn(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===Sn.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":En(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===Sn.SEMICOLON&&this._flags.mode===Tn?e="NEWLINE":this._flags.last_token.type===Sn.SEMICOLON&&$n(this._flags.mode)?e="SPACE":this._flags.last_token.type===Sn.STRING?e="NEWLINE":this._flags.last_token.type===Sn.RESERVED||this._flags.last_token.type===Sn.WORD||"*"===this._flags.last_token.text&&(Cn(this._last_last_text,["function","yield"])||this._flags.mode===Rn&&Cn(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===Sn.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===Sn.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),En(t,xn)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),En(t,["else","catch","finally"]))?(this._flags.last_token.type!==Sn.END_BLOCK||this._previous_flags.mode!==Tn||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?En(this._flags.last_token,An)||"declare"===this._flags.last_token.text&&En(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Sn.END_EXPR?this._flags.last_token.type===Sn.START_EXPR&&En(t,["var","let","const"])||":"===this._flags.last_token.text||(kn(t,"if")&&kn(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):En(t,xn)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&Pn(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==Sn.WORD&&t.previous.type!==Sn.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===Sn.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&kn(t,"from")&&(this._flags.import_block=!1))},zn.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==Mn||this._flags.if_block&&kn(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},zn.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==Sn.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===Sn.RESERVED||this._flags.last_token.type===Sn.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Sn.COMMA||this._flags.last_token.type===Sn.START_EXPR||this._flags.last_token.type===Sn.EQUALS||this._flags.last_token.type===Sn.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==Sn.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},zn.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},zn.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?($n(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===Rn||this._flags.mode===Mn&&this._flags.parent.mode===Rn?(this._flags.mode===Mn&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},zn.prototype.handle_operator=function(t){var e="*"===t.text&&(En(this._flags.last_token,["function","yield"])||Cn(this._flags.last_token.type,[Sn.START_BLOCK,Sn.COMMA,Sn.END_BLOCK,Sn.SEMICOLON])),i=Cn(t.text,["-","+"])&&(Cn(this._flags.last_token.type,[Sn.START_BLOCK,Sn.START_EXPR,Sn.EQUALS,Sn.OPERATOR])||Cn(this._flags.last_token.text,xn)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(En(this._flags.last_token,An))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==Sn.DOT)if("::"!==t.text){if(this._flags.last_token.type===Sn.OPERATOR&&Cn(this._options.operator_position,qn)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==Sn.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var o=!0,s=!0,a=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,a=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&Cn(t.text,wn)){var r=":"===t.text,l=r&&a,d=r&&!a;switch(this._options.operator_position){case Ln.before_newline:return this._output.space_before_token=!d,this.print_token(t),r&&!l||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case Ln.after_newline:return this._output.space_before_token=!0,!r||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case Ln.preserve_newline:return d||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||d),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var c=this._tokens.peek();s=c&&Cn(c.type,[Sn.WORD,Sn.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===Sn.START_BLOCK,s=!1):(Cn(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==Sn.COMMA&&this._flags.last_token.type!==Sn.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&$n(this._flags.mode)&&(o=!0),this._flags.last_token.type===Sn.RESERVED?o=!0:this._flags.last_token.type===Sn.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===Sn.OPERATOR&&(o=Cn(t.text,["--","-","++","+"])&&Cn(this._flags.last_token.text,["--","-","++","+"]),Cn(t.text,["+","-"])&&Cn(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==Tn||this._flags.inline_frame)&&this._flags.mode!==Mn||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},zn.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):vn.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},zn.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(vn.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,a=t.whitespace_before,r=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,a),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(r))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},zn.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},zn.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),En(this._flags.last_token,An)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},zn.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},zn.prototype.handle_eof=function(t){for(;this._flags.mode===Mn;)this.restore_mode();this.handle_whitespace_and_comments(t)},di.Beautifier=zn;var jn=di.Beautifier,Fn=mi.Options;li.exports=function(t,e){return new jn(t,e).beautify()},li.exports.defaultOptions=function(){return new Fn};var Un={exports:{}},Wn={},Vn={},Gn=bi.Options;function Xn(t){Gn.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Xn.prototype=new Gn,Vn.Options=Xn;var Yn=Vn.Options,Kn=ci.Output,Zn=ki.InputScanner,Qn=new(0,ji.Directives)(/\/\*/,/\*\//),Jn=/\r\n|[\r\n]/,to=/\r\n|[\r\n]/g,eo=/\s/,io=/(?:\s|\n)+/g,no=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,oo=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function so(t,e){this._source_text=t||"",this._options=new Yn(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}so.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},so.prototype.eatWhitespace=function(t){for(var e=eo.test(this._input.peek()),i=0;eo.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},so.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},so.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},so.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},so.prototype.indent=function(){this._indentLevel++},so.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},so.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&Jn.test(t||"")&&(e=t.match(Jn)[0]));var i=(t=t.replace(to,"\n")).match(/^[\t ]*/)[0];this._output=new Kn(this._options,i),this._input=new Zn(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,a=!1,r=!1,l=!1,d=!1,c=!1,u=this._ch;n=""!==this._input.read(io),o=u,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var p=this._input.read(no),h=Qn.get_directives(p);h&&"start"===h.ignore&&(p+=Qn.readIgnored(this._input)),this.print_string(p),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(oo)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var g=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);g.match(/[ :]$/)&&(g=this.eatString(": ").replace(/\s$/,""),this.print_string(g),this._output.space_before_token=!0),"extend"===(g=g.replace(/\s$/,""))?d=!0:"import"===g&&(c=!0),g in this.NESTED_AT_RULE?(this._nestedLevel+=1,g in this.CONDITIONAL_GROUP_RULE&&(l=!0)):a||0!==s||-1===g.indexOf(":")||(r=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(r&&(r=!1,this.outdent()),l?(l=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),c=!1,d=!1,r&&(this.outdent(),r=!1),this.print_string(this._ch),a=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!a&&!l||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||d||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),r||(r=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===s?(r&&(this.outdent(),r=!1),d=!1,c=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),s++,this.indent()):")"===this._ch?(s&&(s--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||r||0!==s||c||d?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||r||0!==s?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),eo.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&eo.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},Wn.Beautifier=so;var ao=Wn.Beautifier,ro=Vn.Options;Un.exports=function(t,e){return new ao(t,e).beautify()},Un.exports.defaultOptions=function(){return new ro};var lo={exports:{}},co={},uo={},po=bi.Options;function ho(t){po.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}ho.prototype=new po,uo.Options=ho;var go={},fo=Li.Tokenizer,mo=Li.TOKEN,bo=ji.Directives,vo=Ui.TemplatablePattern,yo=Ri.Pattern,_o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:mo.START,RAW:mo.RAW,EOF:mo.EOF},xo=new bo(/<\!--/,/-->/),wo=function(t,e){fo.call(this,t,e),this._current_tag_name="";var i=new vo(this._input).read_options(this._options),n=new yo(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(wo.prototype=new fo)._is_comment=function(t){return!1},wo.prototype._is_opening=function(t){return t.type===_o.TAG_OPEN},wo.prototype._is_closing=function(t,e){return t.type===_o.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},wo.prototype._reset=function(){this._current_tag_name=""},wo.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(_o.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(_o.UNKNOWN,this._input.next())},wo.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=xo.get_directives(i))&&"start"===n.ignore&&(i+=xo.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(_o.COMMENT,i)).directives=n));return e},wo.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(_o.COMMENT,i)).directives=null)}return e},wo.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(_o.TAG_OPEN,i)),n},wo.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(_o.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(_o.TAG_OPEN,i))),n},wo.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(_o.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(_o.TAG_CLOSE,"}}"))),n},wo.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(_o.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(_o.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===_o.EQUALS?this._create_token(_o.VALUE,o):this._create_token(_o.ATTRIBUTE,o));return n},wo.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},wo.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===_o.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=_o.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(_o.TEXT,n):null},wo.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(_o.TEXT,e)},go.Tokenizer=wo,go.TOKEN=_o;var So=uo.Options,Co=ci.Output,ko=go.Tokenizer,Eo=go.TOKEN,Ao=/\r\n|[\r\n]/,Lo=/\r\n|[\r\n]/g,qo=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new Co(t,e)};qo.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},qo.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},qo.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},qo.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},qo.prototype.print_preserved_newlines=function(t){var e=0;t.type!==Eo.TEXT&&t.previous.type!==Eo.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},qo.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},qo.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},qo.prototype.print_newline=function(t){this._output.add_new_line(t)},qo.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},qo.prototype.indent=function(){this.indent_level++},qo.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var To=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==Eo.EOF&&t.closed!==i;){if(i.type===Eo.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===Eo.EQUALS&&i.next.next&&i.next.next.type===Eo.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function Mo(t,e){return-1!==e.indexOf(t)}function Ro(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function Oo(t){this._printer=t,this._current_frame=null}function Bo(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new So(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}Oo.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},Oo.prototype.record_tag=function(t){var e=new Ro(this._current_frame,t,this._printer.indent_level);this._current_frame=e},Oo.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},Oo.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},Oo.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},Oo.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},Bo.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&Ao.test(t)&&(e=t.match(Ao)[0]));var i=(t=t.replace(Lo,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new No,s=new qo(this._options,i),a=new ko(t,this._options).tokenize();this._tag_stack=new Oo(s);for(var r=null,l=a.next();l.type!==Eo.EOF;)l.type===Eo.TAG_OPEN||l.type===Eo.COMMENT?o=r=this._handle_tag_open(s,l,o,n):l.type===Eo.ATTRIBUTE||l.type===Eo.EQUALS||l.type===Eo.VALUE||l.type===Eo.TEXT&&!o.tag_complete?r=this._handle_inside_tag(s,l,o,a):l.type===Eo.TAG_CLOSE?r=this._handle_tag_close(s,l,o):l.type===Eo.TEXT?r=this._handle_text(s,l,o):s.add_raw_token(l),n=r,l=a.next();return s._output.get_code(e)},Bo.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},Bo.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===Eo.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===Eo.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===Eo.EQUALS||e.type===Eo.VALUE&&e.previous.type===Eo.EQUALS)&&t.set_space_before_token(!1),e.type===Eo.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var a=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var r,l=!0,d=0;do{if((r=n.peek(d)).type===Eo.ATTRIBUTE){l=!1;break}d+=1}while(d<4&&r.type!==Eo.EOF&&r.type!==Eo.TAG_CLOSE);a=!l}a&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},Bo.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},Bo.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,a=1,r="",l="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new Bo(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-t.indent_level);var d=t.get_full_indent(a);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var c=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!c)return void t.add_raw_token(e);r=d+c[1]+"\n",s=c[4],c[5]&&(l=d+c[5]),s=s.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(e.whitespace_before=c[0])}if(s)if(o){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,s=o(d+s,new u)}else{var p=e.whitespace_before;p&&(s=s.replace(new RegExp("\n("+p+")?","g"),"\n")),s=d+s.replace(/\n/g,"\n"+d)}r&&(s=s?r+s+"\n"+l:r+l),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},Bo.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==Eo.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var No=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===Eo.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};Bo.prototype._get_tag_open_token=function(t){var e=new No(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||Mo(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&Mo(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&Mo(e.tag_check,this._options.content_unformatted),e.is_inline_element=Mo(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},Bo.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=To(i.tag_check,e)))),Mo(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===Eo.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===Eo.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},Bo.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Io=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],Do=["a","audio","del","ins","map","noscript","video"];Bo.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Io.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==Do.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},co.Beautifier=Bo;var Po=co.Beautifier,$o=uo.Options;lo.exports=function(t,e,i,n){return new Po(t,e,i,n).beautify()},lo.exports.defaultOptions=function(){return new $o};var zo=li.exports,Ho=Un.exports,jo=lo.exports;function Fo(t,e,i,n){return jo(t,e,i=i||zo,n=n||Ho)}Fo.defaultOptions=jo.defaultOptions,ri.js=zo,ri.css=Ho,ri.html=Fo,function(t){!function(t){var e=ri;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(t)}(ai);var Uo=ai.exports;function Wo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Vo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Go(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Vo(Object(i),!0).forEach((function(e){Wo(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Vo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Xo(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ko(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Zo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Qo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zo(Object(i),!0).forEach((function(e){Ko(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Jo(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}function ts(t){return function e(){for(var i=this,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return o.length>=t.length?t.apply(this,o):function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(i,[].concat(o,n))}}}function es(t){return{}.toString.call(t).includes("Object")}function is(t){return"function"==typeof t}var ns=ts((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),os={changes:function(t,e){return es(e)||ns("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&ns("changeField"),e},selector:function(t){is(t)||ns("selectorType")},handler:function(t){is(t)||es(t)||ns("handlerType"),es(t)&&Object.values(t).some((function(t){return!is(t)}))&&ns("handlersType")},initial:function(t){var e;t||ns("initialIsRequired"),es(t)||ns("initialType"),e=t,Object.keys(e).length||ns("initialContent")}};function ss(t,e){return is(e)?e(t.current):e}function as(t,e){return t.current=Qo(Qo({},t.current),e),e}function rs(t,e,i){return is(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var ls={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};os.initial(t),os.handler(e);var i={current:t},n=ts(rs)(i,e),o=ts(as)(i),s=ts(os.changes)(t),a=ts(ss)(i);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return os.selector(t),t(i.current)}function l(t){Jo(n,o,s,a)(t)}return[r,l]}};var ds,cs={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},us=(ds=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=ds.length?ds.apply(this,n):function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t.apply(e,[].concat(n,o))}})(cs),ps={config:function(t){var e;return t||us("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||us("configType"),t.urls?(console.warn(cs.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function hs(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],hs(t[i],e[i]))})),Go(Go({},t),e)}var gs={type:"cancelation",msg:"operation is manually canceled"};function fs(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(gs):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var ms,bs,vs=ls.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),ys=(bs=2,function(t){if(Array.isArray(t))return t}(ms=vs)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,o=!1,s=void 0;try{for(var a,r=t[Symbol.iterator]();!(n=(a=r.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){o=!0,s=t}finally{try{n||null==r.return||r.return()}finally{if(o)throw s}}return i}}(ms,bs)||function(t,e){if(t){if("string"==typeof t)return Yo(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Yo(t,e):void 0}}(ms,bs)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_s=ys[0],xs=ys[1];function ws(t){return document.body.appendChild(t)}function Ss(t){var e=_s((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function Cs(){var t=_s((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){ks(e),t.resolve(e)}),(function(e){t.reject(e)}))}function ks(t){_s().monaco||xs({monaco:t})}var Es=new Promise((function(t,e){return xs({resolve:t,reject:e})})),As={config:function(t){var e=ps.config(t),i=e.monaco,n=Xo(e,["monaco"]);xs((function(t){return{config:hs(t.config,n),monaco:i}}))},init:function(){var t=_s((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(xs({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),fs(Es);if(window.monaco&&window.monaco.editor)return ks(window.monaco),t.resolve(window.monaco),fs(Es);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(ws,Ss)(Cs)}return fs(Es)},__getMonacoInstance:function(){return _s((function(t){return t.monaco}))}};const Ls=new si;let qs={};class Ts{constructor(t){this.builder=t;const e=this.builder.util,i=this.builder.builderStuff;let n=i.querySelector(".viewhtml");if(!n){const t=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="max-width: 55vw;padding:0">\n <textarea style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:65vh;"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="max-width: 55vw;padding:0">\n <div class="input-code-editor" style="width:100%;height:65vh;"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;Ls.appendHtml(i,t),n=i.querySelector(".viewhtml");let o=i.querySelector(".viewhtmlmonaco"),s=i.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");Ls.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),Ls.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=o.querySelector(".input-ok"),Ls.addEventListener(a,"click",(()=>{this.applyHtml(o)})),a=o.querySelector(".input-cancel"),Ls.addEventListener(a,"click",(()=>{this.builder.hideModal(o)})),a=s.querySelector(".input-ok"),Ls.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)})),a=s.querySelector(".input-cancel"),Ls.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)}))}}applyHtml(t){const e=this.builder.util;let i=this.builder.codeEditorMode,n=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===i){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===i){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===i){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender()}if("full"===i){n.innerHTML="";let t=document.createRange();t.setStart(n,0),n.appendChild(t.createContextualFragment(o));let i=this.builder.doc.querySelector(".builder-active");i&&this.builder.applyBehaviorOn(i),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(e,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),e.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=document.querySelector("textarea[data-source-active]");let e=this.builder.builderStuff.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!e.querySelector(".monaco-editor"))return As.init().then((t=>{this.builder.monaco=t,e.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(e,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onKeyUp((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const i=this.builder.monaco.editor.createModel(t.value,"html");this.builder.codeEditorExternal.setModel(i),e.style.opacity=""}view(t,e,i){const n=this.builder.util,o=this.builder.builderStuff;let s;s=this.builder.opts.htmlSyntaxHighlighting?o.querySelector(".viewhtmlmonaco"):o.querySelector(".viewhtml"),n.showModal(s,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus())})),i&&i.setAttribute("data-focus",!0),s.querySelector(".input-code-editor").style.opacity=.01,this._view(t,e)}_view(t,e){const i=this.builder.util,n=this.builder.builderStuff;let o;if(this.builder.opts.htmlSyntaxHighlighting){o=n.querySelector(".viewhtmlmonaco");let i=o.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return As.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=o.querySelector("textarea");this.builder.codeEditor.onKeyUp((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else o=n.querySelector(".viewhtml");let s=o.querySelector("textarea");if("cell"===t){const t=i.cellSelected();if(!t)return;let e=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=i.cellSelected();if(t=e?e.parentNode:i.rowSelected(),!t)return;let s=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,s.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,Ls.removeClass(t,"row-outline");let a=n.querySelector(".is-column-tool");Ls.removeClass(a,"active")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const n=i.cellSelected();e=n?n.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,t.value=this.readHtml(e,!0),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(s.value,"html");this.builder.codeEditor.setModel(t)}n.querySelector(".is-pop.columnmore").style.display="",n.querySelector(".is-pop.rowmore").style.display="",this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,o.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in qs)t=t.replace(e,qs[e]);return t}readHtml(t,e,i){if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}if(this.builder.cleanHtmlFormatting&&this.builder.useCssClasses){let e=t.querySelectorAll(`.${this.builder.cssClasses.fontWeight.defaultNormal}`);e=t.querySelectorAll(`.${this.builder.cssClasses.extend.unset}`),Array.prototype.forEach.call(e,(t=>{Ls.removeClass(t,this.builder.cssClasses.extend.unset)}))}const n=this.builder.util,o=this.builder.builderStuff;let s=o.querySelector("#tmp_content");s&&o.removeChild(s),s=o.querySelector("#tmp_buildercontent"),s&&o.removeChild(s);let a='<div id="tmp_content" style="position:absolute;top:0;left:0;width:1px;height:1px;overflow:hidden;visibility:hidden;"></div>\n <div id="tmp_buildercontent" style="position:absolute;top:0;left:0;width:1px;height:1px;overflow:hidden;visibility:hidden;"></div>';Ls.appendHtml(o,a);let r=o.querySelector("#tmp_content");r.innerHTML=t.innerHTML;let l=r.querySelectorAll("[data-html]");Array.prototype.forEach.call(l,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),l=r.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,n.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+o)?"":decodeURIComponent(t.getAttribute("data-html-"+o)),o++}))})),e&&(qs={},l=r.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=n.makeId();qs[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=n.makeId(),qs[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=n.makeId(),qs[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))})));let d=r.querySelectorAll(".is-builder");Array.prototype.forEach.call(d,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),Ls.removeClass(t,"builder-active");Ls.elementChildren(t).forEach((t=>{Ls.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));Ls.elementChildren(r).forEach((t=>{Ls.elementChildren(t).forEach((t=>{t.style.cursor=""}))}));let c=r.querySelectorAll(".sortable-chosen");Ls.removeClasses(c,"sortable-chosen"),c=r.querySelectorAll(".sortable-ghost"),Ls.removeClasses(c,"sortable-ghost"),c=r.querySelectorAll(".elm-active"),Ls.removeClasses(c,"elm-active"),c=r.querySelectorAll(".elm-inspected"),Ls.removeClasses(c,"elm-inspected"),c=r.querySelectorAll(".cell-active"),Ls.removeClasses(c,"cell-active"),c=r.querySelectorAll(".row-active"),Ls.removeClasses(c,"row-active"),c=r.querySelectorAll(".row-outline"),Ls.removeClasses(c,"row-outline"),c=r.querySelectorAll(".is-builder"),Ls.removeClasses(c,"is-builder"),c=r.querySelectorAll(".row-outline"),Ls.removeClasses(c,"row-outline"),c=r.querySelectorAll("[data-click]"),Ls.removeAttributes(c,"data-click"),c=r.querySelectorAll("[contenteditable]"),Ls.removeAttributes(c,"contenteditable"),c=r.querySelectorAll("[draggridoutline]"),Ls.removeAttributes(c,"draggridoutline"),c=r.querySelectorAll("[between-blocks-left]"),Ls.removeAttributes(c,"between-blocks-left"),c=r.querySelectorAll("[between-blocks-center]"),Ls.removeAttributes(c,"between-blocks-center"),c=r.querySelectorAll("[hideelementhighlight]"),Ls.removeAttributes(c,"hideelementhighlight"),c=r.querySelectorAll("[data-module-active]"),Ls.removeAttributes(c,"data-module-active"),c=r.querySelectorAll("[draggable]"),Ls.removeAttributes(c,"draggable"),c=r.querySelectorAll("[data-animated]"),Ls.removeAttributes(c,"data-animated"),c=r.querySelectorAll("[data-saveforundo]"),Ls.removeAttributes(c,"data-saveforundo"),c=r.querySelectorAll("[hidesnippetaddtool]"),Ls.removeAttributes(c,"hidesnippetaddtool"),c=r.querySelectorAll("[gray]"),Ls.removeAttributes(c,"gray"),c=r.querySelectorAll("[rowoutline]"),Ls.removeAttributes(c,"rowoutline"),c=r.querySelectorAll("[grayoutline]"),Ls.removeAttributes(c,"grayoutline"),c=r.querySelectorAll("[hideoutline]"),Ls.removeAttributes(c,"hideoutline"),c=r.querySelectorAll("[leftrowtool]"),Ls.removeAttributes(c,"leftrowtool"),c=r.querySelectorAll("[minimal]"),Ls.removeAttributes(c,"minimal"),c=r.querySelectorAll("[clean]"),Ls.removeAttributes(c,"clean"),c=r.querySelectorAll("[grideditor]"),Ls.removeAttributes(c,"grideditor"),c=r.querySelectorAll("[gridoutline]"),Ls.removeAttributes(c,"gridoutline"),Ls.removeElements(r.querySelectorAll(".is-row-tool")),Ls.removeElements(r.querySelectorAll(".is-rowadd-tool")),Ls.removeElements(r.querySelectorAll(".ovl")),Ls.removeElements(r.querySelectorAll(".row-add-initial")),c=r.querySelectorAll(".aos-init"),Ls.removeClasses(c,"aos-init"),c=r.querySelectorAll(".aos-animate"),Ls.removeClasses(c,"aos-animate"),c=r.querySelectorAll(".skrollable"),Ls.removeClasses(c,"skrollable"),c=r.querySelectorAll(".skrollable-after"),Ls.removeClasses(c,"skrollable-after"),c=r.querySelectorAll(".skrollable-before"),Ls.removeClasses(c,"skrollable-before"),c=r.querySelectorAll(".skrollable-between"),Ls.removeClasses(c,"skrollable-between"),c=r.querySelectorAll(".is-inview"),Ls.removeClasses(c,"is-inview");let u=r.querySelectorAll('[class=""]');Array.prototype.forEach.call(u,(t=>{t.removeAttribute("class")}));let p=r.querySelectorAll('[style=""]');Array.prototype.forEach.call(p,(t=>{t.removeAttribute("style")})),Ls.removeEmptyStyle(r),c=r.querySelectorAll("[data-keep]"),Ls.removeAttributes(c,"data-keep");let h=r.querySelectorAll("a");if(Array.prototype.forEach.call(h,(t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),a="",i){let t=r.querySelectorAll(".is-dummy");Ls.removeElements(t),t=r.querySelectorAll(".is-animated"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"animated"),Ls.removeClass(t,"pulse"),Ls.removeClass(t,"bounceIn"),Ls.removeClass(t,"fadeIn"),Ls.removeClass(t,"fadeOut"),Ls.removeClass(t,"fadeInDown"),Ls.removeClass(t,"fadeInLeft"),Ls.removeClass(t,"fadeInRight"),Ls.removeClass(t,"fadeInUp"),Ls.removeClass(t,"flipInX"),Ls.removeClass(t,"flipInY"),Ls.removeClass(t,"slideInUp"),Ls.removeClass(t,"slideInDown"),Ls.removeClass(t,"slideInLeft"),Ls.removeClass(t,"slideInRight"),Ls.removeClass(t,"zoomIn"),t.style.animationDelay=""})),t=r.querySelectorAll(".is-appeared"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"is-appeared")})),t=r.querySelectorAll(".box-active"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"box-active")})),t=r.querySelectorAll(".section-active"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"section-active")})),t=r.querySelectorAll(".is-section-tool"),Ls.removeElements(t),t=r.querySelectorAll(".is-box-tool"),Ls.removeElements(t);var g="",f="",m="";Ls.elementChildren(r).forEach((t=>{let e=t;if(Ls.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),o=n.outerHTML;a+=o,-1===i.indexOf("is-static")?g+=o+"\n\n":f+=o+"\n\n"}else o=(n=e.cloneNode(!0)).outerHTML,a+=o,m+=o})),""!==f&&(f="\x3c!---FOOTER---\x3e\n"+f),""!==m&&(m="\x3c!---OTHERS---\x3e\n"+m);let e=document.querySelector("[data-contentbox]"),i=!1;e&&(i=e.settings.disableStaticSection),i||(a=g+f+m)}else a=r.innerHTML.trim(),a=a.replace(/<font/g,"<span").replace(/<\/font/g,"</span");return s=o.querySelector("#tmp_content"),s&&o.removeChild(s),s=o.querySelector("#tmp_buildercontent"),s&&o.removeChild(s),(0,Uo.html)(a)}}class Ms{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,o=this.builder.doc.getElementsByTagName("link");for(i=0;i<o.length;i++)n=o[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&o[i].parentNode.removeChild(o[i]);let s=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(s,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let i=this.builder.doc.querySelector(this.builder.opts.page);var e=document.createRange();i.innerHTML="",i.appendChild(e.createContextualFragment(t)),this.cleaning(i)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new oi(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new oi(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
|
13
|
+
*/let i=!1;function n(t){if(i){var e=window._txt[t];return e||t}return t}"undefined"!=typeof window&&void 0!==window._txt&&(i=!0);class o{constructor(t){const[e,i]=t.children,n=e=>{if(!t)return document.removeEventListener("click",n);t.contains(e.target)||this.toggle(!1)},o=n=>{const o=n.textContent,s=n.getAttribute("data-value");e.textContent=o,this.value=s,this.toggle(!1),t.dispatchEvent(new Event("change")),e.focus();let a=i.children;Array.from(a).map((t=>{t.classList.remove("selected")}));let r=i.querySelector('[data-value="'+s+'"]');r&&r.classList.add("selected")},s=t=>{t.preventDefault(),38===t.keyCode&&t.target.previousElementSibling?t.target.previousElementSibling.focus():40===t.keyCode&&t.target.nextElementSibling?t.target.nextElementSibling.focus():27===t.keyCode?(this.toggle(!1),e.focus()):13!==t.keyCode&&32!==t.keyCode||o(t.target)};e.addEventListener("keydown",(t=>{27===t.keyCode?(this.toggle(!1),t.preventDefault()):13!==t.keyCode&&32!==t.keyCode||(this.toggle(!0),t.preventDefault())})),e.addEventListener("click",(()=>this.toggle())),[...i.children].forEach((t=>{t.addEventListener("keydown",s),t.addEventListener("click",(()=>o(t)))})),this.element=t,this.value=e.getAttribute("data-value"),this.toggle=(o=null)=>{if(o=null===o?"true"!==i.getAttribute("aria-expanded"):o,i.setAttribute("aria-expanded",o),o){e.classList.add("active");let o=i.querySelector('[data-value="'+this.value+'"]');o&&(o.classList.add("selected"),o.focus()),document.addEventListener("click",n),t.dispatchEvent(new Event("opened"))}else e.classList.remove("active"),t.dispatchEvent(new Event("closed")),document.removeEventListener("click",n)}}}const s=new t;class a{constructor(t){this.builder=t;let e="";const i=this.builder.builderStuff;if(this.builderStuff=i,this.builder.useSidebar){e+='<div class="is-sidebar active" style="transform: translate3d(0,0,0);display: flex;flex-direction: column;opacity: 0.0001;">';var o=0;this.builder.sidebarData.buttons.map((t=>{"section"==t.name?e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSections" data-command="section" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon"><use xlink:href="#ion-android-add"></use></svg></button>':"snippet"==t.name?e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSnippets" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon"><use xlink:href="#icon-align-center"></use></svg></button>':"typography"==t.name?this.builder.enableContentStyle&&(e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarTypography" data-command="typography" data-title="'+t.title+'" title="'+t.title+'"><span style="">a</span></button>'):"code"==t.name?this.builder.htmlSyntaxHighlighting?e+='<button class="is-sidebar-button" tabindex="-1" data-command="code" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg></button>':e+='<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSource" data-command="code" data-title="'+t.title+'" title="'+t.title+'"><svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg></button>':"custom1"==t.name?e+='<button class="is-sidebar-button" tabindex="-1" data-content="divCustomSidebarArea1" data-title="'+t.title+'" title="'+t.title+'" data-src="'+t.src+'">'+t.html+"</button>":"custom2"==t.name?e+='<button class="is-sidebar-button" data-content="divCustomSidebarArea2" data-title="'+t.title+'" title="'+t.title+'" data-src="'+t.src+'">'+t.html+"</button>":e+='<button class="is-sidebar-button" tabindex="-1" data-content="'+t.content.substr(1)+'" data-title="'+t.title+'" title="'+t.title+'">'+t.html+"</button>",this.builder.sideButtons&&this.builder.sideButtons.map((t=>{if(o==t.pos){var a=s.uniqueId();e+='<button class="is-sidebar-button" tabindex="-1" data-content="'+a+'" data-src="'+t.src+'" data-title="'+n(t.title)+'" title="'+n(t.title)+'">'+t.html+"</button>";let o='<div id="'+a+'" class="is-sidebar-content '+t.class+'" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div><iframe src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div>';s.appendHtml(i,o)}})),o++})),e+="</div>",e+='<div id="divSidebarSections" class="is-sidebar-content '+this.builder.templateThumbnailSize+'" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div><iframe id="ifrIdeasPanel" src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div><div id="divSidebarSnippets" class="is-sidebar-content scroll-darker" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="max-width:275px;border-left: transparent 50px solid;box-sizing: border-box;"></div><div id="divSidebarSource" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div><div style="position:absolute;width:240px;height:35px;right:10px;top:5px;z-index:1;display:flex;"><button title="'+n("Cancel")+'" id="btnViewHtmlCancel" tabindex="-1" style="height:38px" class="classic-secondary"> '+n("Cancel")+' </button><button title="'+n("Ok")+'" id="btnViewHtmlOk" tabindex="-1" style="height:38px" class="classic-primary"> '+n("Ok")+' </button></div><div style="height:100%;box-sizing:border-box;border-top:#f3f3f3 50px solid;position:relative"><textarea id="inpViewHtml" tabindex="-1" style="width:100%;height:100%;resize: none;"></textarea></div></div></div><div id="divSidebarTypography" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;"><div class="scroll-darker"><div style="padding: 15px 0 0 20px"><div class="is-sidebar-title" style="margin-bottom:12px;">'+n("Typography Styles")+"</div><div>"+n("Apply to")+':</div><div style="display:flex;justify-content:space-between;align-items: center;"><div class="typo-target-default" style="display:flex"><label><input type="radio" tabindex="0" name="typoTarget" value="page"> <span>'+n("Page")+'</span></label><label><input type="radio" tabindex="0" name="typoTarget" value="section" checked> <span>'+n("Section")+'</span></label></div><div class="typo-target-box" style="display: flex;"><span>'+n("Active Box")+'</span></div><button title="'+n("Clear")+'" tabindex="0" id="btnTypoClear"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button></div></div><div id="divSelector"></div><div id="divStyles"></div></div></div><div id="divCustomSidebarArea1" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="max-width:500px;"><div style="padding:0 0 0 50px;box-sizing:border-box;"><iframe id="ifrCustomSidebarArea1" src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div><div id="divCustomSidebarArea2" class="is-sidebar-content" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="max-width:500px;"><div style="padding:0 0 0 50px;box-sizing:border-box;"><iframe id="ifrCustomSidebarArea2" src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;"></iframe></div></div>'}else e='<div id="divSections" style="display:none"></div><div class="is-modal addsection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width: 900px;"><div id="divSectionList" class="is-section-list"></div></div></div>';if(s.appendHtml(i,e),this.builder.useSidebar){document.querySelectorAll(".is-sidebar .is-sidebar-button").forEach((t=>{t.addEventListener("click",(()=>{let e=!1;if(s.hasClass(t,"active")&&(e=!0),this.closeSidebar(),e)return;let n=t.getAttribute("data-content");if(n){const e=i.querySelector(".is-sidebar-overlay");e&&e.addEventListener("click",(()=>{this.closeSidebar()})),s.addClass(t,"active");const o=document.querySelector("#"+n);o.style.display="block",o.setAttribute("aria-hidden",!1),setTimeout((()=>{if(s.addClass(o,"active"),o.focus(),"divSidebarSnippets"===o.getAttribute("id")){o.querySelector(".selectsnippet .dropdown-toggle").focus()}"divSidebarTypography"===o.getAttribute("id")&&o.focus()}),10)}let o=t.getAttribute("data-command");o&&("section"==o&&this.viewIdeas(),"code"==o&&(this.builder.htmlSyntaxHighlighting?this.viewHtml():this.viewHtml2()),"typography"==o&&(t.setAttribute("data-applyto","page"),i.querySelector(".typo-target-default").style.display="flex",i.querySelector(".typo-target-box").style.display="none",this.viewTypography()));let a=t.getAttribute("data-src");if(a){let e=t.getAttribute("data-content");if("divCustomSidebarArea1"==e){const t=document.querySelector("#ifrCustomSidebarArea1");-1!=t.getAttribute("src").indexOf("blank")&&t.setAttribute("src",a)}else if("divCustomSidebarArea2"==e){const t=document.querySelector("#ifrCustomSidebarArea2");-1!=t.getAttribute("src").indexOf("blank")&&t.setAttribute("src",a)}else{let e=t.getAttribute("data-content");const i=document.querySelector("#"+e);-1!=i.getAttribute("src").indexOf("blank")&&i.setAttribute("src",a)}}}))}));i.querySelector("#btnViewHtmlOk").addEventListener("click",(()=>{this.builder.editor.saveForUndo();var t=i.querySelector("#inpViewHtml").value;t=this.builder.editor.fromViewToActual(t),this.builder.loadHtml(t),this.builder.settings.onChange();const e=document.querySelector(".is-sidebar-overlay");e&&(e.remove(),document.body.style.overflow="",document.body.style.overflowY=""),document.querySelectorAll(".is-sidebar-button.active").forEach((t=>{s.removeClass(t,"active")})),document.querySelectorAll(".is-sidebar-content.active").forEach((t=>{s.removeClass(t,"active")}))}));i.querySelector("#btnViewHtmlCancel").addEventListener("click",(()=>{const t=document.querySelector(".is-sidebar-overlay");t&&(t.remove(),document.body.style.overflow="",document.body.style.overflowY=""),document.querySelectorAll(".is-sidebar-button.active").forEach((t=>{s.removeClass(t,"active")})),document.querySelectorAll(".is-sidebar-content.active").forEach((t=>{s.removeClass(t,"active")}))})),document.querySelector("#btnTypoClear").addEventListener("click",(()=>{this.boxTypography("","","")}));i.querySelectorAll(".is-sidebar-content").forEach((t=>{t.addEventListener("keydown",(t=>{27===t.keyCode&&this.closeSidebar()}))}))}}closeSidebar(){const t=this.builderStuff,e=t.querySelector(".is-sidebar-overlay");e&&(e.remove(),document.body.style.overflowY=""),t.querySelectorAll(".is-sidebar-button.active").forEach((t=>{s.removeClass(t,"active")})),t.querySelectorAll(".is-sidebar > div").forEach((t=>{s.removeClass(t,"active")})),t.querySelectorAll(".is-sidebar-content.active").forEach((t=>{s.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),setTimeout((()=>{t.style.display=""}),300)}))}viewIdeas(){const t=this.builder.designPath,e=this.builder.designUrl1,i=this.builder.designUrl2;if(e&&i){var n=document.querySelector("#ifrIdeasPanel").contentWindow.document;""===n.body.innerHTML&&(n.open(),0===this.builder.templates.length?n.write(this.getTemplatesHtml_OLD()):n.write(this.getTemplatesHtml()),n.close())}else if(t){const e=document.querySelector("#ifrIdeasPanel");-1!=e.getAttribute("src").indexOf("blank")&&e.setAttribute("src",t+"ideas.html")}return!1}viewHtml(){const t=this.builderStuff;var e=this.builder.html(!0);t.querySelector("#inpViewHtml").value=e;let i=t.querySelectorAll("[data-source-active]");i.forEach((t=>{t.removeAttribute("data-source-active")})),i=t.querySelectorAll("[data-source-ok]"),i.forEach((t=>{t.removeAttribute("data-source-ok")})),i=t.querySelectorAll("[data-source-cancel]"),i.forEach((t=>{t.removeAttribute("data-source-cancel")}));let n=t.querySelector("#divSidebarSource textarea");n.setAttribute("data-source-active","1"),n.setAttribute("data-source-ok","#btnViewHtmlOk"),n.setAttribute("data-source-cancel","#btnViewHtmlCancel"),this.builder.editor.viewHtmlNormal()}viewHtml2(){const t=this.builderStuff;let e=this.builder.html(!0);t.querySelector("#inpViewHtml").value=e}viewTypography(){const t=this.builder.settings.contentStylePath,e=this.builder.settings.contentStyles,i=e.data.categories;let s="",a="";for(let t=0;t<i.length;t++)a+='<li role="option" tabindex="0" data-value="'+i[t].id+'">'+n(i[t].desc)+"</li >",-1===i[t].id&&(s=n(i[t].desc));let r='<div class="is-dropdown style-cat" style=""><button tabindex="0" class="dropdown-toggle no-outline" type="button" aria-haspopup="true" data-value="-1"><span>'+s+'</span></button><ul class="dropdown-menu" role="listbox" aria-expanded="false">'+a+"</ul></div>";function l(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}document.querySelector("#divSelector").innerHTML=r;const d=new o(document.querySelector(".style-cat"));d.element.addEventListener("change",(()=>{let i=d.value,n=e.data.styles,o="";if(-1==i)for(let e=0;e<n.length;e++)o+='<div data-css="'+n[e].css+'" data-sectioncss="'+n[e].sectioncss+'" data-classname="'+n[e].classname+'"><div>['+(e+1)+"] "+n[e].caption+'</div><img src="'+t+n[e].img+'" /><span class="is-overlay"></span></div></div>';else for(let e=0;e<n.length;e++)i==n[e].category&&(o+='<div data-css="'+n[e].css+'" data-sectioncss="'+n[e].sectioncss+'" data-classname="'+n[e].classname+'"><div>['+(e+1)+"] "+n[e].caption+'</div><img src="'+t+n[e].img+'" /><span class="is-overlay"></span></div></div>');let s=document.querySelector("#divStyles");s.innerHTML=o,l(s).forEach((t=>{t.addEventListener("click",(()=>{this.boxTypography(t.getAttribute("data-classname"),t.getAttribute("data-sectioncss"),t.getAttribute("data-css"))}))}))}));for(var c=e.data.styles,u="",p=0;p<c.length;p++)u+='<div data-css="'+c[p].css+'" data-sectioncss="'+c[p].sectioncss+'" data-classname="'+c[p].classname+'"><div>['+(p+1)+"] "+c[p].caption+'</div><img src="'+t+c[p].img+'" /><span class="is-overlay"></span></div></div>';var h=document.querySelector("#divStyles");h.innerHTML=u,l(h).forEach((t=>{t.addEventListener("click",(()=>{this.boxTypography(t.getAttribute("data-classname"),t.getAttribute("data-sectioncss"),t.getAttribute("data-css"))}))}))}boxTypography(t,e,i){const n=this.builder.builderStuff;this.builder.editor.saveForUndo();const o=this.builder.settings.contentStylePath;let a=n.querySelector('.is-sidebar > button[data-command="typography"]').getAttribute("data-applyto"),r=document.querySelector('input[name="typoTarget"]:checked').value;if("box"!==a)if("section"===r){let i=this.builder.activeSection;if(!i)return;if(i.getAttribute("class").split(/\s+/).forEach((t=>{-1!=t.indexOf("type-")&&s.removeClass(i,t)})),i.querySelectorAll(".is-box, .is-box-centered").forEach((t=>{t.getAttribute("class").split(/\s+/).forEach((e=>{-1!=e.indexOf("type-")&&s.removeClass(t,e)}))})),""!==t){s.addClass(i,t);let n=!1,a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++){-1!=a[t].href.toLowerCase().indexOf(e.toLowerCase())&&(n=!0)}n||(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'))}let n=document.getElementsByTagName("link");for(let t=0;t<n.length;t++)if("contentstyle"===n[t].getAttribute("data-name")){let e=n[t].getAttribute("data-class");this.builder.wrapperEl.querySelector("."+e)||n[t].setAttribute("data-rel","_del")}document.querySelectorAll('[data-rel="_del"]').forEach((t=>{t.parentNode.removeChild(t)}))}else if("page"===r){let t=document.getElementsByTagName("link");for(let e=0;e<t.length;e++)if("contentstyle"===t[e].getAttribute("data-name")){let i=t[e].getAttribute("data-class");if(this.builder.wrapperEl.querySelector("."+i)){this.builder.wrapperEl.querySelectorAll("."+i).forEach((t=>{s.removeClass(t,i)})),t[e].setAttribute("data-rel","_del")}}let e=document.querySelectorAll('[data-rel="_del"]');e.forEach((t=>{t.parentNode.removeChild(t)})),t=document.getElementsByTagName("link");for(let e=0;e<t.length;e++){-1!=t[e].href.toLowerCase().indexOf("basetype-")&&t[e].setAttribute("data-rel","_del")}e=document.querySelectorAll('[data-rel="_del"]'),e.forEach((t=>{t.parentNode.removeChild(t)})),""!=i&&(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link href="'+o+i+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link href="'+o+i+'" rel="stylesheet">'))}else if("container"===r){let i=document.querySelector(".builder-active");if(!i)return;let n=s.parentsHasClass(i,"is-box");if(n.getAttribute("class").split(/\s+/).forEach((t=>{-1!=t.indexOf("type-")&&s.removeClass(n,t)})),""!==t){s.addClass(n,t);let i=!1,a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++){-1!=a[t].href.toLowerCase().indexOf(e.toLowerCase())&&(i=!0)}i||(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'))}let a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++)if("contentstyle"===a[t].getAttribute("data-name")){let e=a[t].getAttribute("data-class");this.builder.wrapperEl.querySelector("."+e)||a[t].setAttribute("data-rel","_del")}document.querySelectorAll('[data-rel="_del"]').forEach((t=>{t.parentNode.removeChild(t)}))}if("box"===a){let i=this.builder.activeBox;if(i){if(i.getAttribute("class").split(/\s+/).forEach((t=>{-1!=t.indexOf("type-")&&s.removeClass(i,t)})),""!==t){s.addClass(i,t);let n=!1,a=document.getElementsByTagName("link");for(let t=0;t<a.length;t++){-1!=a[t].href.toLowerCase().indexOf(e.toLowerCase())&&(n=!0)}n||(this.builder.settings.cssInBody?this.builder.wrapperEl.insertAdjacentHTML("beforebegin",'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'):s.appendHtml(this.builder.doc.head,'<link data-name="contentstyle" data-class="'+t+'" href="'+o+e+'" rel="stylesheet">'))}let n=document.getElementsByTagName("link");for(let t=0;t<n.length;t++)if("contentstyle"===n[t].getAttribute("data-name")){let e=n[t].getAttribute("data-class");this.builder.wrapperEl.querySelector("."+e)||n[t].setAttribute("data-rel","_del")}document.querySelectorAll('[data-rel="_del"]').forEach((t=>{t.parentNode.removeChild(t)}))}}this.builder.settings.onChange()}getTemplatesHtml(){let t="";this.builder.templateJSON.forEach((e=>{t+=`{\n url: '${e.url}',\n path: '${e.path}',\n pathReplace: '${e.pathReplace}',\n },`}));let e="";this.builder.templates.forEach((t=>{e+=`{\n url: '${t.url}',\n path: '${t.path}',\n pathReplace: '${t.pathReplace}',\n },`}));let i="";this.builder.featuredCategories.forEach((t=>{i+=`{\n id: '${t.id}',\n name: '${t.name}',\n },`}));let n="",o="";"small"===this.builder.templateThumbnailSize?(n="250px",o="30px 0 0 30px"):"medium"===this.builder.templateThumbnailSize?(n="350px",o="40px 0 0 40px"):(n="450px",o="50px 0 0 50px");let s=`\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Browse</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#" />\n <style>\n body {\n margin: 0;\n background: #fff;\n font-family: sans-serif;\n font-weight: 300;\n }\n h2 {\n font-weight: 300;\n }\n button {\n cursor: pointer;\n border: none;\n background: #fdfdfd;\n padding: 12px 25px;\n border-radius: 500px;\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 1px;;\n color: #333;\n }\n button.on {\n background: #f5f5f5;\n }\n \n .featured-categories {\n background-color: #f5f5f5;\n position: absolute;\n width: 100%;\n height: 88px;\n z-index: 1;\n padding: 14px 15px 0 25px;\n box-sizing: border-box;\n /* box-shadow: 0 5px 15px rgb(0 0 0 / 5%); */\n }\n .featured-categories button {\n margin: 10px 15px 0 0;\n font-size: 11px;\n }\n \n .is-design-list {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 88px solid;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n padding: 0px 0px 30px 0px;\n box-sizing: border-box;\n overflow: auto;\n transition: all 200ms ease;\n }\n .is-design-list > button {\n position: relative;\n width: ${n};\n overflow: hidden;\n margin: ${o};\n cursor: pointer;\n display: inline-block;\n padding: 0px;\n border: rgba(219, 219, 219, 0.39) 1px solid;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n }\n .is-design-list > button img {\n box-shadow: none;\n opacity: 1;\n display: block;\n box-sizing: border-box;\n transition: all 0.2s ease-in-out;\n max-width: 500px;\n width: 100%\n }\n .is-design-list > button .is-overlay {\n position: absolute;\n top:0px;\n left:0px;\n width:100%;\n height:100%;\n }\n .is-design-list > button .is-overlay:after {\n background: rgba(0, 0, 0, 0.05);\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transition: all 0.2s ease-in-out;\n opacity: 0;\n }\n .is-design-list > button:hover .is-overlay:after {\n opacity: 0.5;\n }\n \n .mega-menu {\n display: none;\n transform: translateY(-100%);\n background: #f5f5f5;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 88px;\n left: 0;\n right: 0;\n width: 100%;\n height: auto;\n z-index: 1;\n padding: 10px 50px 40px 40px;\n box-sizing: border-box;\n transition: all 300ms ease;\n min-width:400px;\n min-height: 200px;\n /* box-shadow: 0 5px 15px rgb(0 0 0 / 5%); */\n }\n .mega-menu.active {\n opacity: 1;\n transform: scale(1);\n transform: translateY(0);\n }\n .mega-menu h2 {\n margin-top:30px;\n font-size: 21px\n }\n .mega-menu button {\n margin:15px 15px 0 0;\n }\n .mega-menu .close {\n position: absolute;\n top: 0px; right: 0px;\n background: transparent;\n width: 50px;\n height: 50px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 2px;;\n }\n\n .is-waiting {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 88px solid;\n width: 100%;\n height: 100%;\n background-color: #fff;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n padding: 50px\n }\n .is-waiting2 {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n background-color: #f5f5f5;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n padding: 20px 50px;\n }\n\n .spinner {\n -webkit-animation: rotator 1.4s linear infinite;\n animation: rotator 1.4s linear infinite;\n }\n \n @-webkit-keyframes rotator {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(270deg);\n }\n }\n \n @keyframes rotator {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(270deg);\n }\n }\n .path {\n stroke: #d9d9d9;\n stroke-dasharray: 187;\n stroke-dashoffset: 0;\n transform-origin: center;\n -webkit-animation: dash 1.4s ease-in-out infinite;\n animation: dash 1.4s ease-in-out infinite;\n }\n \n @-webkit-keyframes dash {\n 0% {\n stroke-dashoffset: 187;\n }\n 50% {\n stroke-dashoffset: 46.75;\n transform: rotate(135deg);\n }\n 100% {\n stroke-dashoffset: 187;\n transform: rotate(450deg);\n }\n }\n @keyframes dash {\n 0% {\n stroke-dashoffset: 187;\n }\n 50% {\n stroke-dashoffset: 46.75;\n transform: rotate(135deg);\n }\n 100% {\n stroke-dashoffset: 187;\n transform: rotate(450deg);\n }\n }\n </style>\n </head>\n <body style="touch-action: pan-y">`;return s+=`\n <div class="mega-menu">\n <div class="is-waiting2">\n\n <svg class="spinner" width="40px" height="40px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">\n <circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>\n </svg>\n\n </div>\n \n <button class="close" tabindex="0"><svg style="width:40px;height:40px;flex:none;"><use xlink:href="#iconclose"></use></svg></button>\n \n <div class="mega-menu-content">\n </div>\n </div>\n \n <div class="featured-categories">\n </div>\n \n <div class="is-design-list">\n </div>\n \n <div class="is-waiting">\n\n <svg class="spinner" width="40px" height="40px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">\n <circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>\n </svg>\n \n </div>\n \n <svg width="0" height="0" style="position:absolute;display:none;">\n <defs>\n <symbol viewBox="0 0 24 24" id="iconclose" stroke-width="0.7" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="none" d="M0 0h24v24H0z" fill="none"></path><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>\n </symbol>\n </defs>\n </svg>\n \n <script>\n var template_list = [];\n <\/script>\n \x3c!-- <script src="basic.js" type="text/javascript"><\/script>\n <script src="examples.js" type="text/javascript"><\/script> --\x3e\n \n <script>\n \n // Configuration\n const featuredCategories = [\n ${i}\n ];\n const defaultCat = ${this.builder.defaultDesignCategory};\n const navbar = ${this.builder.navbar?"true":"false"};\n\n const slider = '${this.builder.slider}';\n\n const framework = '${this.builder.framework}'; \n const contentStylePath = '${this.builder.contentStylePath}'; \n \n let templates = [\n ${e}\n ];\n \n let templateJSON = [\n ${t}\n ];\n // /Configuration\n\n if(templates.length > 0) templateJSON = [...templates];\n \n const loadJsFiles = (list, callback) => {\n if(list.length===0) {\n return;\n } else {\n const url = list[0].url;\n const script = document.createElement('script');\n script.src = url; \n script.async = true;\n script.onload = () => {\n callback(list[0]);\n loadJsFiles(list.slice(1), callback);\n };\n document.body.appendChild(script);\n } \n }\n \n const imageObserver = new IntersectionObserver((entries, imgObserver) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const lazyImage = entry.target\n // console.log("lazy loading ", lazyImage)\n lazyImage.src = lazyImage.dataset.src\n lazyImage.classList.remove("lzy-img");\n imgObserver.unobserve(lazyImage);\n }\n })\n });\n \n const makeid = () => { //http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript\n var text = "";\n var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";\n for (var i = 0; i < 2; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n \n var text2 = "";\n var possible2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";\n for (var i = 0; i < 5; i++)\n text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));\n \n return text + text2;\n }\n \n const addDesign = (designid) => {\n\n const wrapper = parent._cb.doc.querySelector('.is-wrapper');\n \n let nIndex = 0;\n template_list.forEach(gallery=>{\n let designs = gallery.designs;\n designs.forEach(item=>{\n \n item.id = nIndex; //Give id\n \n if(nIndex===parseInt(designid)) {\n // alert(item.html);\n // alert(gallery.path);\n // alert(gallery.pathReplace);\n\n let html = item.html;\n let googleFonts = item.googleFonts;\n let contentCss = item.contentCss;\n let contentClass = item.contentClass;\n \n let designPath = gallery.path;\n let snippetPathReplace = gallery.pathReplace;\n \n //To Tailwind\n if (framework == 'tailwind') {\n html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'flex flex-col md:flex-row');\n html = html.replace(new RegExp('column full', 'g'), 'w-full px-4');\n html = html.replace(new RegExp('column half', 'g'), 'w-full md:w-6/12 px-4');\n html = html.replace(new RegExp('column third', 'g'), 'w-full md:w-4/12 px-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'w-full md:w-3/12 px-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'w-full md:w-2/12 px-4'); //not needed\n html = html.replace(new RegExp('column sixth', 'g'), 'w-full md:w-2/12 px-4');\n html = html.replace(new RegExp('column two-third', 'g'), 'w-full md:w-8/12 px-4');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'w-full md:w-9/12 px-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'w-full md:w-10/12 px-4');\n }\n \n //To Bootstrap\n if (framework == 'bootstrap') {\n html = html.replace(new RegExp(' container', 'g'), ' container-fluid');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'col-md-12');\n html = html.replace(new RegExp('column half', 'g'), 'col-md-6');\n html = html.replace(new RegExp('column third', 'g'), 'col-md-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'col-md-3');\n html = html.replace(new RegExp('column fifth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column sixth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column two-third', 'g'), 'col-md-8');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'col-md-9');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'col-md-10');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'btn btn-primary btn-lg');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'btn btn-default btn-lg');\n }`,s+="\n //To Foundation\n if (framework == 'foundation') {\n //html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'large-12 columns');\n html = html.replace(new RegExp('column half', 'g'), 'large-6 columns');\n html = html.replace(new RegExp('column third', 'g'), 'large-4 columns');\n html = html.replace(new RegExp('column fourth', 'g'), 'large-3 columns');\n html = html.replace(new RegExp('column fifth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column sixth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column two-third', 'g'), 'large-8 columns');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'large-9 columns');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'large-10 columns');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'button');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'secondary button');\n }\n \n //To UIKit\n if (framework == 'uikit') {\n html = html.replace(new RegExp(' container', 'g'), ' uk-container uk-container-center');\n html = html.replace(new RegExp('row clearfix', 'g'), 'uk-grid');\n html = html.replace(new RegExp('column full', 'g'), 'uk-width-1-1');\n html = html.replace(new RegExp('column half', 'g'), 'uk-width-1-2');\n html = html.replace(new RegExp('column third', 'g'), 'uk-width-1-3');\n html = html.replace(new RegExp('column fourth', 'g'), 'uk-width-1-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'uk-width-1-5');\n html = html.replace(new RegExp('column sixth', 'g'), 'uk-width-1-6');\n html = html.replace(new RegExp('column two-third', 'g'), 'uk-width-2-3');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'uk-width-3-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'uk-width-5-6');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'uk-button uk-button-primary uk-button-large');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'uk-button uk-button-large');\n }\n \n //To Material\n if (framework == 'material') {\n html = html.replace(new RegExp(' container', 'g'), '');\n html = html.replace(new RegExp('row clearfix', 'g'), 'mdl-grid');\n html = html.replace(new RegExp('column full', 'g'), 'mdl-cell mdl-cell--12-col');\n html = html.replace(new RegExp('column half', 'g'), 'mdl-cell mdl-cell--6-col');\n html = html.replace(new RegExp('column third', 'g'), 'mdl-cell mdl-cell--4-col');\n html = html.replace(new RegExp('column fourth', 'g'), 'mdl-cell mdl-cell--3-col');\n html = html.replace(new RegExp('column fifth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column sixth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column two-third', 'g'), 'mdl-cell mdl-cell--8-col');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'mdl-cell mdl-cell--9-col');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'mdl-cell mdl-cell--10-col');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'mdl-button mdl-js-button mdl-button--raised mdl-button--accent');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'mdl-button mdl-js-button mdl-button--raised');\n }\n \n html = html.replace(/{id}/g, makeid());\n\n if(snippetPathReplace.length>0) {\n if (snippetPathReplace[0] != '') {\n var regex = new RegExp(snippetPathReplace[0], 'g');\n html = html.replace(regex, snippetPathReplace[1]);\n }\n }\n \n html = html.replace(/\\[%IMAGE_PATH%\\]/g, designPath);\n html = html.replace(/%5B%25IMAGE_PATH%25%5D/g, designPath); //If [%IMAGE_PATH%] is encoded (inside data-html)\n\n //Add html\n parent.contentbox.addIdea(html);\n \n //Add contentCss\n let exist = false;\n let links = parent._cb.doc.getElementsByTagName(\"link\");\n for (let i = 0; i < links.length; i++) {\n let src = links[i].href.toLowerCase();\n if (src.indexOf(contentCss.toLowerCase()) != -1) exist = true;\n }\n \n if (!exist) wrapper.insertAdjacentHTML('beforeend', '<link data-name=\"contentstyle\" data-class=\"' + contentClass + '\" href=\"' + contentStylePath + contentCss + '\" rel=\"stylesheet\">');\n }\n \n nIndex++;\n });\n });\n }\n \n const showDesigns = (catId) => {\n\n if(template_list.length>0) {\n const wait = document.querySelector('.is-waiting');\n wait.style.display = 'none';\n }\n \n const designList = document.querySelector('.is-design-list');\n designList.style.opacity = 0;\n setTimeout(()=>{\n designList.innerHTML = '';\n designList.style.opacity = 1;\n \n let nIndex = 0;\n \n template_list.forEach(gallery=>{\n let designs = gallery.designs;\n designs.forEach(item=>{\n let isSelected = false;\n let catSplit = item.category.split(',');\n for (let j = 0; j < catSplit.length; j++) {\n if (parseInt(catSplit[j]) === parseInt(catId)) {\n isSelected = true;\n }\n }\n \n item.id = nIndex; //Give id\n \n if (isSelected) {\n \n let html = '<button tabindex=\"0\" class=\"active\" data-id=\"' + item.id + '\" data-cat=\"\"' + item.category + '\">' +\n '<img class=\"lzy-img\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAaCAYAAAAjZdWPAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38Ip+f4At1Rq/sjr6NEwQqb/I/DQqsLvaFUjvAx+eWirddAJZnAj1DFJL0mSg/gcIpPkMBkhoyCSJ8lTZIxk0TpKDjXHliJzZPO50dR5ASNSnzeLvIvod0HG/mdkmOC0z8VKnzcQ2M/Yz2vKldduXjp9bleLu0ZWn7vWc+l0JGcaai10yNrUnXLP/8Jf59ewX+c3Wgz+B34Df+vbVrc16zTMVgp9um9bxEfzPU5kPqUtVWxhs6OiWTVW+gIfywB9uXi7CGcGW/zk98k/kmvJ95IfJn/j3uQ+4c5zn3Kfcd+AyF3gLnJfcl9xH3OfR2rUee80a+6vo7EK5mmXUdyfQlrYLTwoZIU9wsPCZEtP6BWGhAlhL3p2N6sTjRdduwbHsG9kq32sgBepc+xurLPW4T9URpYGJ3ym4+8zA05u44QjST8ZIoVtu3qE7fWmdn5LPdqvgcZz8Ww8BWJ8X3w0PhQ/wnCDGd+LvlHs8dRy6bLLDuKMaZ20tZrqisPJ5ONiCq8yKhYM5cCgKOu66Lsc0aYOtZdo5QCwezI4wm9J/v0X23mlZXOfBjj8Jzv3WrY5D+CsA9D7aMs2gGfjve8ArD6mePZSeCfEYt8CONWDw8FXTxrPqx/r9Vt4biXeANh8vV7/+/16ffMD1N8AuKD/A/8leAvFY9bLAAAAOGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAACoAIABAAAAAEAAAAtoAMABAAAAAEAAAAaAAAAAHZhQ/wAAABcSURBVFgJ7dLBCcAwEANBx/337IQUsK/FcLD3FQgx9nO+W8NuD9v7z230rVdLOmkQ6HsAjholrXJCWdKAo0ZJq5xQljTgqFHSKieUJQ04apS0ygllSQOOGo2UfgEpPQQwSb0YngAAAABJRU5ErkJggg==\" data-src=\"' + gallery.path + item.thumbnail + '\">' +\n '<span class=\"is-overlay\"></span>' +\n '</button>';\n \n if(item.type === 'glide' || item.type === 'slick') {\n if(slider==='glide') {\n if(item.type === 'glide') {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n } \n } else if(slider==='slick') {\n if(item.type === 'slick') {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n } \n } else if(slider==='all') {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n } \n } else if(item.type === 'navbar' ) {\n if(navbar) {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n }\n } else {\n designList.insertAdjacentHTML('beforeend', html);\n const btn = designList.querySelector('[data-id=\"' + item.id + '\"]');\n btn.addEventListener('click', (e)=>{\n const designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n }\n }",s+="\n nIndex++;\n });\n });\n \n const arr = document.querySelectorAll('img.lzy-img')\n arr.forEach((v) => {\n imageObserver.observe(v);\n });\n \n closeMegaMenu();\n \n }, 200);\n \n // Set active Button\n const menu = document.querySelector('.mega-menu');\n menu.setAttribute('data-active-cat', catId);\n const featuredCat = document.querySelector('.featured-categories');\n const btnActive1 = menu.querySelector('button.on');\n const btnActive2 = featuredCat.querySelector('button.on');\n if(btnActive1) btnActive1.classList.remove('on');\n if(btnActive2) btnActive2.classList.remove('on');\n const btn1 = menu.querySelector('[data-cat=\"' + catId + '\"]');\n const btn2 = featuredCat.querySelector('[data-cat=\"' + catId + '\"]');\n if(btn1) btn1.classList.add('on');\n if(btn2) btn2.classList.add('on');\n }\n \n const renderMegaMenu = () => {\n \n if(template_list.length>0) {\n const wait2 = document.querySelector('.is-waiting2');\n wait2.style.display = 'none';\n }\n\n const menu = document.querySelector('.mega-menu');\n const menuContent = document.querySelector('.mega-menu-content');\n menuContent.innerHTML = '';\n \n let catNum = 0;\n template_list.forEach(gallery=>{\n let categories = gallery.categories;\n let html = '<h2>'+parent._cb.out(gallery.name)+'</h2><div class=\"cat' +catNum+ '\"></div>';\n menuContent.insertAdjacentHTML('beforeend', html);\n const catList = menuContent.querySelector('.cat'+catNum);\n categories.forEach(categoryItem=>{\n let html= '<button data-cat=\"'+categoryItem.id+'\">'+parent._cb.out(categoryItem.name)+'</button>';\n catList.insertAdjacentHTML('beforeend', html);\n const btn = catList.querySelector('[data-cat=\"'+categoryItem.id+'\"]');\n btn.addEventListener('click', (e)=>{\n const catId = btn.getAttribute('data-cat');\n showDesigns(catId);\n \n closeMegaMenu();\n });\n });\n \n catNum++;\n });\n \n // Set active Button\n const catId = menu.getAttribute('data-active-cat');\n if(catId) {\n const btnActive = menu.querySelector('button.on');\n if(btnActive) btnActive.classList.remove('on');\n const btn = menu.querySelector('[data-cat=\"' + catId + '\"]');\n if(btn) btn.classList.add('on');\n }\n }\n \n const handleClick = (e) => {\n if(!e.target.closest('.mega-menu') && !e.target.closest('[data-cat=\"0\"]')) { \n closeMegaMenu();\n }\n };\n \n const showMegaMenu = () => {\n const menu = document.querySelector('.mega-menu');\n menu.style.display = 'block';\n setTimeout(()=>{\n menu.classList.add('active');\n const menuClose = menu.querySelector('.close');\n menuClose.focus();\n }, 10);\n const btn = document.querySelector('[data-cat=\"0\"]');\n btn.classList.add('on');\n \n document.addEventListener('click', handleClick);\n parent.document.addEventListener('click', handleClick); \n }\n \n const closeMegaMenu = () => {\n const menu = document.querySelector('.mega-menu.active');\n if(!menu) return;\n menu.classList.remove('active');\n setTimeout(()=>{\n menu.style.display = '';\n }, 300);\n const btn = document.querySelector('[data-cat=\"0\"]');\n btn.classList.remove('on');\n \n document.removeEventListener('click', handleClick);\n parent.document.removeEventListener('click', handleClick); \n }\n \n const renderResize = () => {\n const btns = document.querySelectorAll('.featured-categories button');\n let viewportWidth = document.body.clientWidth;\n if(viewportWidth < 1024 && viewportWidth>=800) {\n let n = 0;\n btns.forEach(btn=>{\n if(n>=5) {\n btns[n].style.display = 'none';\n } else {\n btns[n].style.display = '';\n }\n n++;\n });\n } else if(viewportWidth < 800) {\n let n = 0;\n btns.forEach(btn=>{\n if(n>=2) {\n btns[n].style.display = 'none';\n } else {\n btns[n].style.display = '';\n }\n n++;\n });\n } else {\n let n = 0;\n btns.forEach(btn=>{\n btns[n].style.display = '';\n n++;\n });\n }\n btns[btns.length-1].style.display = '';\n };\n\n const renderFeaturedCategories= () => {\n let html = '';\n const div = document.querySelector('.featured-categories');\n featuredCategories.forEach(item=>{\n html += '<button data-cat=\"'+item.id+'\">'+parent._cb.out(item.name)+'</button>';\n });\n html += '<button data-cat=\"0\">'+parent._cb.out('All Categories')+'</button>';\n div.insertAdjacentHTML('beforeend', html);\n \n const menu = document.querySelector('.mega-menu');\n const btns = div.querySelectorAll('[data-cat]');\n btns.forEach(btn=>{\n btn.addEventListener('click', (e)=>{\n const catId = btn.getAttribute('data-cat');\n if(catId==='0') {\n // Show All Categories' Mega Menu\n showMegaMenu();\n } else {\n showDesigns(catId);\n }\n });\n });",s+="\n const menuClose = menu.querySelector('.close');\n menuClose.addEventListener('click',()=>{\n closeMegaMenu();\n });\n\n renderResize();\n }\n \n document.addEventListener(\"DOMContentLoaded\", function() {\n \n renderFeaturedCategories();\n \n const wait = document.querySelector('.is-waiting');\n wait.style.display = 'flex';\n const wait2 = document.querySelector('.is-waiting2');\n wait2.style.display = 'flex';\n\n renderMegaMenu();\n \n showDesigns(defaultCat); // If not ready (not loaded yet) will show empty\n \n loadJsFiles(templateJSON, (template)=>{\n // console.log(template)\n const templateAdded = template_list[template_list.length-1];\n templateAdded.path = template.path;\n templateAdded.pathReplace = template.pathReplace;\n // console.log(templateAdded);\n \n renderMegaMenu();\n \n const designList = document.querySelector('.is-design-list');\n if(designList.innerHTML.trim()==='') { // first load\n const cats = templateAdded.categories;\n cats.forEach(cat=>{\n if(parseInt(cat.id)===defaultCat) {\n showDesigns(defaultCat);\n }\n });\n }\n });\n })\n \n \n document.addEventListener('keydown', (e)=>{\n if(e.keyCode === 27) { // escape key\n \n const menu = document.querySelector('.mega-menu.active');\n if(menu) {\n closeMegaMenu();\n \n e.preventDefault();\n return;\n } \n }\n });\n\n window.addEventListener('resize', ()=>{\n renderResize();\n });\n\n applyParentStyles();\n \n // Style stuff\n function applyParentStyles() {\n var cssString = '' +\n 'body {' +\n 'background: ' + parent._cb.styleSnippetBackground + ';' +\n 'color: ' + parent._cb.styleSnippetColor + ';' +\n 'margin: 0;' +\n '}' +\n\n 'button {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackground + ';' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n '}' +\n 'button.on {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackgroundActive + ';' +\n '}' +\n '.featured-categories {' +\n 'background-color: ' + parent._cb.styleSnippetTabsBackground + ';' +\n '}' +\n\n '.dark .is-design-list > button {' +\n 'border: transparent 1px solid;' +\n '}' +\n\n '.mega-menu {' +\n 'background: ' + parent._cb.styleSnippetTabsBackground + ';' +\n '}' +\n\n '.is-waiting {' +\n 'background: ' + parent._cb.styleSnippetBackground + ';' +\n '}' +\n '.is-waiting2 {' +\n 'background-color: ' + parent._cb.styleSnippetTabsBackground + ';' +\n '}' +\n\n '.dark .path {' +\n 'stroke: #b3b3b3;' +\n '}' +\n\n '/* Scrollbar for modal */' +\n\n '/* Darker color, because background for snippet thumbnails is always light. */' +\n '.dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(78 78 78 / 62%) auto;' +\n '}' +\n '.dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(78 78 78 / 62%);' +\n '}' +\n\n '.colored-dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(100, 100, 100) auto;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(100, 100, 100);' +\n '}' +\n\n '.colored * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.colored *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n\n '.light * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.light *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.light *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.light *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n \n 'svg {' +\n 'fill: ' + parent._cb.styleSnippetColor + ';' +\n '}' +\n\n '.dark .is-design-list>div .is-overlay:after {' +\n 'background: rgb(78 78 78 / 13%);' +\n '}' +\n '';\n \n let themestyle = document.querySelector('[data-theme-style]');\n if(themestyle) themestyle.parentNode.removeChild(themestyle);\n \n var style = document.createElement(\"style\");\n style.setAttribute('data-theme-style','');\n style.type = \"text/css\";\n style.innerHTML = cssString;\n document.head.appendChild(style);\n\n if(parent._cb.styleDark) {\n document.body.setAttribute('class', 'dark');\n } else if(parent._cb.styleColored) {\n document.body.setAttribute('class', 'colored');\n } else if(parent._cb.styleColoredDark) {\n document.body.setAttribute('class', 'colored-dark');\n } else if(parent._cb.styleLight) {\n document.body.setAttribute('class', 'light');\n } else {\n document.body.setAttribute('class', '');\n }\n }\n <\/script>\n </body>\n </html>\n ",s}getTemplatesHtml_OLD(){const t=this.builder.designUrl1,e=this.builder.designUrl2;let i=`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title></title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style> \n body {\n /* background: rgba(255,255,255,0.7); */\n margin: 0;\n }\n \n .is-design-list {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 80px solid;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n padding: 0px 0px 30px 0px;\n box-sizing: border-box;\n overflow: auto;\n }\n \n .is-design-list>div {\n position:relative;\n /* background: #fff; */\n width: 250px;\n overflow: hidden;\n margin: 32px 0 0 30px;\n cursor: pointer;\n display: inline-block;\n outline: rgba(219, 219, 219, 0.39) 1px solid;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n border-radius:2px;\n }\n \n .is-design-list>div img {\n box-shadow: none;\n opacity: 1;\n display: block;\n box-sizing: border-box;\n transition: all 0.2s ease-in-out;\n max-width: 400px;\n width: 100%\n }\n \n .is-overlay {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n }\n .is-design-list>div .is-overlay:after {\n background: rgba(0, 0, 0, 0.03);\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transition: all 0.3s ease-in-out;\n opacity: 0;\n }\n .is-design-list>div:hover .is-overlay:after {\n opacity: 0.9;\n }\n \n .is-category-list {\n position: relative;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 80px;\n /* background: #f5f5f5; */\n box-sizing: border-box;\n z-index: 1;\n }\n \n .is-category-list>div {\n display: inline-block;\n white-space: nowrap;\n padding: 13px 10px 0 20px;\n box-sizing: border-box;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n /* background: #f5f5f5; */\n }\n \n .is-category-list > div > div {\n margin-bottom:10px;\n margin-left:5px;\n }\n .is-category-list > div > a {\n display: inline-block;\n padding: 10px 25px;\n /* background: #fefefe;\n color: #000; */\n border-radius: 50px;\n \n margin: 0 15px 8px 0;\n text-decoration: none;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);\n }\n \n .is-category-list > div > a:hover {\n /* background: #fafafa;\n color: #000; */\n }\n .is-category-list > div > a.active {\n /* background: #f5f5f5;\n color: #000; */\n box-shadow: none;\n }\n \n .is-category-list a:focus {\n outline: ${this.builder.editor.styleOutlineColor} 2px solid;\n }\n\n .is-design-list>div:focus {\n outline: ${this.builder.editor.styleOutlineColor} 2px solid;\n }\n \n `;return i+="\n \n .is-more-categories {\n display: none;\n flex-flow: wrap;\n position: absolute;\n width: 400px;\n box-sizing: border-box;\n padding: 0;\n z-index: 1;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n /* background: #fff; */\n }\n \n .is-more-categories a {\n width: 200px;\n float: left;\n display: block;\n box-sizing: border-box;\n padding: 12px 20px;\n /* background: #fff; */\n text-decoration: none;\n /* color: #000; */\n line-height: 1.6;\n }\n \n /* .is-more-categories a:hover {\n background:#eee;\n }\n .is-more-categories a.active {\n background:#eee;\n } */\n .is-more-categories.active {\n display: flex;\n }\n\n /*\n .is-category-list {visibility:hidden}\n .is-more-categories {visibility:hidden}\n */\n \n /* Responsive */\n .is-category-list > div > a.more-basic {display:none}\n .is-category-list > div > .screen1 {display:inline-block}\n .is-more-categories .screen1 {display:none}\n .is-category-list > div > .screen2 {display:inline-block}\n .is-more-categories .screen2 {display:none} \n @media all and (max-width: 970px) {\n .is-category-list > div > .screen1 {display:none}\n .is-more-categories .screen1 {display:block}\n .is-category-list > div > a.more-basic {display:inline-block}\n } \n @media all and (max-width: 690px) {\n .is-category-list > div > .screen2 {display:none}\n .is-more-categories .screen2 {display:block}\n .is-category-list > div > a.more-basic {display:inline-block}\n } \n .is-more-categories a.cms-option {display:none}\n \n /* Enable Module/Placeholder \n .is-category-list > div > a.more-basic {display:inline-block}\n .custom {display:none} \n .is-more-categories a.cms-option {display:block}\n */\n \n \n /* First Loading */\n .is-category-list {opacity:0;transition: opacity ease 0.3s;} \n .is-design-list {opacity:0;transition: opacity ease 0.3s;} \n \n </style> \n </head>",i+=`<body>\n \n <div class="is-category-list">\n \x3c!--<a href="" data-cat="0">Default</a>--\x3e\n <div style="border-right: rgba(255,255,255,0.1) 1px solid;">\n <div>${n("Simple Start:")}</div>\n <a href="" data-cat="5">${n("Random")}</a>\n <a href="" data-cat="1" class="screen2">Basic</a>\n <a href="" class="slider-section screen2" data-cat="2">${n("Slider")}</a>\n <a href="" data-cat="3" class="screen1 screen2">${n("Video")}</a>\n <a href="" data-cat="4" class="screen1 screen2 custom">${n("Custom")}</a>\n <a href="" class="more-basic">${n("More")}</a>\n </div>\n <div>\n <div>Quick Start: </div>\n <a href="" data-cat="101" class="screen2">${n("Header")}</a>\n <a href="" data-cat="118" class="screen2">${n("Article")}</a>\n <a href="" data-cat="103" class="screen1 screen2">${n("Profile")}</a>\n <a href="" class="more-examples">${n("More")}</a>\n </div>\n </div>\n <div id="morebasic" class="is-more-categories" style="width:200px">\n <a href="" data-cat="1" class="screen2">${n("Basic")}</a>\n <a href="" data-cat="2" class="screen2">${n("Slider")}</a>\n <a href="" data-cat="3" class="screen1">${n("Video")}</a>\n <a href="" data-cat="4" class="screen1">${n("Custom")}</a>\n\n <a href="" data-cat="51" class="cms-option">${n("Module")}</a>\n <a href="" data-cat="52" class="cms-option">${n("Placeholder")}</a>\n </div>\n <div id="morecat" class="is-more-categories">\n <a href="" data-cat="101" class="screen2">${n("Header")}</a>\n <a href="" data-cat="118" class="screen2">${n("Article")}</a>\n <a href="" data-cat="103" class="screen1 screen2">${n("Profile")}</a>\n\n <a href="" data-cat="102">${n("Photos")}</a>\n <a href="" data-cat="104">${n("Products, Services")}</a>\n <a href="" data-cat="105">${n("Features")}</a>\n <a href="" data-cat="106">${n("Process")}</a>\n <a href="" data-cat="107">${n("Pricing")}</a>\n <a href="" data-cat="108">${n("Skills")}</a>\n <a href="" data-cat="109">${n("Achievements")}</a>\n <a href="" data-cat="110">${n("Quotes")}</a>\n <a href="" data-cat="111">${n("Partners")}</a>\n <a href="" data-cat="112">${n("As Featured On")}</a> \n <a href="" data-cat="113">${n("Page Not Found")}</a>\n <a href="" data-cat="114">${n("Coming Soon")}</a>\n <a href="" data-cat="115">${n("Help, FAQ")}</a>\n <a href="" data-cat="116">${n("Contact")}</a>\n <a href="" data-cat="117" class="static-section">${n("Footer")}</a>\n \n <div class="template-extension" style="display:none">\n \x3c!--\n <div style="font-weight: 600;padding: 15px 0 10px 19px;width: 100%;position: relative !important;border-top: rgb(0 0 0 / 4%) 1px solid;">\n Writing Set\n </div>\n <div>\n <a href="" data-cat="102">${n("General")}</a>\n <a href="" data-cat="108">${n("Agency")}</a>\n <a href="" data-cat="114">${n("Travel")}</a>\n <a href="" data-cat="116">${n("Food")}</a>\n </div>\n --\x3e\n </div>\n\n </div>\n\n <div class="is-design-list">\n </div>\n \n <script src="${t}" type="text/javascript"><\/script> \n <script src="${e}" type="text/javascript"><\/script> \n \n <script>\n\n applyParentStyles();\n setTimeout(()=>{\n document.querySelector('.is-category-list').style.opacity = 1;\n document.querySelector('.is-design-list').style.opacity = 1;\n },300);\n\n \n function hasClass(element, classname) {\n if(!element) return false;\n try{\n let s = element.getAttribute('class');\n if(!s) return false;\n let exists = false;\n s.split(' ').forEach((item)=>{\n if(item===classname) {\n exists=true;\n }\n });\n return exists;\n } catch(e) { \n // Do nothing\n }\n }\n\n function appendHtml(parent, html) {\n parent.insertAdjacentHTML('beforeend', html);\n }\n function addClass(element, classname) {\n if(!element) return;\n if(element.length) {\n element.forEach((elm) => {\n _addClass(elm, classname);\n })\n return;\n } \n _addClass(element, classname);\n \n }`,i+=`\n function _addClass(element, classname) {\n if(!element) return;\n if(element.length) {\n return;\n } \n if(hasClass(element,classname)) return;\n if(element.classList.length===0) element.className = classname;\n else element.className = element.className + ' ' + classname;\n element.className = element.className.replace(/ +/g, ' ');\n }\n\n function _removeClass(element, classname) {\n if(!element) return;\n if(!element) return;\n if(element.classList.length>0) {\n let i, j, imax, jmax;\n let classesToDel = classname.split(' ');\n for (i=0, imax=classesToDel.length; i<imax; ++i) {\n if (!classesToDel[i]) continue;\n let classtoDel = classesToDel[i];\n \n let sClassName = ''; \n let currentClasses = element.className.split(' ');\n for (j=0, jmax=currentClasses.length; j<jmax; ++j) {\n if (!currentClasses[j]) continue;\n if (currentClasses[j]!==classtoDel) sClassName += currentClasses[j] + ' ';\n }\n element.className = sClassName.trim();\n }\n if(element.className==='') element.removeAttribute('class');\n }\n }\n function removeClass(element, classname) {\n if(!element) return;\n if(element.length) {\n element.forEach((elm) => {\n _removeClass(elm, classname);\n })\n return;\n } \n _removeClass(element, classname);\n }\n function getElementOffset(el) {\n const rect = el.getBoundingClientRect();\n \n return {\n top: rect.top + window.pageYOffset,\n left: rect.left + window.pageXOffset,\n width: rect.width,\n height: rect.height\n };\n }\n \n var defaultCat = ${this.builder.defaultDesignCategory}; //Show 'Header' category: 101\n var disableStaticSection = false;\n try {\n disableStaticSection = ${this.builder.disableStaticSection};\n } catch (e) { }\n if (disableStaticSection) document.querySelector('.static-section').style.display = 'none';\n\n var elm = document.querySelector('.is-category-list');\n var tab = elm.querySelector('[data-cat="' + defaultCat + '"]');\n if(tab) addClass(tab,'active');\n\n elm = document.querySelector('#morecat');\n tab = elm.querySelector('[data-cat="' + defaultCat + '"]');\n if(tab) addClass(tab,'active');\n\n elm = document.querySelector('#morebasic');\n tab = elm.querySelector('[data-cat="' + defaultCat + '"]');\n if(tab) addClass(tab,'active');\n \n /*\n elm = document.querySelector('.is-category-list');\n elm.style.visibility = 'visible';\n var elms = document.querySelectorAll('.is-more-categories'); \n elms.forEach(function(elm){\n elm.style.visibility = 'visible';\n });\n */\n\n var nIndex = 1;\n var path = '${this.builder.designPath}';\n var navbar = ${this.builder.navbar};\n data_basic.designs.forEach(function(item){\n\n var isdefault = false;\n var catSplit = item.category.split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == defaultCat) {\n isdefault = true;\n }\n }\n item.id = nIndex; //Give id to each record\n \n if (isdefault) {\n var elm = document.querySelector('.is-design-list');\n\n var html = '<div role="button" tabindex="0" class="active" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path + item.thumbnail + '"><span class="is-overlay"></span></div>';\n //appendHtml(elm, html);\n\n if(item.type === 'navbar' ) {\n if(navbar) {\n appendHtml(elm, html);\n }\n } else {\n appendHtml(elm, html);\n }\n }\n \n nIndex++;\n });`,i+="\n data_examples.designs.forEach(function(item){\n\n var isdefault = false;\n var catSplit = item.category.split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == defaultCat) {\n isdefault = true;\n }\n }\n item.id = nIndex; //Give id to each record\n \n if (isdefault) {\n var elm = document.querySelector('.is-design-list');\n var html = '<div role=\"button\" tabindex=\"0\" data-id=\"' + item.id + '\" data-cat=\"' + item.category + '\"><img src=\"' + path + item.thumbnail + '\"><span class=\"is-overlay\"></span></div>';\n appendHtml(elm, html);\n }\n \n nIndex++;\n });\n\n var btnMore1 = document.querySelector('.more-basic');\n var btnMore2 = document.querySelector('.more-examples');\n btnMore1.addEventListener('click', function(e){\n let elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms, 'active');\n\n addClass(btnMore1, 'active');\n removeClass(btnMore2, 'active');\n\n let elm = document.querySelector('#morebasic');\n addClass(elm, 'active');\n\n var top = getElementOffset(btnMore1).top;\n var left = getElementOffset(btnMore1).left;\n top = top + 42;\n elm.style.top = top + 'px';\n elm.style.left = left + 'px';\n e.preventDefault();\n });\n btnMore2.addEventListener('click', function(e){\n let elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms, 'active');\n\n addClass(btnMore2, 'active');\n removeClass(btnMore1, 'active');\n\n let elm = document.querySelector('#morecat');\n addClass(elm, 'active');\n\n var top = getElementOffset(btnMore2).top;\n var left = getElementOffset(btnMore2).left;\n top = top + 42;\n elm.style.top = top + 'px';\n elm.style.left = 'auto';\n elm.style.right = '0px';\n e.preventDefault();\n });\n\n elms = document.querySelectorAll('.is-more-categories a');\n elms.forEach(function(elm){\n elm.addEventListener('click', function(e){\n\n selectCategory(elm);\n \n let cat = e.target.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n\n e.preventDefault();\n });\n });\n\n elms = document.querySelectorAll('.is-category-list a');\n elms.forEach(function(elm){\n elm.addEventListener('click', function(e){\n \n if(!elm.getAttribute('data-cat')) return;\n\n selectCategory(elm);\n \n e.preventDefault();\n });\n });\n\n var div = document.querySelectorAll('.is-design-list div');\n div.forEach(function(btn){\n btn.addEventListener('click', function(e){\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n btn.addEventListener('keydown', function(e){\n //Extra \n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n const items = e.target.parentNode.querySelectorAll('.active');\n if(items.length>0) {\n let lastItem = items[items.length-1];\n if(e.target===lastItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n }\n } else if ((e.which === 9 && e.shiftKey)) { // tab + shift key pressed\n const firstItem = e.target.parentNode.querySelector('.active');\n if(e.target===firstItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = firstItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n }\n });\n });\n\n document.addEventListener(\"click\", function(e) {\n var btn1 = document.querySelector('.more-basic');\n var btn2 = document.querySelector('.more-examples');\n var targetEl = e.target; // clicked element \n do {\n if(targetEl == btn1 || targetEl == btn2) {\n // Click inside\n return;\n }\n targetEl = targetEl.parentNode;\n } while (targetEl);\n\n // Click outside\n\n var elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms,'active');\n removeClass(btn1,'active');\n removeClass(btn2,'active');\n });",i+=`\n parent.document.addEventListener("click", function(e) {\n var btn1 = document.querySelector('.more-basic');\n var btn2 = document.querySelector('.more-examples');\n \n var elms = document.querySelectorAll('.is-more-categories');\n removeClass(elms,'active');\n removeClass(btn1,'active');\n removeClass(btn2,'active');\n });\n\n // elm = document.querySelector('.is-category-list');\n // elm.style.display = 'block';\n elm = document.querySelector('.is-design-list');\n elm.style.display = 'block';\n\n var slider = '${this.builder.slider}';\n var navbar = ${this.builder.navbar};\n\n if(slider==='') document.querySelector('.slider-section').style.display = 'none';\n\n function selectCategory(elm) {\n \n var cat = elm.getAttribute('data-cat');\n var div = document.querySelector('.is-design-list');\n var items = div.querySelectorAll('[data-cat="' + cat + '"]');\n if(items.length == 0) {\n \n data_basic.designs.forEach(function(item){\n if (cat == item.category) {\n\n if(item.type === 'glide' || item.type === 'slick') {\n if(slider==='glide') {\n if(cat === '2') {\n if(item.type === 'glide') {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n } \n } \n } else if(slider==='slick') {\n if(cat === '2') {\n if(item.type === 'slick') {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n } \n } \n } else if(slider==='all') {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n } \n } else if(item.type === 'navbar' ) {\n if(navbar) {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n }\n } else {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n }\n \n }\n });\n data_examples.designs.forEach(function(item){\n if (cat == item.category) {\n appendHtml(div, '<div role="button" tabindex="0" data-id="' + item.id + '" data-cat="' + item.category + '"><img src="' + path+item.thumbnail + '"><span class="is-overlay"></span></div>');\n }\n });\n\n items = div.querySelectorAll('[data-cat="' + cat + '"]');\n items.forEach(function(btn){\n btn.addEventListener('click', function(e){\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n });\n btn.addEventListener('keydown', function(e){\n //Extra \n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n const items = e.target.parentNode.querySelectorAll('.active');\n if(items.length>0) {\n let lastItem = items[items.length-1];\n if(e.target===lastItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n }\n } else if ((e.which === 9 && e.shiftKey)) { // tab + shift key pressed\n const firstItem = e.target.parentNode.querySelector('.active');\n if(e.target===firstItem) {\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = firstItem.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n \n e.preventDefault();\n }\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n var designid = btn.getAttribute('data-id');\n addDesign(designid);\n }\n });\n });\n\n }\n\n var _elms = document.querySelectorAll('.is-category-list a');\n removeClass(_elms,'active');\n _elms = document.querySelectorAll('.is-more-categories a');\n removeClass(_elms,'active');\n addClass(elm,'active');\n \n if (cat) {\n _elms = document.querySelectorAll('.is-design-list div');\n _elms.forEach(function(elm) {\n elm.style.display = 'none';\n elm.classList.remove('active');\n });\n _elms.forEach(function(elm) {\n var catSplit = elm.getAttribute('data-cat').split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == cat) {\n elm.style.display = '';\n elm.classList.add('active');\n }\n }\n });\n \n }\n\n _elms = document.querySelectorAll('.is-more-categories');\n removeClass(_elms,'active');\n }`,i+=`\n\n let categorylist = document.querySelector('.is-category-list');\n let designlist = document.querySelector('.is-design-list');\n\n let inputTabs = [];\n let inputTabsAll = document.querySelectorAll('.is-category-list a');\n inputTabsAll.forEach((item)=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='inline-block') {\n item.classList.add('show');\n inputTabs.push(item);\n } else {\n item.classList.remove('show');\n }\n });\n let index = 0;\n inputTabs.forEach((item)=>{\n\n let nextItem = inputTabs[index+1];\n let prevItem = inputTabs[index-1];\n \n item.addEventListener('keydown', (e)=>{\n e.preventDefault();\n \n if (e.which === 39) { // arrow right key pressed\n if(nextItem) nextItem.focus();\n } else if (e.which === 37) { // arrow left key pressed\n if(prevItem) prevItem.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n \n if(e.target===btnMore1) {\n \n btnMore1.click();\n\n e.preventDefault();\n e.stopImmediatePropagation();\n } else if(e.target===btnMore2) {\n \n btnMore2.click();\n\n e.preventDefault();\n e.stopImmediatePropagation();\n } else {\n\n selectCategory(e.target);\n \n }\n } else if(e.which === 40 && (e.target.classList.contains('more-basic') || e.target.classList.contains('more-examples'))) { // down\n\n // Redirect to dropdown list\n let firstItem;\n let activeItem;\n let moreCategories = document.querySelector('.is-more-categories.active');\n let items = moreCategories.querySelectorAll('a');\n items.forEach(item=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='block') {\n item.classList.add('show');\n if(item.classList.contains('active')) {\n activeItem=item;\n }\n } else {\n item.classList.remove('show');\n }\n });\n firstItem = moreCategories.querySelector('.show');\n if(activeItem) {\n activeItem.focus();\n } else {\n firstItem.focus();\n }\n\n } else if (e.which === 27) {\n // let moreCategories = document.querySelector('.is-more-categories.active');\n // if(moreCategories) moreCategories.classList.remove('active');\n // let activeTab = document.querySelector('.more-basic.active,.more-examples.active');\n // if(activeTab) activeTab.focus();\n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n\n if(inputs.length===0) return;\n\n let firstInput = inputs[0];\n\n firstInput.focus();\n\n let lastInput = inputs[inputs.length-1];\n \n lastInput.addEventListener('keydown', (e)=>{\n \n e.preventDefault();\n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastInput.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n }\n });\n } \n \n });\n index++;\n });\n\n\n let dropdownItems = document.querySelectorAll('.is-more-categories a');\n Array.prototype.forEach.call(dropdownItems, (item) => {\n\n item.addEventListener('keydown', (e)=>{\n e.preventDefault();\n if(e.keyCode === 38 && e.target.previousElementSibling && window.getComputedStyle(e.target.previousElementSibling).getPropertyValue('display')==='block') { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling && window.getComputedStyle(e.target.nextElementSibling).getPropertyValue('display')==='block') { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n selectCategory(e.target);\n\n let cat = e.target.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n \n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n \n if(inputs.length===0) return;\n \n let firstInput = inputs[0];\n \n firstInput.focus();\n\n let lastInput = inputs[inputs.length-1];\n \n lastInput.addEventListener('keydown', (e)=>{\n \n e.preventDefault();\n if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n let tab = document.querySelector('.is-category-list a.active');\n if(tab) tab.focus();\n else {\n let cat = lastInput.getAttribute('data-cat');\n if(cat==='1'||cat==='2'||cat==='3'||cat==='4'||cat==='5'||cat==='51'||cat==='52') {\n document.querySelector('.more-basic').focus();\n } else {\n document.querySelector('.more-examples').focus();\n }\n }\n }\n });\n }\n \n });\n \n // item.addEventListener('click', (e)=>{\n // e.preventDefault();\n\n // e.target.focus();\n \n // selectCategory(e.target);\n // });\n });\n\n function addDesign(designid) {\n \n // var wrapper = parent.document.querySelector('.is-wrapper');\n var wrapper = parent._cb.doc.querySelector('.is-wrapper');\n\n var framework = '${this.builder.framework}';\n var snippetPathReplace = [];\n ${this.builder.designPathReplace.length>0?`\n snippetPathReplace = ['${this.builder.designPathReplace[0]}', '${this.builder.designPathReplace[1]}'];\n `:""}\n \n var contentStylePath = '${this.builder.contentStylePath}';\n var html = '';\n var result = data_basic.designs.filter(function(element){ \n if(element.id === parseInt(designid)) return element;\n });\n if (result.length==0) {\n result = data_examples.designs.filter(function(element){ \n if(element.id === parseInt(designid)) return element;\n });\n }\n\n var html = result[0].html;\n var googleFonts = result[0].googleFonts;\n var contentCss = result[0].contentCss;\n var contentClass = result[0].contentClass;\n\n //To Tailwind\n if (framework == 'tailwind') {\n html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'flex flex-col md:flex-row');\n html = html.replace(new RegExp('column full', 'g'), 'w-full px-4');\n html = html.replace(new RegExp('column half', 'g'), 'w-full md:w-6/12 px-4');\n html = html.replace(new RegExp('column third', 'g'), 'w-full md:w-4/12 px-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'w-full md:w-3/12 px-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'w-full md:w-2/12 px-4'); //not needed\n html = html.replace(new RegExp('column sixth', 'g'), 'w-full md:w-2/12 px-4');\n html = html.replace(new RegExp('column two-third', 'g'), 'w-full md:w-8/12 px-4');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'w-full md:w-9/12 px-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'w-full md:w-10/12 px-4');\n }\n \n //To Bootstrap\n if (framework == 'bootstrap') {\n html = html.replace(new RegExp(' container', 'g'), ' container-fluid');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'col-md-12');\n html = html.replace(new RegExp('column half', 'g'), 'col-md-6');\n html = html.replace(new RegExp('column third', 'g'), 'col-md-4');\n html = html.replace(new RegExp('column fourth', 'g'), 'col-md-3');\n html = html.replace(new RegExp('column fifth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column sixth', 'g'), 'col-md-2');\n html = html.replace(new RegExp('column two-third', 'g'), 'col-md-8');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'col-md-9');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'col-md-10');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'btn btn-primary btn-lg');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'btn btn-default btn-lg');\n }\n\n //To Foundation\n if (framework == 'foundation') {\n //html = html.replace(new RegExp(' container', 'g'), ' container');\n html = html.replace(new RegExp('row clearfix', 'g'), 'row');\n html = html.replace(new RegExp('column full', 'g'), 'large-12 columns');\n html = html.replace(new RegExp('column half', 'g'), 'large-6 columns');\n html = html.replace(new RegExp('column third', 'g'), 'large-4 columns');\n html = html.replace(new RegExp('column fourth', 'g'), 'large-3 columns');\n html = html.replace(new RegExp('column fifth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column sixth', 'g'), 'large-2 columns');\n html = html.replace(new RegExp('column two-third', 'g'), 'large-8 columns');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'large-9 columns');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'large-10 columns');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'button');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'secondary button');\n }\n\n //To UIKit\n if (framework == 'uikit') {\n html = html.replace(new RegExp(' container', 'g'), ' uk-container uk-container-center');\n html = html.replace(new RegExp('row clearfix', 'g'), 'uk-grid');\n html = html.replace(new RegExp('column full', 'g'), 'uk-width-1-1');\n html = html.replace(new RegExp('column half', 'g'), 'uk-width-1-2');\n html = html.replace(new RegExp('column third', 'g'), 'uk-width-1-3');\n html = html.replace(new RegExp('column fourth', 'g'), 'uk-width-1-4');\n html = html.replace(new RegExp('column fifth', 'g'), 'uk-width-1-5');\n html = html.replace(new RegExp('column sixth', 'g'), 'uk-width-1-6');\n html = html.replace(new RegExp('column two-third', 'g'), 'uk-width-2-3');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'uk-width-3-4');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'uk-width-5-6');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'uk-button uk-button-primary uk-button-large');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'uk-button uk-button-large');\n }\n\n //To Material\n if (framework == 'material') {\n html = html.replace(new RegExp(' container', 'g'), '');\n html = html.replace(new RegExp('row clearfix', 'g'), 'mdl-grid');\n html = html.replace(new RegExp('column full', 'g'), 'mdl-cell mdl-cell--12-col');\n html = html.replace(new RegExp('column half', 'g'), 'mdl-cell mdl-cell--6-col');\n html = html.replace(new RegExp('column third', 'g'), 'mdl-cell mdl-cell--4-col');\n html = html.replace(new RegExp('column fourth', 'g'), 'mdl-cell mdl-cell--3-col');\n html = html.replace(new RegExp('column fifth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column sixth', 'g'), 'mdl-cell mdl-cell--2-col');\n html = html.replace(new RegExp('column two-third', 'g'), 'mdl-cell mdl-cell--8-col');\n html = html.replace(new RegExp('column two-fourth', 'g'), 'mdl-cell mdl-cell--9-col');\n html = html.replace(new RegExp('column two-sixth', 'g'), 'mdl-cell mdl-cell--10-col');\n html = html.replace(new RegExp('btn btn-primary', 'g'), 'mdl-button mdl-js-button mdl-button--raised mdl-button--accent');\n html = html.replace(new RegExp('btn btn-default', 'g'), 'mdl-button mdl-js-button mdl-button--raised');\n }`,i+="\n\n html = html.replace(/{id}/g, makeid());\n\n if(snippetPathReplace.length>0) {\n if (snippetPathReplace[0] != '') {\n var regex = new RegExp(snippetPathReplace[0], 'g');\n html = html.replace(regex, snippetPathReplace[1]);\n }\n }\n\n //Add html\n parent.contentbox.addIdea(html);\n\n //Add contentCss\n var exist = false;\n var links = parent.document.getElementsByTagName(\"link\");\n for (var i = 0; i < links.length; i++) {\n var src = links[i].href.toLowerCase();\n if (src.indexOf(contentCss.toLowerCase()) != -1) exist = true;\n }\n \n if (!exist) appendHtml(wrapper,'<link data-name=\"contentstyle\" data-class=\"' + contentClass + '\" href=\"' + contentStylePath + contentCss + '\" rel=\"stylesheet\">');\n \n }\n\n function makeid() {//http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n for (var i = 0; i < 2; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n \n var text2 = \"\";\n var possible2 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 5; i++)\n text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));\n \n return text + text2;\n }\n\n \n // Style stuff\n function applyParentStyles() {\n var cssString = '' +\n 'body {' +\n 'background: ' + parent._cb.styleSnippetBackground + ';' +\n 'color: ' + parent._cb.styleSnippetColor + ';' +\n 'margin: 0;' +\n '}' +\n \n\n '.dark .is-design-list>div {' +\n 'outline: transparent 1px solid;' +\n '}' +\n\n '/* Scrollbar for modal */' +\n\n '/* Darker color, because background for snippet thumbnails is always light. */' +\n '.dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(78 78 78 / 62%) auto;' +\n '}' +\n '.dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(78 78 78 / 62%);' +\n '}' +\n\n '.colored-dark * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgb(100, 100, 100) auto;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored-dark *::-webkit-scrollbar-thumb {' +\n 'background-color:rgb(100, 100, 100);' +\n '}' +\n\n '.colored * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.colored *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.colored *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.colored *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n ",i+="\n '.light * {' +\n 'scrollbar-width: thin;' +\n 'scrollbar-color: rgba(0, 0, 0, 0.4) auto;' +\n '}' +\n '.light *::-webkit-scrollbar {' +\n 'width: 12px;' +\n '}' +\n '.light *::-webkit-scrollbar-track {' +\n 'background: transparent;' +\n '}' +\n '.light *::-webkit-scrollbar-thumb {' +\n 'background-color: rgba(0, 0, 0, 0.4);' +\n '}' +\n \n 'svg {' +\n 'fill: ' + parent._cb.styleSnippetColor + ';' +\n '}' +\n\n '.dark .is-design-list>div .is-overlay:after {' +\n 'background: rgb(78 78 78 / 13%);' +\n '}' +\n\n \n '.is-category-list {' +\n 'display: flex;' +\n '}' +\n \n '.is-category-list>div {' +\n 'background: ' + parent._cb.styleSnippetTabsBackground + ';' +\n '}' +\n '.is-category-list>div:last-child {' +\n 'width:100%;' +\n '}' +\n \n '.is-category-list a {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackground + ';' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n 'transition: box-shadow ease 0.3s;' +\n '}' +\n \n '.is-category-list a:hover {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackgroundHover + ';' +\n 'box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n '}' +\n \n '.is-category-list a.active {' +\n 'background: ' + parent._cb.styleSnippetTabItemBackgroundActive + ';' +\n 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +\n 'cursor: default;' +\n '}' +\n\n '.is-more-categories {' +\n 'background: ' + parent._cb.styleSnippetMoreItemBackground + ';' +\n '}' +\n \n '.is-more-categories a {' +\n 'background: ' + parent._cb.styleSnippetMoreItemBackground + ';' +\n 'color: ' + parent._cb.styleSnippetMoreItemColor + ';' +\n '}' +\n \n '.is-more-categories a:hover {' +\n 'background: ' + parent._cb.styleSnippetMoreItemBackgroundHover + ';' +\n '}' +\n \n '.is-more-categories a.active, .is-more-categories a:focus {' +\n ' background: ' + parent._cb.styleSnippetMoreItemBackgroundActive + ';outline:none;' +\n '}';\n \n let themestyle = document.querySelector('[data-theme-style]');\n if(themestyle) themestyle.parentNode.removeChild(themestyle);\n \n var style = document.createElement(\"style\");\n style.setAttribute('data-theme-style','');\n style.type = \"text/css\";\n style.innerHTML = cssString;\n document.head.appendChild(style);\n\n if(parent._cb.styleDark) {\n document.body.setAttribute('class', 'dark');\n } else if(parent._cb.styleColored) {\n document.body.setAttribute('class', 'colored');\n } else if(parent._cb.styleColoredDark) {\n document.body.setAttribute('class', 'colored-dark');\n } else if(parent._cb.styleLight) {\n document.body.setAttribute('class', 'light');\n } else {\n document.body.setAttribute('class', '');\n }\n }\n\n // applyParentStyles();\n\n document.addEventListener('keydown', (e)=>{\n if(e.keyCode === 27) { // escape key\n \n let moreCategories = document.querySelector('.is-more-categories.active');\n if(moreCategories) {\n moreCategories.classList.remove('active');\n\n let activeTab = document.querySelector('.more-basic.active,.more-examples.active');\n if(activeTab) activeTab.focus();\n\n e.preventDefault();\n return;\n } else {\n const overlay = parent.document.body;\n overlay.click();\n }\n }\n });\n\n <\/script>\n </body>\n </html>\n \n \n ",i}}class r{constructor(t){const e=()=>{let e=t.querySelectorAll(".is-tabs-more");Array.prototype.forEach.call(e,(t=>{t.style.display="none",t.setAttribute("aria-expanded",!1)})),document.removeEventListener("click",i)},i=t=>{t.target.closest(".is-tab-more")||t.target.closest("[data-menu]")||e()},n=n=>{const o=n.parentNode.getAttribute("data-group"),s=n.getAttribute("data-menu");if(s){document.addEventListener("click",i),n.setAttribute("aria-expanded",!0),t.querySelector("#"+s).style.display="block";let e=t.querySelector('.is-tabs-more[data-group="'+o+'"] > li.active');if(e)e.focus();else{t.querySelector('.is-tabs-more[data-group="'+o+'"]').focus()}return!1}if(n.classList.contains("active"))return!1;const a=n.getAttribute("data-content");if(!a)return!1;let r=t.querySelectorAll('.is-tabs[data-group="'+o+'"] > a');Array.prototype.forEach.call(r,(t=>{t.classList.remove("active")})),r=t.querySelectorAll('.is-tabs-more[data-group="'+o+'"] > li'),Array.prototype.forEach.call(r,(t=>{t.classList.remove("active")})),n.classList.add("active");let l=t.querySelectorAll('.is-tab-content[data-group="'+o+'"]');Array.prototype.forEach.call(l,(t=>{t.style.display="none",t.classList.remove("active")}));const d=t.querySelector("#"+a);d.style.display="flex",d.classList.add("active");const c=t.querySelector(".is-tabs-more");return c&&(c.style.display="none"),e(),this.setupTabKey(d,t),!1};let o=t.querySelectorAll(".is-tabs a");Array.prototype.forEach.call(o,(t=>{t.addEventListener("keydown",(e=>{if(e.preventDefault(),13===e.keyCode||32===e.keyCode)n(e.target);else if(9===e.which&&!e.shiftKey){let e=[];const i=t.parentNode.getAttribute("data-group");let n=t.parentNode.parentNode.querySelector('.is-tab-content[data-group="'+i+'"].active');if(Array.from(n.children).map((t=>{if("none"!==window.getComputedStyle(t,null).getPropertyValue("display")){t.querySelectorAll('.is-tabs.active, a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex]').forEach((t=>{"none"!==window.getComputedStyle(t,null).getPropertyValue("display")&&e.push(t)}))}})),0===e.length)return;e[0].focus()}})),t.addEventListener("click",(t=>{t.preventDefault(),n(t.target)}))}));const s=t.querySelectorAll(".is-tabs-more");Array.prototype.forEach.call(s,(t=>{t.addEventListener("keydown",(i=>{i.preventDefault(),40===i.keyCode&&i.target.nextElementSibling?t.querySelector("li").focus():27===i.keyCode&&e()}))})),o=t.querySelectorAll(".is-tabs-more li"),Array.prototype.forEach.call(o,(i=>{i.addEventListener("keydown",(o=>{if(o.preventDefault(),o.stopImmediatePropagation(),38===o.keyCode&&o.target.previousElementSibling)o.target.previousElementSibling.focus();else if(40===o.keyCode&&o.target.nextElementSibling)o.target.nextElementSibling.focus();else if(27===o.keyCode)e();else if((13===o.keyCode||32===o.keyCode)&&(n(o.target),o.target.closest(".is-tabs-more"))){const e=i.parentNode.getAttribute("id"),n=t.querySelector('.is-tabs a[data-menu="'+e+'"]');n&&n.focus()}})),i.addEventListener("click",(e=>{if(e.preventDefault(),n(e.target),e.target.closest(".is-tabs-more")){const e=i.parentNode.getAttribute("id"),n=t.querySelector('.is-tabs a[data-menu="'+e+'"]');n&&n.focus()}}))}));t.addEventListener("focus",(()=>{this.setupModal(t)}))}setupModal(t){setTimeout((()=>{let e=[];t.querySelectorAll(".is-tabs a").forEach((t=>{"none"!==t.style.display?(t.classList.add("show"),e.push(t)):t.classList.remove("show")}));let i=0;this.inputTabs=e,e.forEach((t=>{let n=e[i+1],o=e[i-1];t.addEventListener("keydown",(t=>{t.preventDefault(),39===t.which?n&&n.focus():37===t.which&&o&&o.focus()})),i++})),this.setupTabKey(t.querySelector(".is-tab-content.active"),t)}),30)}setupTabKey(t,e){let i=[];if(Array.from(t.children).map((t=>{if("none"!==window.getComputedStyle(t,null).getPropertyValue("display")){t.querySelectorAll('.is-tabs.active, a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex]').forEach((t=>{"none"!==window.getComputedStyle(t,null).getPropertyValue("display")&&i.push(t)}))}})),0===i.length)return;let n=i[0];i[i.length-1].addEventListener("keydown",(i=>{if(9===i.which&&!i.shiftKey){i.preventDefault();let n=t.getAttribute("id");const o=e.querySelector('li[data-content="'+n+'"],a[data-content="'+n+'"]');if(o.closest(".is-tabs-more")){n=o.parentNode.getAttribute("id");const t=e.querySelector('.is-tabs a[data-menu="'+n+'"]');t&&t.focus()}else o.focus()}})),n.addEventListener("keydown",(i=>{if(9===i.which&&i.shiftKey){i.preventDefault();let n=t.getAttribute("id");const o=e.querySelector('li[data-content="'+n+'"],a[data-content="'+n+'"]');if(o.closest(".is-tabs-more")){n=o.parentNode.getAttribute("id");const t=e.querySelector('.is-tabs a[data-menu="'+n+'"]');t&&t.focus()}else o.focus()}}))}}const l=new t;class d{constructor(t){this.builder=t;const e=this.builder.builderStuff;this.builderStuff=e;let i='<div class="is-modal delsectionconfirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width: 450px;"><div style="margin: 20px 0 30px;text-align:center;font-size: 14px;">'+n("Are you sure you want to delete this section?")+'</div><button title="'+n("Delete")+'" class="input-ok classic">'+n("Delete")+'</button></div></div><div class="is-modal editsection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div class="is-modal-content" style="max-width:313px;padding:0;"><div class="is-modal-bar is-draggable">'+n("Section Settings")+'</div><div class="is-tabs clearfix" style="padding-top:37px;" data-group="sectionsettings"><a id="tabSectionGeneral" title="'+n("General")+'" href="" data-content="divSectionGeneral" class="active">'+n("General")+'</a><a id="tabSectionAnimation" title="'+n("Animation")+'" href="" data-content="divSectionAnimation">'+n("Animation")+'</a><a id="tabSectionScrollButton" title="'+n("Scroll")+'" href="" data-content="divSectionScrollButton">'+n("Scroll")+"</a></div>";i+='<div id="divSectionGeneral" class="is-tab-content active" data-group="sectionsettings" style="display:flex;padding-top:0"><div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Move Section")+':</div><div style="display:flex"><button title="'+n("Move Up")+'" class="cmd-section-up" style="">↑</button><button title="'+n("Move Down")+'" class="cmd-section-down">↓</button><button title="'+n("Move to Top")+'" class="cmd-section-top"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇤</span></button><button title="'+n("Move to Bottom")+'" class="cmd-section-bottom"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇥</span></button><button title="'+n("Duplicate")+'" class="cmd-section-duplicate" style="margin-left:20px;"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-copy-outline"></use></svg></button></div></div>',i+='<div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Height")+':</div><div style="display:flex"><button title="'+n("Auto")+'" class="cmd-section-height" data-value="0">'+n("Auto")+'</button><button title="20%" class="cmd-section-height" data-value="20">20%</button><button title="25%" class="cmd-section-height" data-value="25">25%</button><button title="30%" class="cmd-section-height" data-value="30">30%</button><button title="40%" class="cmd-section-height" data-value="40">40%</button><button title="50%" class="cmd-section-height" data-value="50">50%</button></div><div style="display:flex"><button title="60%" class="cmd-section-height" data-value="60" style="border-left:none;border-top:none;">60%</button><button title="70%" class="cmd-section-height" data-value="70" style="border-left:none;border-top:none;">70%</button><button title="75%" class="cmd-section-height" data-value="75" style="border-left:none;border-top:none;">75%</button><button title="80%" class="cmd-section-height" data-value="80" style="border-left:none;border-top:none;">80%</button><button title="90%" class="cmd-section-height" data-value="90" style="border-left:none;border-top:none;">90%</button><button title="100%" class="cmd-section-height" data-value="100" style="border-left:none;border-top:none;">100%</button></div></div><div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Spacing")+':</div><div style="display:flex"><button title="'+n("xs")+'" class="cmd-box-spacing" data-value="default">'+n("xs")+'</button><button title="'+n("sm")+'" class="cmd-box-spacing" data-value="sm">'+n("sm")+'</button><button title="'+n("m")+'" class="cmd-box-spacing" data-value="m">'+n("m")+'</button><button title="'+n("lg")+'" class="cmd-box-spacing" data-value="lg">'+n("lg")+'</button><button title="'+n("Clear")+'" class="cmd-box-spacing" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button></div></div>',i+='<div class="div-section-bgcolor" style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Background Color")+':</div><div style="display:flex;"><button title="'+n("Background Color")+'" class="input-section-bgcolor is-btn-color" style="margin-right:15px"></button><button title="'+n("Gradient")+'" class="input-section-gradient classic" data-value="+">'+n("Gradient")+'</button></div></div></div><div id="divSectionAnimation" class="is-tab-content" data-group="sectionsettings" style="display:none;padding-top:0"><div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Start")+':</div><div style="display:flex;flex-flow:wrap;"><button title="'+n("Slide Left")+'" class="cmd-section-anim-start" data-value="slide-left">'+n("Slide Left")+'</button><button title="'+n("Slide Right")+'" class="cmd-section-anim-start" data-value="slide-right">'+n("Slide Right")+'</button><button title="'+n("Zoom In")+'" class="cmd-section-anim-start" data-value="zoom-in">'+n("Zoom In")+'</button><button title="'+n("Clear")+'" class="cmd-section-anim-start" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button></div></div>',i+='<div style="display:flex;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("End")+':</div><div style="display:flex;flex-flow:wrap;"><button title="'+n("Slide Left")+'" class="cmd-section-anim-end" data-value="slide-left">'+n("Slide Left")+'</button><button title="'+n("Slide Right")+'" class="cmd-section-anim-end" data-value="slide-right">'+n("Slide Right")+'</button><button title="'+n("Slide Back")+'" class="cmd-section-anim-end" data-value="slide-back">'+n("Slide Back")+'</button><button title="'+n("Overlap")+'" class="cmd-section-anim-end" data-value="overlap">'+n("Overlap")+'</button><button title="'+n("Zoom In")+'" class="cmd-section-anim-end" data-value="zoom-in">'+n("Zoom In")+'</button><button title="'+n("Zoom Out")+'" class="cmd-section-anim-end" data-value="zoom-out">'+n("Zoom Out")+'</button><button title="'+n("Clear")+'" class="cmd-section-anim-end" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button></div></div></div><div id="divSectionScrollButton" class="is-tab-content" data-group="sectionsettings" style="display:none;padding-top:0"><div style="display:none;flex-direction:column;"><div style="padding-top:20px;padding-bottom: 3px;"><label for="chkScrollIcon" style="margin:0;"><input id="chkScrollIcon" type="checkbox" /> '+n("Scroll Icon")+'</label></div><div style="display:flex;padding-top:10px;"><button title="'+n("Light")+'" class="cmd-section-scroll" data-value="light" style="min-width:80px;">'+n("Light")+'</button><button title="'+n("Dark")+'" class="cmd-section-scroll" data-value="dark" style="border-left:none;min-width:80px;">'+n("Dark")+'</button></div></div><div style="display:flex;flex-direction:column;padding-bottom:3px;"><div style="padding-top:20px;padding-bottom:3px;">'+n("Scroll Button")+':</div><div style="display:flex;flex-flow:wrap;"><button class="cmd-scroll-preset" data-value="1" title="'+n("Apply")+'" type="button">1</button><button class="cmd-scroll-preset" data-value="2" title="'+n("Apply")+'" type="button">2</button><button class="cmd-scroll-preset" data-value="3" title="'+n("Apply")+'" type="button">3</button><button class="cmd-scroll-preset" data-value="4" title="'+n("Apply")+'" type="button">4</button><button class="cmd-scroll-preset" data-value="5" title="'+n("Apply")+'" type="button">5</button><button class="cmd-scroll-preset" data-value="6" title="'+n("Apply")+'" type="button">6</button><button class="cmd-scroll-preset" data-value="7" title="'+n("Apply")+'" type="button">7</button><button class="cmd-scroll-preset" data-value="8" title="'+n("Apply")+'" type="button">8</button><button class="cmd-scroll-preset" data-value="9" title="'+n("Apply")+'" type="button">9</button><button class="cmd-scroll-preset" data-value="10" title="'+n("Apply")+'" type="button">10</button><button class="cmd-scroll-preset" data-value="11" title="'+n("Apply")+'" type="button">11</button><button class="cmd-scroll-preset" data-value="12" title="'+n("Apply")+'" type="button">12</button><button class="cmd-scroll-preset" data-value="13" title="'+n("Apply")+'" type="button">13</button><button class="cmd-scroll-preset" data-value="14" title="'+n("Apply")+'" type="button">14</button><button class="cmd-scroll-preset" data-value="" title="'+n("Remove")+'" type="button"><svg class="is-icon-flex" style="flex:none;width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button></div></div></div></div></div>',i+='<div class="is-modal editmodule" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;"><div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">'+n("Module Settings")+'</div><iframe style="position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;margin:0;box-sizing:border-box;" src="about:blank"></iframe><input id="hidModuleCode" type="hidden" /><input id="hidModuleSettings" type="hidden" /><button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">'+n("Ok")+"</button></div></div>",l.appendHtml(e,i);let o=e.querySelector(".is-modal.editsection");this.modalEditSection=o,new r(o);const s=o.querySelectorAll(".is-tabs a");s.forEach((t=>{t.addEventListener("click",(e=>{if(e.preventDefault(),l.hasClass(t,"active"))return;s.forEach((t=>{l.removeClass(t,"active")})),l.addClass(t,"active");let i=t.getAttribute("data-content");o.querySelectorAll(".is-tab-content").forEach((t=>{t.style.display="none"})),o.querySelector("#"+i).style.display="flex"}))}));const a=e.querySelector(".is-modal.delsectionconfirm");a.querySelector(".input-ok").addEventListener("click",(()=>{const t=this.builder.activeSection;this.builder.editor.saveForUndo(),t.parentNode.removeChild(t),this.builder.settings.onRender(),this.builder.editor.util.hideModal(a),this.builder.settings.onChange(),this.builder.activeSection=null}));o.querySelector(".cmd-section-up").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionUp(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-down").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionDown(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-top").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionTop(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-bottom").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionBottom(),this.builder.settings.onChange()}));o.querySelector(".cmd-section-duplicate").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionDuplicate(),this.builder.settings.onChange()}));o.querySelectorAll(".cmd-section-anim-start").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionAnimStart(e),o.querySelectorAll(".cmd-section-anim-start").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-section-anim-end").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionAnimEnd(e),o.querySelectorAll(".cmd-section-anim-end").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-section-height").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionHeight(e),o.querySelectorAll(".cmd-section-height").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-spacing").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxSpacing(e),o.querySelectorAll(".cmd-box-spacing").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-section-scroll").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionScrollIcon(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-scroll-preset").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.sectionScrollPreset(e),o.querySelectorAll(".cmd-scroll-preset").forEach((t=>{l.removeClass(t,"on")})),l.addClass(t,"on"),""===e&&setTimeout((()=>{l.removeClass(t,"on")}),100),this.builder.settings.onChange()}))}));o.querySelector("#chkScrollIcon").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.sectionUseScroll(),this.builder.settings.onChange()}));const d=this.builder.editor.colorpicker(),c=o.querySelector(".input-section-bgcolor");c.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeSection;let e=c.style.backgroundColor;d.open((e=>{t.style.backgroundColor=e,t.style.backgroundImage="",c.style.backgroundColor=e}),e)})),o.querySelector(".input-section-gradient").addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeSection;this.builder.editor.gradientpicker().open(t)}))}edit(){this.builder.sidebar.closeSidebar();const t=this.builder.activeSection,e=this.modalEditSection;l.addClass(t,"section-active"),this.builder.showModal(e,!1,(()=>{l.removeClass(t,"section-active")})),e.focus();let i=this.builder.activeSection.querySelectorAll(".is-bg-light");i.forEach((t=>{if(l.removeClass(t,"is-bg-light"),l.hasClass(t,"is-box")){let e=t.querySelector(".is-overlay");e?e.style.backgroundColor||(e.style.backgroundColor="rgb(255, 255, 255)"):(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"),e.style.backgroundColor="rgb(255, 255, 255)")}})),i=this.builder.activeSection.querySelectorAll(".is-bg-dark"),i.forEach((t=>{if(l.removeClass(t,"is-bg-dark"),l.hasClass(t,"is-box")){let e=t.querySelector(".is-overlay");e?e.style.backgroundColor||(e.style.backgroundColor="rgb(17, 17, 17)"):(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"),e.style.backgroundColor="rgb(17, 17, 17)")}})),i=this.builder.activeSection.querySelectorAll(".is-bg-grey"),i.forEach((t=>{if(l.removeClass(t,"is-bg-grey"),l.hasClass(t,"is-box")){let e=t.querySelector(".is-overlay");e?e.style.backgroundColor||(e.style.backgroundColor="rgb(238, 239, 240)"):(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"),e.style.backgroundColor="rgb(238, 239, 240)")}}));const n=e.querySelector("#chkScrollIcon");t.querySelector(".is-arrow-down")?n.checked=!0:n.checked=!1;let o=e.querySelectorAll(".cmd-section-height");if(o.forEach((t=>{l.removeClass(t,"on")})),l.hasClass(t,"is-section-100")&&l.addClass(e.querySelector('.cmd-section-height[data-value="100"]'),"on"),l.hasClass(t,"is-section-90")&&l.addClass(e.querySelector('.cmd-section-height[data-value="90"]'),"on"),l.hasClass(t,"is-section-80")&&l.addClass(e.querySelector('.cmd-section-height[data-value="80"]'),"on"),l.hasClass(t,"is-section-75")&&l.addClass(e.querySelector('.cmd-section-height[data-value="75"]'),"on"),l.hasClass(t,"is-section-70")&&l.addClass(e.querySelector('.cmd-section-height[data-value="70"]'),"on"),l.hasClass(t,"is-section-60")&&l.addClass(e.querySelector('.cmd-section-height[data-value="60"]'),"on"),l.hasClass(t,"is-section-50")&&l.addClass(e.querySelector('.cmd-section-height[data-value="50"]'),"on"),l.hasClass(t,"is-section-40")&&l.addClass(e.querySelector('.cmd-section-height[data-value="40"]'),"on"),l.hasClass(t,"is-section-30")&&l.addClass(e.querySelector('.cmd-section-height[data-value="30"]'),"on"),l.hasClass(t,"is-section-25")&&l.addClass(e.querySelector('.cmd-section-height[data-value="25"]'),"on"),l.hasClass(t,"is-section-20")&&l.addClass(e.querySelector('.cmd-section-height[data-value="20"]'),"on"),l.hasClass(t,"is-section-auto")&&l.addClass(e.querySelector('.cmd-section-height[data-value="0"]'),"on"),o=e.querySelectorAll(".cmd-section-anim-start"),o.forEach((t=>{l.removeClass(t,"on")})),o=e.querySelectorAll(".cmd-section-anim-end"),o.forEach((t=>{l.removeClass(t,"on")})),t.hasAttribute("data-anim-start")){const i=t.getAttribute("data-anim-start");"zoom-in"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="zoom-in"]'),"on"),"zoom-out"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="zoom-out"]'),"on"),"slide-left"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="slide-left"]'),"on"),"slide-right"===i&&l.addClass(e.querySelector('.cmd-section-anim-start[data-value="slide-right"]'),"on")}if(t.hasAttribute("data-anim-end")){const i=t.getAttribute("data-anim-end");"zoom-in"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="zoom-in"]'),"on"),"zoom-out"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="zoom-out"]'),"on"),"slide-left"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="slide-left"]'),"on"),"slide-right"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="slide-right"]'),"on"),"overlap"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="overlap"]'),"on"),"slide-back"===i&&l.addClass(e.querySelector('.cmd-section-anim-end[data-value="slide-back"]'),"on")}o=e.querySelectorAll(".cmd-box-spacing");const s=this.modalEditSection.querySelector(".div-section-bgcolor");o.forEach((t=>{l.removeClass(t,"on")})),l.hasClass(t,"box-space")?(l.hasClass(t,"box-space-sm")?l.addClass(e.querySelector('.cmd-box-spacing[data-value="sm"]'),"on"):l.hasClass(t,"box-space-m")?l.addClass(e.querySelector('.cmd-box-spacing[data-value="m"]'),"on"):l.hasClass(t,"box-space-lg")?l.addClass(e.querySelector('.cmd-box-spacing[data-value="lg"]'),"on"):l.addClass(e.querySelector('.cmd-box-spacing[data-value="default"]'),"on"),s.style.display="flex"):s.style.display="none",o=e.querySelectorAll(".cmd-scroll-preset"),o.forEach((t=>{l.removeClass(t,"on")}));const a=t.querySelector(".is-arrow-down");if(a){let t=a.getAttribute("data-scroll-preset");if(t){let i=e.querySelector(`.cmd-scroll-preset[data-value="${t}"]`);l.addClass(i,"on")}}let r=e.querySelector(".input-section-bgcolor"),d=t.style.backgroundColor;r.style.backgroundColor=d||""}sectionUp(){const t=this.builder.activeSection;let e=t.previousElementSibling;if(e)for(;!l.hasClass(e,"is-section")&&e.previousElementSibling;)e=e.previousElementSibling;e&&!l.hasClass(e,"is-static")&&(t.parentNode.insertBefore(t,e),this.builder.settings.onRender(),this.builder.scrollTo(t,600))}sectionDown(){const t=this.builder.activeSection;let e=t.nextElementSibling;if(e)for(;!l.hasClass(e,"is-section")&&e.nextElementSibling;)e=e.previousElementSibling;return e&&!l.hasClass(e,"is-static")&&(t.parentNode.insertBefore(e,t),this.builder.settings.onRender(),this.builder.scrollTo(t,600)),!1}sectionTop(){const t=this.builder.activeSection;let e=this.builder.wrapperEl.querySelector(".is-section:not(.is-static)");t.parentNode.insertBefore(t,e),this.builder.settings.onRender(),this.builder.scrollTo(t,600)}sectionBottom(){const t=this.builder.activeSection;let e=this.builder.wrapperEl.querySelectorAll(".is-section:not(.is-static)"),i=e[e.length-1];t.parentNode.insertBefore(t,i.nextElementSibling),this.builder.settings.onRender(),this.builder.scrollTo(t,600)}sectionDuplicate(){const t=this.builder.activeSection;let e=t.cloneNode(!0);e.setAttribute("data-section-copied","1"),t.parentNode.insertBefore(e,t.nextElementSibling);let i=this.builder.doc.querySelector("[data-section-copied]");if(i.removeAttribute("data-section-copied"),l.removeClass(i,"section-active"),i.querySelectorAll(".is-overlay-content[data-module]").forEach((t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,l.uniqueId()),l.html(t,e)})),this.builder.sectionSetup(i),l.hasClass(i,"is-box"))this.builder.boxSetup(i);else{i.querySelectorAll(".is-box").forEach((t=>{this.builder.boxSetup(t)}))}i.querySelectorAll(".is-builder").forEach((t=>{let e=this.builder.editor.html(t),i=document.createRange();t.innerHTML="",t.appendChild(i.createContextualFragment(e)),t.removeAttribute("data-sort"),this.builder.editor.applyBehaviorOn(t)}));const n=i.querySelector(".is-arrow-down a");n&&n.addEventListener("click",(t=>(this.builder.scrollTo(i.nextElementSibling),t.preventDefault(),t.stopImmediatePropagation(),!1))),this.builder.settings.onRender(),this.builder.hideModal(this.modalEditSection),this.builder.scrollTo(i,600)}sectionAnimStart(t){const e=this.builder.activeSection;e.removeAttribute("data-bottom-top"),e.removeAttribute("data-300-bottom"),e.removeAttribute("data-400-bottom"),e.removeAttribute("data-center-top"),e.removeAttribute("data-anim-start"),e.style.transform="","zoom-in"===t?(e.setAttribute("data-bottom-top","transform:translateX(0%) translateY(0%) scale(0.7)"),e.setAttribute("data-300-bottom","transform:translateX(0%) translateY(0%) scale(1)")):"zoom-out"===t?(e.setAttribute("data-bottom-top","transform:translateX(0%) translateY(0%) scale(1.5)"),e.setAttribute("data-300-bottom","transform:translateX(0%) translateY(0%) scale(1)")):"slide-left"===t?(e.setAttribute("data-bottom-top","transform:translateX(100%) translateY(0%) scale(1)"),e.setAttribute("data-center-top","transform:translateX(0%) translateY(0%) scale(1)")):"slide-right"===t&&(e.setAttribute("data-bottom-top","transform:translateX(-100%) translateY(0%) scale(1)"),e.setAttribute("data-center-top","transform:translateX(0%) translateY(0%) scale(1)")),e.setAttribute("data-anim-start",t),"overlap"===e.getAttribute("data-anim-end")?e.setAttribute("data-smooth-scrolling","off"):e.removeAttribute("data-smooth-scrolling"),this.builder.settings.onRender()}sectionAnimEnd(t){const e=this.builder.activeSection;e.removeAttribute("data-top-bottom"),e.removeAttribute("data-center"),e.removeAttribute("data-anim-end"),e.style.transform="","zoom-in"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(0%) scale(1.5)")):"zoom-out"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1);"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(0%) scale(0.5)")):"overlap"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(70%) scale(1)"),e.setAttribute("data-smooth-scrolling","off")):"slide-left"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(-100%) translateY(0%) scale(1)")):"slide-right"===t?(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1)"),e.setAttribute("data-top-bottom","transform:translateX(100%) translateY(0%) scale(1)")):"slide-back"===t&&(e.setAttribute("data-center","transform:translateX(0%) translateY(0%) scale(1);"),e.setAttribute("data-top-bottom","transform:translateX(0%) translateY(100%) scale(0.5)")),e.setAttribute("data-anim-end",t),"overlap"===e.getAttribute("data-anim-end")?e.setAttribute("data-smooth-scrolling","off"):e.removeAttribute("data-smooth-scrolling"),this.builder.settings.onRender()}sectionHeight(t){const e=this.builder.activeSection;e.style.height="",l.removeClass(e,"is-section-auto"),l.removeClass(e,"is-section-20"),l.removeClass(e,"is-section-25"),l.removeClass(e,"is-section-30"),l.removeClass(e,"is-section-40"),l.removeClass(e,"is-section-50"),l.removeClass(e,"is-section-60"),l.removeClass(e,"is-section-70"),l.removeClass(e,"is-section-75"),l.removeClass(e,"is-section-80"),l.removeClass(e,"is-section-90"),l.removeClass(e,"is-section-100"),"0"===t?l.addClass(e,"is-section-auto"):l.addClass(e,"is-section-"+t),this.builder.settings.onRender(),this.builder.scrollTo(e,600)}boxSpacing(t){const e=this.builder.activeSection,i=this.modalEditSection.querySelector(".div-section-bgcolor");""==t?(l.removeClass(e,"box-space"),l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-m"),l.removeClass(e,"box-space-lg"),i.style.display="none"):(l.addClass(e,"box-space"),i.style.display="flex"),"sm"===t?(l.removeClass(e,"box-space-m"),l.removeClass(e,"box-space-lg"),l.addClass(e,"box-space-sm")):"m"==t?(l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-lg"),l.addClass(e,"box-space-m")):"lg"==t?(l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-m"),l.addClass(e,"box-space-lg")):"default"==t&&(l.removeClass(e,"box-space-sm"),l.removeClass(e,"box-space-m"),l.removeClass(e,"box-space-lg"))}sectionUseScroll(){const t=this.builder.activeSection;if(this.modalEditSection.querySelector("#chkScrollIcon").checked){t.querySelector(".is-section-tool").insertAdjacentHTML("beforebegin",'<div class="is-arrow-down bounce"><a href="#"><i class="icon ion-ios-arrow-thin-down"></i></a></div>');t.querySelector(".is-arrow-down a").addEventListener("click",(e=>(this.builder.scrollTo(t.nextElementSibling),e.preventDefault(),e.stopImmediatePropagation(),!1)))}else{const e=t.querySelector(".is-arrow-down");e.parentNode.removeChild(e)}}sectionScrollIcon(t){const e=this.builder.activeSection.querySelector(".is-arrow-down");"light"===t?l.addClass(e,"light"):l.removeClass(e,"light")}sectionScrollPreset(t){const e=this.builder.activeSection,i=e.querySelector(".is-arrow-down");if(i&&i.parentNode.removeChild(i),"1"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="1" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="border-radius: 5px;background:${"rgb(173 173 173 / 26%)"};box-shadow:0px 5px 5px 0px rgba(0, 0, 0, 0.03);">\n <svg style="width:17px;height:17px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("2"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="2" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="border-radius: 5px;background:${"rgb(221 221 221 / 30%)"};box-shadow:0px 5px 5px 0px rgba(0, 0, 0, 0.03);">\n <svg style="width:17px;height:17px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("3"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="3">\n <a href="#" style="background:${"rgba(193, 193, 193, 0.18)"};border-radius:500px">\n <svg style="width:22px;height:22px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("4"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="4">\n <a href="#" style="background:${"rgba(193, 193, 193, 0.18)"};border-radius:500px">\n <svg style="width:22px;height:22px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("5"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="5">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M349.7 322.2c-3.1-3.1-8-3-11.3 0L264 388.6V104c0-4.4-3.6-8-8-8s-8 3.6-8 8v284.6l-74.4-66.3c-3.4-2.9-8.1-3.2-11.2-.1-3.1 3.1-3.3 8.5-.1 11.4 0 0 87 79.2 88 80s2.8 2.4 5.7 2.4 4.9-1.6 5.7-2.4 88-80 88-80c1.5-1.5 2.3-3.6 2.3-5.7s-.8-4.1-2.3-5.7z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("6"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="6">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M349.7 322.2c-3.1-3.1-8-3-11.3 0L264 388.6V104c0-4.4-3.6-8-8-8s-8 3.6-8 8v284.6l-74.4-66.3c-3.4-2.9-8.1-3.2-11.2-.1-3.1 3.1-3.3 8.5-.1 11.4 0 0 87 79.2 88 80s2.8 2.4 5.7 2.4 4.9-1.6 5.7-2.4 88-80 88-80c1.5-1.5 2.3-3.6 2.3-5.7s-.8-4.1-2.3-5.7z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("7"===t){let t="#fff",i="border:#333 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="7" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="${i}border-radius: 5px;background:none;">\n <svg style="width:17px;height:17px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}if("8"===t){let t="#000",i="border:#333 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="8" style="width: 30px;margin-left: -15px;height: 40px;">\n <a href="#" style="${i}border-radius: 5px;background:none;">\n <svg style="width:17px;height:17px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M277.375 85v259.704l119.702-119.702L427 256 256 427 85 256l29.924-29.922 119.701 118.626V85h42.75z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}if("9"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="9">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("10"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="10">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:30px;height:30px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("11"===t){let t="";t=`fill:${"#fff"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="11">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:60px;height:60px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("12"===t){let t="";t=`fill:${"#000"};`;let i=`<div data-target="svgfill" class="is-arrow-down bounce" data-scroll-preset="12">\n <a href="#" style="background:none;border-radius:unset;">\n <svg style="width:60px;height:60px;${t}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",i)}if("13"===t){let t="#fff",i="border:#111 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="13" style="width: 40px;margin-left: -20px;height: 35px;">\n <a href="#" style="background:none;border-radius:unset;${i};">\n <svg style="width:25px;height:25px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}if("14"===t){let t="#000",i="border:#111 2px solid;",n="";i=`border:${t} 2px solid;`,n=`fill:${t};`;let o=`<div data-target="border,svgfill" class="is-arrow-down bounce" data-scroll-preset="14" style="width: 40px;margin-left: -20px;height: 35px;">\n <a href="#" style="background:none;border-radius:unset;${i}">\n <svg style="width:25px;height:25px;${n}" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <g>\n <path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"></path>\n </g>\n </svg>\n </a>\n </div>`;e.insertAdjacentHTML("beforeend",o)}const n=e.querySelector(".is-arrow-down a");n&&n.addEventListener("click",(t=>(this.builder.scrollTo(e.nextElementSibling),t.preventDefault(),t.stopImmediatePropagation(),!1)))}}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},u={exports:{}},p={},h={exports:{}},g={},f={};function m(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function b(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function v(t,e){this.__indent_cache=new b(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.clone_empty=function(){var t=new m(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},m.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},m.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},m.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return 0===this.__items.length},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},m.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},b.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},b.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},b.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},v.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},v.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},f.Output=v;var y={};y.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var _,x,w,S,C,k={};x="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",S="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",C="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(w="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",(_=k).identifier=new RegExp(C+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),_.identifierStart=new RegExp(C),_.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+x+w+S+"])+"),_.newline=/[\n\r\u2028\u2029]/,_.lineBreak=new RegExp("\r\n|"+_.newline.source),_.allLineBreaks=new RegExp(_.lineBreak.source,"g");var E={},A={};function L(t,e){this.raw_options=q(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function q(t,e){var i,n={};for(i in t=T(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function T(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}L.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},L.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},L.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},L.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},L.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},L.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},L.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},A.Options=L,A.normalizeOpts=T,A.mergeOpts=q;var M=A.Options,R=["before-newline","after-newline","preserve-newline"];function O(t){M.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",R),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}O.prototype=new M,E.Options=O;var B={},N={},I=RegExp.prototype.hasOwnProperty("sticky");function D(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}D.prototype.restart=function(){this.__position=0},D.prototype.back=function(){this.__position>0&&(this.__position-=1)},D.prototype.hasNext=function(){return this.__position<this.__input_length},D.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},D.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},D.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||I&&t.sticky||i.index!==e&&(i=null),i},D.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},D.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},D.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},D.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},D.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},D.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},D.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&I&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},D.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},D.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},D.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},N.InputScanner=D;var P={},$={};function z(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}z.prototype.restart=function(){this.__position=0},z.prototype.isEmpty=function(){return 0===this.__tokens_length},z.prototype.hasNext=function(){return this.__position<this.__tokens_length},z.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},z.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},z.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},$.TokenStream=z;var H={},j={};function F(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}F.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},F.prototype.read_match=function(){return this._input.match(this._match_pattern)},F.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},F.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},F.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},F.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},F.prototype._create=function(){return new F(this._input,this)},F.prototype._update=function(){},j.Pattern=F;var U=j.Pattern;function W(t,e){U.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}W.prototype=new U,W.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},W.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},W.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},W.prototype._create=function(){return new W(this._input,this)},W.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},H.WhitespacePattern=W;var V=N.InputScanner,G=y.Token,X=$.TokenStream,Y=H.WhitespacePattern,K={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Z=function(t,e){this._input=new V(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Y(this._input)};Z.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new X,this._reset();for(var e=new G(K.START,""),i=null,n=[],o=new X;e.type!==K.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new X),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Z.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Z.prototype._reset=function(){},Z.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(K.RAW,i):this._create_token(K.EOF,"")},Z.prototype._is_comment=function(t){return!1},Z.prototype._is_opening=function(t){return!1},Z.prototype._is_closing=function(t,e){return!1},Z.prototype._create_token=function(t,e){return new G(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Z.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},P.Tokenizer=Z,P.TOKEN=K;var Q={};function J(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}J.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},J.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},Q.Directives=J;var tt={},et=j.Pattern,it={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function nt(t,e){et.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},it),this._excluded=Object.assign({},it),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new et(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}nt.prototype=new et,nt.prototype._create=function(){return new nt(this._input,this)},nt.prototype._update=function(){this.__set_templated_pattern()},nt.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},nt.prototype.read_options=function(t){var e=this._create();for(var i in it)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},nt.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},nt.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},nt.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},nt.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},tt.TemplatablePattern=nt;var ot=N.InputScanner,st=P.Tokenizer,at=P.TOKEN,rt=Q.Directives,lt=k,dt=j.Pattern,ct=tt.TemplatablePattern;function ut(t,e){return-1!==e.indexOf(t)}var pt={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:at.START,RAW:at.RAW,EOF:at.EOF},ht=new rt(/\/\*/,/\*\//),gt=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ft=/[0-9]/,mt=/[^\d\.]/,bt=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),vt=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";vt=(vt="\\?\\.(?!\\d) "+(vt=vt.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var yt,_t=new RegExp(vt),xt="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),wt=xt.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),St=new RegExp("^(?:"+wt.join("|")+")$"),Ct=function(t,e){st.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new dt(this._input),n=new ct(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(lt.identifier).matching(lt.identifierMatch),number:i.matching(gt),punct:i.matching(_t),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(lt.lineBreak),shebang:i.starting_with(/#!/).until_after(lt.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(Ct.prototype=new st)._is_comment=function(t){return t.type===pt.COMMENT||t.type===pt.BLOCK_COMMENT||t.type===pt.UNKNOWN},Ct.prototype._is_opening=function(t){return t.type===pt.START_BLOCK||t.type===pt.START_EXPR},Ct.prototype._is_closing=function(t,e){return(t.type===pt.END_BLOCK||t.type===pt.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},Ct.prototype._reset=function(){yt=!1},Ct.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(pt.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(pt.UNKNOWN,this._input.next())},Ct.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(lt.allLineBreaks,"\n"),t.type!==pt.DOT&&(t.type!==pt.RESERVED||"set"!==t.text&&"get"!==t.text)&&St.test(e)?"in"===e||"of"===e?this._create_token(pt.OPERATOR,e):this._create_token(pt.RESERVED,e):this._create_token(pt.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(pt.WORD,e):void 0},Ct.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(pt.START_EXPR,t):")"===t||"]"===t?e=this._create_token(pt.END_EXPR,t):"{"===t?e=this._create_token(pt.START_BLOCK,t):"}"===t?e=this._create_token(pt.END_BLOCK,t):";"===t?e=this._create_token(pt.SEMICOLON,t):"."===t&&mt.test(this._input.peek(1))?e=this._create_token(pt.DOT,t):","===t&&(e=this._create_token(pt.COMMA,t)),e&&this._input.next(),e},Ct.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(pt.EQUALS,t):"?."===t?this._create_token(pt.DOT,t):this._create_token(pt.OPERATOR,t)},Ct.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(pt.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(pt.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(ft)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(pt.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(lt.newline);)e+=this._input.next();return yt=!0,this._create_token(pt.COMMENT,e)}}else if(yt&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return yt=!1,this._create_token(pt.COMMENT,e);return null},Ct.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=ht.get_directives(i);n&&"start"===n.ignore&&(i+=ht.readIgnored(this._input)),i=i.replace(lt.allLineBreaks,"\n"),(e=this._create_token(pt.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(pt.COMMENT,i))}return e},Ct.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new ot(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(lt.allLineBreaks,"\n"),this._create_token(pt.STRING,e)}return null},Ct.prototype._allow_regexp_or_xml=function(t){return t.type===pt.RESERVED&&ut(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===pt.END_EXPR&&")"===t.text&&t.opened.previous.type===pt.RESERVED&&ut(t.opened.previous.text,["if","while","for"])||ut(t.type,[pt.COMMENT,pt.START_EXPR,pt.START_BLOCK,pt.START,pt.END_BLOCK,pt.OPERATOR,pt.EQUALS,pt.EOF,pt.SEMICOLON,pt.COMMA])},Ct.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(lt.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(lt.identifier)),this._create_token(pt.STRING,i)}return null},Ct.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),a=0;n;){var r=!!n[1],l=n[2];if(!(!!n[n.length-1]||"![CDATA["===l.slice(0,8))&&(l===o||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(r?--a:++a),i+=n[0],a<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(lt.allLineBreaks,"\n"),this._create_token(pt.STRING,i)}}return null},Ct.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),a="";this._input.hasNext();){if((a=this._input.next())===t||!e&<.newline.test(a)){this._input.back();break}"\\"===a&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),a+=this._input.next()):i&&("${"===i&&"$"===a&&"{"===this._input.peek()&&(a+=this._input.next()),i===a&&(a+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next()))),s+=a+=o.read()}return s},B.Tokenizer=Ct,B.TOKEN=pt,B.positionable_operators=bt.slice(),B.line_starters=xt.slice();var kt=f.Output,Et=y.Token,At=k,Lt=E.Options,qt=B.Tokenizer,Tt=B.line_starters,Mt=B.positionable_operators,Rt=B.TOKEN;function Ot(t,e){return-1!==e.indexOf(t)}function Bt(t,e){return t&&t.type===Rt.RESERVED&&t.text===e}function Nt(t,e){return t&&t.type===Rt.RESERVED&&Ot(t.text,e)}var It=["case","return","do","if","throw","else","await","break","continue","async"],Dt=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),Pt=[Dt.before_newline,Dt.preserve_newline],$t="BlockStatement",zt="Statement",Ht="ObjectLiteral",jt="ArrayLiteral",Ft="ForInitializer",Ut="Conditional",Wt="Expression";function Vt(t,e){e.multiline_frame||e.mode===Ft||e.mode===Ut||t.remove_indent(e.start_line_index)}function Gt(t){return t===jt}function Xt(t){return Ot(t,[Wt,Ft,Ut])}function Yt(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new Lt(e)}Yt.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new Et(Rt.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},Yt.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new kt(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode($t);var i=new qt(t,this._options);return this._tokens=i.tokenize(),t},Yt.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&At.lineBreak.test(t||"")&&(e=t.match(At.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},Yt.prototype.handle_token=function(t,e){t.type===Rt.START_EXPR?this.handle_start_expr(t):t.type===Rt.END_EXPR?this.handle_end_expr(t):t.type===Rt.START_BLOCK?this.handle_start_block(t):t.type===Rt.END_BLOCK?this.handle_end_block(t):t.type===Rt.WORD||t.type===Rt.RESERVED?this.handle_word(t):t.type===Rt.SEMICOLON?this.handle_semicolon(t):t.type===Rt.STRING?this.handle_string(t):t.type===Rt.EQUALS?this.handle_equals(t):t.type===Rt.OPERATOR?this.handle_operator(t):t.type===Rt.COMMA?this.handle_comma(t):t.type===Rt.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===Rt.COMMENT?this.handle_comment(t,e):t.type===Rt.DOT?this.handle_dot(t):t.type===Rt.EOF?this.handle_eof(t):(t.type,Rt.UNKNOWN,this.handle_unknown(t,e))},Yt.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&Gt(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var a=1;a<i;a+=1)this.print_newline(!0,e)}};var Kt=["async","break","continue","return","throw","yield"];Yt.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(Ot(this._flags.last_token.text,Mt)||Ot(t.text,Mt)){var n=Ot(this._flags.last_token.text,Mt)&&Ot(this._options.operator_position,Pt)||Ot(t.text,Mt);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(Nt(this._flags.last_token,Kt))return;this._output.set_wrap_point()}}},Yt.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==Rt.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==zt||this._flags.if_block&&Bt(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},Yt.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||Gt(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Yt.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===Rt.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},Yt.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Yt.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Yt.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Yt.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===zt&&Vt(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Yt.prototype.start_of_object_property=function(){return this._flags.parent.mode===Ht&&this._flags.mode===zt&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Nt(this._flags.last_token,["get","set"]))},Yt.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||Nt(this._flags.last_token,["var","let","const"])&&t.type===Rt.WORD)||Bt(this._flags.last_token,"do"))||!(this._flags.parent.mode===Ht&&this._flags.mode===zt)&&Nt(this._flags.last_token,Kt)&&!t.newlines)||Bt(this._flags.last_token,"else")&&!(Bt(t,"if")&&!t.comments_before))||this._flags.last_token.type===Rt.END_EXPR&&(this._previous_flags.mode===Ft||this._previous_flags.mode===Ut))||this._flags.last_token.type===Rt.WORD&&this._flags.mode===$t&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==Rt.WORD&&t.type!==Rt.RESERVED)||this._flags.mode===Ht&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Nt(this._flags.last_token,["get","set"])))&&(this.set_mode(zt),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,Nt(t,["do","for","if","while"])),!0)},Yt.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=Wt;if("["===t.text){if(this._flags.last_token.type===Rt.WORD||")"===this._flags.last_token.text)return Nt(this._flags.last_token,Tt)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=jt,Gt(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),Ot(this._flags.last_token.type,[Rt.START_EXPR,Rt.END_EXPR,Rt.WORD,Rt.OPERATOR,Rt.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Rt.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Ft):Ot(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Ut):Ot(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(Ot(this._flags.last_token.text,Tt)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Rt.EQUALS||this._flags.last_token.type===Rt.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===Rt.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);Nt(i,["async","function"])||"*"===i.text&&Nt(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Ht&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===Rt.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(Ot(this._last_last_text,["function","yield"])||this._flags.mode===Ht&&Ot(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===Rt.START_BLOCK?this.print_newline():this._flags.last_token.type!==Rt.END_EXPR&&this._flags.last_token.type!==Rt.START_EXPR&&this._flags.last_token.type!==Rt.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==Rt.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Yt.prototype.handle_end_expr=function(t){for(;this._flags.mode===zt;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&Gt(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==Rt.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),Vt(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ut&&(this._previous_flags.mode=Wt,this._flags.do_block=!1,this._flags.do_while=!1)},Yt.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===Rt.END_EXPR?(this.set_mode($t),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode($t):i&&(Ot(i.text,[":",","])&&Ot(e.type,[Rt.STRING,Rt.WORD,Rt.RESERVED])||Ot(e.text,["get","set","..."])&&Ot(i.type,[Rt.WORD,Rt.RESERVED]))?Ot(this._last_last_text,["class","interface"])&&!Ot(i.text,[":",","])?this.set_mode($t):this.set_mode(Ht):this._flags.last_token.type===Rt.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode($t):Ot(this._flags.last_token.type,[Rt.EQUALS,Rt.START_EXPR,Rt.COMMA,Rt.OPERATOR])||Nt(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Ht):this.set_mode($t);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===Rt.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do{if(s+=1,(a=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==Rt.EOF&&(a.type!==Rt.END_BLOCK||a.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Rt.OPERATOR&&(o||this._flags.last_token.type===Rt.EQUALS||Nt(this._flags.last_token,It)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!Gt(this._previous_flags.mode)||this._flags.last_token.type!==Rt.START_EXPR&&this._flags.last_token.type!==Rt.COMMA||((this._flags.last_token.type===Rt.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Rt.COMMA||this._flags.last_token.type===Rt.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Rt.OPERATOR&&this._flags.last_token.type!==Rt.START_EXPR&&(this._flags.last_token.type!==Rt.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},Yt.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===zt;)this.restore_mode();var e=this._flags.last_token.type===Rt.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(Gt(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},Yt.prototype.handle_word=function(t){if(t.type===Rt.RESERVED)if(Ot(t.text,["set","get"])&&this._flags.mode!==Ht)t.type=Rt.WORD;else if("import"===t.text&&Ot(this._tokens.peek().text,["(","."]))t.type=Rt.WORD;else if(Ot(t.text,["as","from"])&&!this._flags.import_block)t.type=Rt.WORD;else if(this._flags.mode===Ht){":"===this._tokens.peek().text&&(t.type=Rt.WORD)}if(this.start_of_statement(t)?Nt(this._flags.last_token,["var","let","const"])&&t.type===Rt.WORD&&(this._flags.declaration_statement=!0):!t.newlines||Xt(this._flags.mode)||this._flags.last_token.type===Rt.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===Rt.EQUALS||!this._options.preserve_newlines&&Nt(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(Bt(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&Bt(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===zt;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&Nt(t,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==Rt.COMMA&&this._flags.last_token.type!==Rt.START_EXPR&&this._flags.last_token.type!==Rt.EQUALS&&this._flags.last_token.type!==Rt.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),Bt(t,"function"))return(Ot(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!Ot(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==Rt.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===Rt.RESERVED||this._flags.last_token.type===Rt.WORD?Nt(this._flags.last_token,["get","set","new","export"])||Nt(this._flags.last_token,Kt)||Bt(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Rt.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!Xt(this._flags.mode)&&!Gt(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===Rt.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":Nt(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===Rt.SEMICOLON&&this._flags.mode===$t?e="NEWLINE":this._flags.last_token.type===Rt.SEMICOLON&&Xt(this._flags.mode)?e="SPACE":this._flags.last_token.type===Rt.STRING?e="NEWLINE":this._flags.last_token.type===Rt.RESERVED||this._flags.last_token.type===Rt.WORD||"*"===this._flags.last_token.text&&(Ot(this._last_last_text,["function","yield"])||this._flags.mode===Ht&&Ot(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===Rt.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===Rt.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),Nt(t,Tt)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),Nt(t,["else","catch","finally"]))?(this._flags.last_token.type!==Rt.END_BLOCK||this._previous_flags.mode!==$t||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?Nt(this._flags.last_token,It)||"declare"===this._flags.last_token.text&&Nt(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Rt.END_EXPR?this._flags.last_token.type===Rt.START_EXPR&&Nt(t,["var","let","const"])||":"===this._flags.last_token.text||(Bt(t,"if")&&Bt(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):Nt(t,Tt)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&Gt(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==Rt.WORD&&t.previous.type!==Rt.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===Rt.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&Bt(t,"from")&&(this._flags.import_block=!1))},Yt.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==zt||this._flags.if_block&&Bt(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},Yt.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==Rt.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===Rt.RESERVED||this._flags.last_token.type===Rt.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Rt.COMMA||this._flags.last_token.type===Rt.START_EXPR||this._flags.last_token.type===Rt.EQUALS||this._flags.last_token.type===Rt.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==Rt.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},Yt.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},Yt.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Xt(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===Ht||this._flags.mode===zt&&this._flags.parent.mode===Ht?(this._flags.mode===zt&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},Yt.prototype.handle_operator=function(t){var e="*"===t.text&&(Nt(this._flags.last_token,["function","yield"])||Ot(this._flags.last_token.type,[Rt.START_BLOCK,Rt.COMMA,Rt.END_BLOCK,Rt.SEMICOLON])),i=Ot(t.text,["-","+"])&&(Ot(this._flags.last_token.type,[Rt.START_BLOCK,Rt.START_EXPR,Rt.EQUALS,Rt.OPERATOR])||Ot(this._flags.last_token.text,Tt)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(Nt(this._flags.last_token,It))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==Rt.DOT)if("::"!==t.text){if(this._flags.last_token.type===Rt.OPERATOR&&Ot(this._options.operator_position,Pt)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==Rt.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var o=!0,s=!0,a=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,a=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&Ot(t.text,Mt)){var r=":"===t.text,l=r&&a,d=r&&!a;switch(this._options.operator_position){case Dt.before_newline:return this._output.space_before_token=!d,this.print_token(t),r&&!l||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case Dt.after_newline:return this._output.space_before_token=!0,!r||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case Dt.preserve_newline:return d||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||d),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var c=this._tokens.peek();s=c&&Ot(c.type,[Rt.WORD,Rt.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===Rt.START_BLOCK,s=!1):(Ot(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==Rt.COMMA&&this._flags.last_token.type!==Rt.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text&&"~"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&Xt(this._flags.mode)&&(o=!0),this._flags.last_token.type===Rt.RESERVED?o=!0:this._flags.last_token.type===Rt.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===Rt.OPERATOR&&(o=Ot(t.text,["--","-","++","+"])&&Ot(this._flags.last_token.text,["--","-","++","+"]),Ot(t.text,["+","-"])&&Ot(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==$t||this._flags.inline_frame)&&this._flags.mode!==zt||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},Yt.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):At.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},Yt.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(At.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,a=t.whitespace_before,r=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,a),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(r))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},Yt.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},Yt.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),Nt(this._flags.last_token,It)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},Yt.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},Yt.prototype.handle_eof=function(t){for(;this._flags.mode===zt;)this.restore_mode();this.handle_whitespace_and_comments(t)},g.Beautifier=Yt;var Zt=g.Beautifier,Qt=E.Options;h.exports=function(t,e){return new Zt(t,e).beautify()},h.exports.defaultOptions=function(){return new Qt};var Jt={exports:{}},te={},ee={},ie=A.Options;function ne(t){ie.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}ne.prototype=new ie,ee.Options=ne;var oe=ee.Options,se=f.Output,ae=N.InputScanner,re=new(0,Q.Directives)(/\/\*/,/\*\//),le=/\r\n|[\r\n]/,de=/\r\n|[\r\n]/g,ce=/\s/,ue=/(?:\s|\n)+/g,pe=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,he=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ge(t,e){this._source_text=t||"",this._options=new oe(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template"]}ge.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},ge.prototype.eatWhitespace=function(t){for(var e=ce.test(this._input.peek()),i=0;ce.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},ge.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},ge.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},ge.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},ge.prototype.indent=function(){this._indentLevel++},ge.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ge.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&le.test(t||"")&&(e=t.match(le)[0]));var i=(t=t.replace(de,"\n")).match(/^[\t ]*/)[0];this._output=new se(this._options,i),this._input=new ae(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,a=!1,r=!1,l=!1,d=!1,c=!1,u=!1,p=this._ch,h=!1;n=""!==this._input.read(ue),o=p,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),p=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var g=this._input.read(pe),f=re.get_directives(g);f&&"start"===f.ignore&&(g+=re.readIgnored(this._input)),this.print_string(g),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(he)),this.eatWhitespace(!0);else if("@"===this._ch||"$"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var m=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);m.match(/[ :]$/)&&(m=this.eatString(": ").replace(/\s$/,""),this.print_string(m),this._output.space_before_token=!0),"extend"===(m=m.replace(/\s$/,""))?d=!0:"import"===m&&(c=!0),m in this.NESTED_AT_RULE?(this._nestedLevel+=1,m in this.CONDITIONAL_GROUP_RULE&&(l=!0)):a||0!==s||-1===m.indexOf(":")||(r=!0,this.indent())}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)r&&(r=!1,this.outdent()),l?(l=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===o?this._output.space_before_token=!1:","!==o&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),c=!1,d=!1,r&&(this.outdent(),r=!1),this.print_string(this._ch),a=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var b=0;b<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;b++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[b])){h=!0;break}!a&&!l||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||d||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),r||(r=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch)this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0);else if(";"===this._ch)h=!1,0===s?(r&&(this.outdent(),r=!1),d=!1,c=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),r&&"$"===o&&this._options.selector_separator_newline?(this._output.add_new_line(),u=!0):(this.eatWhitespace(),s++,this.indent()));else if(")"===this._ch)s&&(s--,this.outdent()),u&&";"===this._input.peek()&&this._options.selector_separator_newline&&(u=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||r&&!u||0!==s||c||d?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||r||0!==s)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(n),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),ce.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var v='"'===o||"'"===o;this.preserveSingleSpace(v||n),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&h&&this._output.add_new_line()}else this.print_string(" "),this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&ce.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},te.Beautifier=ge;var fe=te.Beautifier,me=ee.Options;Jt.exports=function(t,e){return new fe(t,e).beautify()},Jt.exports.defaultOptions=function(){return new me};var be={exports:{}},ve={},ye={},_e=A.Options;function xe(t){_e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}xe.prototype=new _e,ye.Options=xe;var we={},Se=P.Tokenizer,Ce=P.TOKEN,ke=Q.Directives,Ee=tt.TemplatablePattern,Ae=j.Pattern,Le={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:Ce.START,RAW:Ce.RAW,EOF:Ce.EOF},qe=new ke(/<\!--/,/-->/),Te=function(t,e){Se.call(this,t,e),this._current_tag_name="";var i=new Ee(this._input).read_options(this._options),n=new Ae(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(Te.prototype=new Se)._is_comment=function(t){return!1},Te.prototype._is_opening=function(t){return t.type===Le.TAG_OPEN},Te.prototype._is_closing=function(t,e){return t.type===Le.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},Te.prototype._reset=function(){this._current_tag_name=""},Te.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(Le.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(Le.UNKNOWN,this._input.next())},Te.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=qe.get_directives(i))&&"start"===n.ignore&&(i+=qe.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(Le.COMMENT,i)).directives=n));return e},Te.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(Le.COMMENT,i)).directives=null)}return e},Te.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(Le.TAG_OPEN,i)),n},Te.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(Le.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(Le.TAG_OPEN,i))),n},Te.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(Le.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(Le.TAG_CLOSE,"}}"))),n},Te.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(Le.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(Le.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===Le.EQUALS?this._create_token(Le.VALUE,o):this._create_token(Le.ATTRIBUTE,o));return n},Te.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},Te.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===Le.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=Le.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(Le.TEXT,n):null},Te.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(Le.TEXT,e)},we.Tokenizer=Te,we.TOKEN=Le;var Me=ye.Options,Re=f.Output,Oe=we.Tokenizer,Be=we.TOKEN,Ne=/\r\n|[\r\n]/,Ie=/\r\n|[\r\n]/g,De=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new Re(t,e)};De.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},De.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},De.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},De.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},De.prototype.print_preserved_newlines=function(t){var e=0;t.type!==Be.TEXT&&t.previous.type!==Be.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},De.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},De.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},De.prototype.print_newline=function(t){this._output.add_new_line(t)},De.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},De.prototype.indent=function(){this.indent_level++},De.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var Pe=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==Be.EOF&&t.closed!==i;){if(i.type===Be.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===Be.EQUALS&&i.next.next&&i.next.next.type===Be.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function $e(t,e){return-1!==e.indexOf(t)}function ze(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function He(t){this._printer=t,this._current_frame=null}function je(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new Me(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}He.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},He.prototype.record_tag=function(t){var e=new ze(this._current_frame,t,this._printer.indent_level);this._current_frame=e},He.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},He.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},He.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},He.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},je.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&Ne.test(t)&&(e=t.match(Ne)[0]));var i=(t=t.replace(Ie,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new Fe,s=new De(this._options,i),a=new Oe(t,this._options).tokenize();this._tag_stack=new He(s);for(var r=null,l=a.next();l.type!==Be.EOF;)l.type===Be.TAG_OPEN||l.type===Be.COMMENT?o=r=this._handle_tag_open(s,l,o,n):l.type===Be.ATTRIBUTE||l.type===Be.EQUALS||l.type===Be.VALUE||l.type===Be.TEXT&&!o.tag_complete?r=this._handle_inside_tag(s,l,o,a):l.type===Be.TAG_CLOSE?r=this._handle_tag_close(s,l,o):l.type===Be.TEXT?r=this._handle_text(s,l,o):s.add_raw_token(l),n=r,l=a.next();return s._output.get_code(e)},je.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},je.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===Be.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===Be.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===Be.EQUALS||e.type===Be.VALUE&&e.previous.type===Be.EQUALS)&&t.set_space_before_token(!1),e.type===Be.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var a=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var r,l=!0,d=0;do{if((r=n.peek(d)).type===Be.ATTRIBUTE){l=!1;break}d+=1}while(d<4&&r.type!==Be.EOF&&r.type!==Be.TAG_CLOSE);a=!l}a&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},je.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},je.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,a=1,r="",l="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new je(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-t.indent_level);var d=t.get_full_indent(a);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var c=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!c)return void t.add_raw_token(e);r=d+c[1]+"\n",s=c[4],c[5]&&(l=d+c[5]),s=s.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(e.whitespace_before=c[0])}if(s)if(o){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,s=o(d+s,new u)}else{var p=e.whitespace_before;p&&(s=s.replace(new RegExp("\n("+p+")?","g"),"\n")),s=d+s.replace(/\n/g,"\n"+d)}r&&(s=s?r+s+"\n"+l:r+l),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},je.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==Be.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var Fe=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text.split(" ")[0])),this.tag_check=this.tag_check.toLowerCase(),e.type===Be.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};je.prototype._get_tag_open_token=function(t){var e=new Fe(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||$e(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&$e(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&$e(e.tag_check,this._options.content_unformatted),e.is_inline_element=$e(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},je.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=Pe(i.tag_check,e)))),$e(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===Be.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===Be.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},je.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Ue=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],We=["a","audio","del","ins","map","noscript","video"];je.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Ue.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==We.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},ve.Beautifier=je;var Ve=ve.Beautifier,Ge=ye.Options;be.exports=function(t,e,i,n){return new Ve(t,e,i,n).beautify()},be.exports.defaultOptions=function(){return new Ge};var Xe=h.exports,Ye=Jt.exports,Ke=be.exports;function Ze(t,e,i,n){return Ke(t,e,i=i||Xe,n=n||Ye)}Ze.defaultOptions=Ke.defaultOptions,p.js=Xe,p.css=Ye,p.html=Ze,function(t){var e=p;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(u);var Qe=u.exports;const Je=new t;class ti{constructor(t){this.builder=t,this.builderStuff=this.builder.builderStuff;const e=this.builderStuff;let i="";i+='<iframe id="target-upload-cover" name="target-upload-cover" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>',i+='<div class="is-modal editcustomcode" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;"><div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">'+n("Custom Code (Javascript Allowed)")+'</div><textarea id="txtBoxCustomCode" class="inptxt" style="background: #fff;position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;box-sizing:border-box;"></textarea><input id="hidBoxCustomCode" type="hidden" /><button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">'+n("Ok")+'</button></div></div><div class="is-modal editbox" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div class="is-modal-content" style="max-width:380px;min-height:300px;padding:0"><div class="is-modal-bar is-draggable">'+n("Box Settings")+'</div><div class="is-tabs clearfix" style="padding-top:37px;" data-group="boxsettings"><a id="tabBoxGeneral" href="" data-content="divBoxGeneral" class="active">'+n("General")+'</a><a id="tabBoxContentContainer" href="" data-content="divBoxContentContainer">'+n("Content")+'</a><a id="tabBoxContentText" href="" data-content="divBoxContentText">'+n("Text")+'</a><a id="tabBoxImage" href="" data-content="divBoxImage">'+n("Image")+'</a><a id="tabBoxAnimate" href="" data-content="divBoxAnimate">'+n("Animate")+'</a><a id="tabBoxClick" href="" data-content="divBoxClick">'+n("On Click")+'</a></div><div id="divBoxGeneral" class="is-tab-content active" data-group="boxsettings" style="display:flex;padding-top:0"><div id="divBoxSize"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Box Size")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-smaller" style="width:40px;">-</button><button title="'+n("Increase")+'" class="cmd-box-larger" style="width:40px;border-left:none">+</button><br style="clear:both"></div></div>',i+='<div id="divContentSize"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Content Size")+': <span class="val-box-size" style="font-size:12px"></span></div><div style="display: flex;flex-direction: row;flex-wrap: wrap;"><input class="inp-box-size" type="text" style="display:none;width:80px;height:35px;text-align:center;font-size:12px;" /><button class="cmd-box-size" data-value="500" style="width:40px;border-left:none">500</button><button class="cmd-box-size" data-value="600" style="width:40px;border-left:none">600</button><button class="cmd-box-size" data-value="700" style="width:40px;border-left:none">700</button><button class="cmd-box-size" data-value="800" style="width:40px;border-top:none">800</button><button class="cmd-box-size" data-value="900" style="width:40px;border-top:none">900</button><button class="cmd-box-size" data-value="1000" style="width:40px;border-top:none;border-left:none">1000</button><button class="cmd-box-size" data-value="1100" style="width:40px;border-top:none;border-left:none">1100</button><button class="cmd-box-size" data-value="1200" style="width:40px;border-top:none;border-left:none">1200</button><button class="cmd-box-size" data-value="1300" style="width:40px;border-top:none;border-left:none">1300</button><button class="cmd-box-size" data-value="1400" style="width:40px;border-top:none;border-left:none">1400</button><button class="cmd-box-size" data-value="1500" style="width:40px;border-top:none;border-left:none">1500</button><button class="cmd-box-size" data-value="1600" style="width:40px;border-top:none;border-left:none">1600</button><button class="cmd-box-size" data-value="1800" style="width:40px;border-top:none;border-left:none">1800</button><button title="'+n("Clear")+'" class="cmd-box-size" data-value=""><svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button><button title="'+n("Decrease")+'" class="cmd-box-size" data-value="-" style="width:40px;border-top:none;border-left:none">-</button><button title="'+n("Increase")+'"class="cmd-box-size" data-value="+" style="width:40px;border-top:none;border-left:none">+</button><br style="clear:both"></div></div>',i+='<div id="divBoxBackgroundColor"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Background Color")+':</div><div style="display:flex;"><button title="'+n("Background Color")+'" class="input-box-bgcolor is-btn-color" style="margin-right:15px"></button><button title="'+n("Gradient")+'" class="input-box-gradient classic" data-value="+">'+n("Gradient")+'</button></div><div style="padding-top:20px;padding-bottom: 3px;">'+n("Background Image")+':</div><div style="height:auto"><div style="display:flex;align-items:flex-end;"><div class="box-bgimage-preview"></div><label class="label-box-bgimage-grayscale label-checkbox" for="chkBoxBgImageGrayscale" style="margin:0;margin-left:8px;margin-bottom:5px;"><input id="chkBoxBgImageGrayscale" class="chk-box-bgimage-grayscale" type="checkbox" /> '+n("Grayscale")+'</label></div><div style="display:flex;align-items: flex-end;"><button title="'+n("Image")+'" class="input-box-bgimage"><svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg><span>'+n("Image")+'</span></button><button title="'+n("Remove")+'" class="input-box-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button><button title="'+n("Adjust")+'" class="input-box-bgimageadjust"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button></div></div></div><div id="divBoxPickPhoto" class="is-settings" style="padding-top:20px"><button class="cmd-box-pickphoto" data-value="" style="width:100%"><svg class="is-icon-flex" style=""><use xlink:href="#ion-image"></use></svg></button></div><div style="display:flex;justify-content:flex-end;"><button title="'+n("Add Text")+'" class="cmd-box-addtext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#ion-android-add"></use></svg> <span>'+n("Text")+'</span></button><button title="'+n("Remove Text")+'" class="cmd-box-removetext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg> <span>'+n("Clear")+'</span></button></div><p id="divNoBoxSettings" style="text-align: center;display:none;">'+n("This box has no available settings.")+"</p></div>",i+='<div id="divBoxClick" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><label for="inpBoxLinkSource" style="display:block;padding-top:20px;">'+n("Open")+':</label><div class="image-src" style="display:flex"><input id="inpBoxLinkSource" class="input-src" type="text" style="height:38px"><button title="'+n("Select")+'" class="input-select" style="flex:none;width:40px;height:38px;background:transparent;"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button><div class="image-larger5" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;"><form class="form-upload-larger" target="frameTargetBoxLinkUpload" method="post" action="'+this.builder.largerImageHandler+'" enctype="multipart/form-data" style="position:absolute;top:0;left:0;width:100%;height:100%;"><input id="hidRefId5_box" name="hidRefId" type="hidden" value=""><svg class="is-icon-flex" style="position: absolute;top: 10px;left: 15px;"><use xlink:href="#ion-image"></use></svg><input title="'+n("Select")+'" id="fileImage5" name="fileImage" type="file" accept="image/*,video/mp4" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;"></form><iframe id="frameTargetBoxLinkUpload" tabindex="-1" name="frameTargetBoxLinkUpload" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe></div></div><div style="padding-top:20px"><button class="cmd-box-testclick">'+n("Test")+"</button></div></div>",i+='<div id="divBoxContentText" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Text Style")+':</div><div style="display:flex"><button title="'+n("Light")+'" class="cmd-box-textcolor" data-value="light">'+n("Light")+'</button><button title="'+n("Dark")+'" class="cmd-box-textcolor" data-value="dark" style="border-left:none;">'+n("Dark")+'</button><button title="'+n("Not Set")+'" class="cmd-box-textcolor" data-value="" style="border-left:none;">'+n("Not Set")+'</button><br style="clear:both"></div></div><div style="padding-top:20px;"><label for="chkOptimizeTextSize" style="margin:0;"><input id="chkOptimizeTextSize" type="checkbox" /> '+n("Optimize text sizes on large screen.")+"</label></div>",i+='<div id="divContainerTransparency" style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Transparency")+':</div><div style="display:flex"><button title="'+n("Increase")+'" class="cmd-box-textopacity" data-value="+" style="width:40px"> + </button><button title="'+n("Decrease")+'" class="cmd-box-textopacity" data-value="-" style="width:40px;border-left:none;"> - </button><button title="'+n("Not Set")+'" class="cmd-box-textopacity" data-value="" style="border-left:none;">'+n("Not Set")+'</button><br style="clear:both"></div></div><div id="divContainerTextAlign" style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">Align:</div><div style="display:flex"><button title="'+n("Align Left")+'" class="cmd-box-textalign" data-value="left" style="width:40px"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-left"></use></svg></button><button title="'+n("Align Center")+'" class="cmd-box-textalign" data-value="center" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-center"></use></svg></button><button title="'+n("Align Right")+'" class="cmd-box-textalign" data-value="right" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-right"></use></svg></button><button title="'+n("Align Full")+'" class="cmd-box-textalign" data-value="justify" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-full"></use></svg></button><button title="'+n("Not Set")+'" class="cmd-box-textalign" data-value="" style="border-left:none;">'+n("Not Set")+'</button><br style="clear:both"></div></div>',i+=(this.builder.settings.enableContentStyle?'<div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Typography")+':</div><div style="display:flex"><button title="'+n("Change Style")+'" class="cmd-box-typography" data-value="+"> '+n("Change Style")+' </button><br style="clear:both"></div></div>':"")+'</div><div id="divBoxContentContainer" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><div style="padding-top:10px;"><label for="chkParallaxContent" style="margin:0;"><input id="chkParallaxContent" type="checkbox" /> '+n("Parallax")+'</label></div><div style="padding-top:10px;"><label for="chkFadeContent" style="margin:0;"><input id="chkFadeContent" type="checkbox" /> '+n("Fade")+"</label></div>",i+='<div style="display:flex;flex-direction: row;"><div style="display:flex;flex-direction: column;margin-right:20px;"><div style="padding-top:13px;padding-bottom: 3px;">'+n("Position")+':</div><div style="display:flex"><button title="'+n("Top Left")+'" class="cmd-box-content-pos" data-value="topleft" style="width:40px;">↖</button><button title="'+n("Top Center")+'" class="cmd-box-content-pos" data-value="topcenter" style="width:40px;border-left:none;">↑</button><button title="'+n("Top Right")+'" class="cmd-box-content-pos" data-value="topright" style="width:40px;border-left:none;">↗</button></div><div style="display:flex"><button title="'+n("Middle Left")+'" class="cmd-box-content-pos" data-value="middleleft" style="width:40px;border-top:none;">←</button><button title="'+n("Middle Center")+'" class="cmd-box-content-pos" data-value="middlecenter" style="width:40px;border-left:none;border-top:none;">☉</button><button title="'+n("Middle Right")+'" class="cmd-box-content-pos" data-value="middleright" style="width:40px;border-left:none;border-top:none;">→</button></div><div style="display:flex"><button title="'+n("Bottom Left")+'" class="cmd-box-content-pos" data-value="bottomleft" style="width:40px;border-top:none;">↙</button><button title="'+n("Bottom Center")+'" class="cmd-box-content-pos" data-value="bottomcenter" style="width:40px;border-left:none;border-top:none;">↓</button><button title="'+n("Bottom Right")+'" class="cmd-box-content-pos" data-value="bottomright" style="width:40px;border-left:none;border-top:none;">↘</button></div></div><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 1px;">'+n("Height")+':</div><div style="display: flex;flex-direction: row;flex-wrap: wrap;"><button title="'+n("Auto")+'" class="cmd-content-height" data-value="" style="width:60px">Auto</button><button title="'+n("Full")+'" class="cmd-content-height" data-value="100" style="width:40px">Full</button></div><div class="div-content-justify"><div style="padding-top:10px;padding-bottom: 1px;">'+n("Justify")+':</div><div style="display: flex;flex-direction: row;flex-wrap: wrap;"><button title="'+n("Top")+'" class="cmd-content-justify" data-value="flex-start" style="width:40px"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-arrow-bar-to-up"></use></svg></button><button title="'+n("Bottom")+'" class="cmd-content-justify" data-value="flex-end" style="width:40px"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-arrow-bar-to-down"></use></svg></button><button title="'+n("Space Between")+'" class="cmd-content-justify" data-value="space-between" style="width:40px"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-space-between"></use></svg></button></div></div></div></div>',i+='<div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Vertical Adjustment")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-content-edge-y" data-value="-" style="width:40px;">-</button><button title="'+n("Increase")+'" class="cmd-box-content-edge-y" data-value="+" style="width:40px;border-left:none;">+</button><button title="'+n("Not Set")+'" class="cmd-box-content-edge-y" data-value="" style="display:none;width:40px;border-left:none;min-width:100px;">'+n("Not Set")+'</button></div></div><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Horizontal Adjustment")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-content-edge-x" data-value="-" style="width:40px;">-</button><button title="'+n("Increase")+'" class="cmd-box-content-edge-x" data-value="+" style="width:40px;border-left:none;">+</button><button title="'+n("Not Set")+'" class="cmd-box-content-edge-x" data-value="" style="display:none;width:40px;border-left:none;min-width:100px;">'+n("Not Set")+'</button></div></div><div style="padding-top:13px;"><label for="chkAutofitContent" style="margin:0;"><input id="chkAutofitContent" type="checkbox" /> '+n("Autofit Content on Mobile")+"</label></div></div>",i+='<div id="divBoxImage" class="is-tab-content" data-group="boxsettings" style="padding-top:0">'+(null!=this.builder.settings.onCoverImageSelectClick?'<div style="padding-top:20px;"><button class="cmd-box-selectasset" style="width:120px;">'+n("Select Image")+'</button></div><div style="padding-top:20px;"><label for="chkAnimateBg" style="margin:0;"><input id="chkAnimateBg" type="checkbox" /> '+n("Ken Burns Effect")+"</label></div>":'<div style="padding-top:20px;"><label for="chkAnimateBg" style="margin:0;"><input id="chkAnimateBg" type="checkbox" /> '+n("Ken Burns Effect")+"</label></div>")+'<div style="padding-top:10px;"><label for="chkParallaxBg" style="margin:0;"><input id="chkParallaxBg" type="checkbox" /> '+n("Parallax")+" & "+n("Scale")+'</label></div><div style="padding-top:10px;"><label for="chkParallaxBg2" style="margin:0;"><input id="chkParallaxBg2" type="checkbox" /> '+n("Parallax")+" "+n("(visible on preview)")+"</label></div>",i+='<div style="padding-top:20px;padding-bottom: 3px;">'+n("Overlay Color")+':</div><div style="display:flex;"><button title="'+n("Overlay Color")+'" class="input-box-overlaycolor is-btn-color" style="margin-right:15px"></button></div><div style="display:flex;flex-direction: column;"><div style="padding-top:20px;padding-bottom: 3px;">'+n("Overlay Transparency")+':</div><div style="display:flex"><button title="'+n("Decrease")+'" class="cmd-box-overlayopacity" data-value="-" style="width:40px;border-left:none;">-</button><button title="'+n("Increase")+'" class="cmd-box-overlayopacity" data-value="+" style="width:40px;">+</button><button title="'+n("None")+'" class="cmd-box-overlayopacity" data-value="0" style="border-left:none;min-width:100px;">'+n("None")+'</button></div></div></div><div id="divBoxAnimate" class="is-tab-content" data-group="boxsettings" style="padding-top:0"><div style="display:flex;flex-direction: column;"><select class="cmd-box-animate"><option value="">'+n("None")+'</option><option value="is-pulse">pulse</option><option value="is-bounceIn">bounceIn</option><option value="is-fadeIn">fadeIn</option><option value="is-fadeInDown">fadeInDown</option><option value="is-fadeInLeft">fadeInLeft</option><option value="is-fadeInRight">fadeInRight</option><option value="is-fadeInUp">fadeInUp</option><option value="is-flipInX">flipInX</option><option value="is-flipInY">flipInY</option><option value="is-slideInUp">slideInUp</option><option value="is-slideInDown">slideInDown</option><option value="is-slideInLeft">slideInLeft</option><option value="is-slideInRight">slideInRight</option><option value="is-zoomIn">zoomIn</option></select><label for="chkAnimOnce" style="margin:10px 0 0;"><input id="chkAnimOnce" type="checkbox" /> '+n("Once")+"</label></div>",i+='<div><label style="padding-top:20px;">'+n("Delay")+': <select class="cmd-box-animatedelay" style="margin-top:3px;"><option value="">'+n("None")+'</option><option value="delay-0ms">0s</option><option value="delay-100ms">100ms</option><option value="delay-200ms">200ms</option><option value="delay-300ms">300ms</option><option value="delay-400ms">400ms</option><option value="delay-500ms">500ms</option><option value="delay-600ms">600ms</option><option value="delay-700ms">700ms</option><option value="delay-800ms">800ms</option><option value="delay-900ms">900ms</option><option value="delay-1000ms">1000ms</option><option value="delay-1100ms">1100ms</option><option value="delay-1200ms">1200ms</option><option value="delay-1300ms">1300ms</option><option value="delay-1400ms">1400ms</option><option value="delay-1500ms">1500ms</option><option value="delay-1600ms">1600ms</option><option value="delay-1700ms">1700ms</option><option value="delay-1800ms">1800ms</option><option value="delay-1900ms">1900ms</option><option value="delay-2000ms">2000ms</option><option value="delay-2100ms">2100ms</option><option value="delay-2200ms">2200ms</option><option value="delay-2300ms">2300ms</option><option value="delay-2400ms">2400ms</option><option value="delay-2500ms">2500ms</option><option value="delay-2600ms">2600ms</option><option value="delay-2700ms">2700ms</option><option value="delay-2800ms">2800ms</option><option value="delay-2900ms">2900ms</option><option value="delay-3000ms">3000ms</option></select></label></div><div style="padding-top:20px"><button class="cmd-box-animate-test" style="width:100%">'+n("Test")+'</button></div></div></div></div><div class="is-modal pickphoto" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true"><div style="max-width:1000px;height:570px;padding:0;box-sizing:border-box;position:relative;"><div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">'+n("Photos")+'</div><iframe style="position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-top:40px solid transparent;margin:0;box-sizing:border-box;" src="about:blank"></iframe></div></div>',Je.appendHtml(e,i);const o=e.querySelector(".is-modal.editbox");this.modalEditBox=o;const s=e.querySelector(".is-modal.editcustomcode"),a=e.querySelector(".is-modal.editmodule");new r(o);const l=o.querySelectorAll(".is-tabs a");l.forEach((t=>{t.addEventListener("click",(e=>{if(e.preventDefault(),Je.hasClass(t,"active"))return;l.forEach((t=>{Je.removeClass(t,"active")})),Je.addClass(t,"active");let i=t.getAttribute("data-content");o.querySelectorAll(".is-tab-content").forEach((t=>{t.style.display="none"})),o.querySelector("#"+i).style.display="block"}))})),o.querySelector("#tabBoxGeneral").click();o.querySelector(".cmd-box-smaller").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxWidthSmaller(),this.builder.settings.onChange()}));o.querySelector(".cmd-box-larger").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxWidthLarger(),this.builder.settings.onChange()}));o.querySelectorAll(".cmd-box-textcolor").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxTextColor(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-textalign").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxTextAlign(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-textopacity").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxTextOpacity(e),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-typography").forEach((t=>{t.addEventListener("click",(()=>{setTimeout((()=>{this.builder.hideModal(o),e.querySelector('.is-sidebar > button[data-command="typography"]').click();Je.appendHtml(e,'<div class="is-sidebar-overlay" style="position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,0.000001);z-index: 1000;"></div>');const t=e.querySelector(".is-sidebar-overlay");t&&t.addEventListener("click",(()=>{const t=document.querySelector(".is-sidebar-overlay");t&&(t.remove(),document.body.style.overflowY=""),document.querySelectorAll(".is-sidebar-button.active").forEach((t=>{Je.removeClass(t,"active")})),document.querySelectorAll(".is-sidebar-content.active").forEach((t=>{Je.removeClass(t,"active")}))})),e.querySelector('.is-sidebar > button[data-command="typography"]').setAttribute("data-applyto","box"),e.querySelector(".typo-target-default").style.display="none",e.querySelector(".typo-target-box").style.display="flex"}),10)}))}));o.querySelectorAll(".cmd-box-size").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();const e=this.builder.activeBox.querySelector(".is-container"),i=this.builder.contentSizes;let n,s=t.getAttribute("data-value");if(""===s)return e.style.maxWidth="",e.classList.forEach((t=>{-1!==t.indexOf("is-content-")&&"is-content-left"!==t&&"is-content-right"!==t&&Je.removeClass(e,t)})),Je.addClass(e,"is-content-none"),o.querySelector(".inp-box-size").value="",o.querySelector(".val-box-size").innerHTML="",void this.builder.settings.onChange();if("+"===s||"-"===s){for(let t=0;t<i.length;t++)if(Je.hasClass(e,`is-content-${i[t]}`)){if("+"===s){n=t+1>=i.length?i[t]:i[t+1];break}if("-"===s){n=t-1<0?i[t]:i[t-1];break}}if(!n){const t=e.offsetWidth;for(let e=0;e<i.length;e++){if(i[e]<=t&&t<i[e+1]&&"+"===s){n=i[e+1];break}if(i[e]<t&&t<=i[e+1]&&"-"===s){n=i[e];break}}}}else n=s;n||(n=800),e.style.maxWidth="",e.classList.forEach((t=>{-1!==t.indexOf("is-content-")&&"is-content-left"!==t&&"is-content-right"!==t&&Je.removeClass(e,t)})),Je.addClass(e,"is-content-"+n),o.querySelector(".inp-box-size").value=n,o.querySelector(".val-box-size").innerHTML=n,this.builder.settings.onChange()}))}));const d=o.querySelector(".inp-box-size");d.addEventListener("input",(()=>{this.builder.editor.saveForUndo();const t=[];let e=300;for(;e<=2700;)t.push(e),e+=20;let i=this.builder.activeBox.querySelector(".is-container");i.classList.forEach((t=>{-1!==t.indexOf("is-content-")&&"is-content-left"!==t&&"is-content-right"!==t&&Je.removeClass(i,t)}));let n=d.value;if(!isNaN(n)&&n>=300&&n<=2700){i.style.maxWidth=n+"px";let e=parseInt(window.getComputedStyle(i,null).getPropertyValue("max-width"));for(let i=0;i<=121;i++){let n=t[i];if(n>e){e=n;break}}n=e,n<=300&&(n=300),n>=2700&&(n=2700),Je.addClass(i,"is-content-"+n)}this.builder.settings.onChange()}));o.querySelectorAll(".cmd-content-justify").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value"),i=this.builder.activeBox.querySelector(".is-container");i.style.justifyContent="",Je.removeClass(i,"justify-start"),Je.removeClass(i,"justify-end"),Je.removeClass(i,"justify-between"),"flex-start"===e?Je.addClass(i,"justify-start"):"flex-end"===e?Je.addClass(i,"justify-end"):"space-between"===e&&Je.addClass(i,"justify-between"),o.querySelectorAll(".cmd-content-justify").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(t,"on"),this.builder.settings.onChange()}))}));const c=o.querySelectorAll(".cmd-content-height"),u=o.querySelector(".div-content-justify");c.forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value"),i=this.builder.activeBox.querySelector(".is-container");if(""===e&&(i.style.height="",Je.removeClass(i,"h-full"),Je.removeClass(i,"flex"),Je.removeClass(i,"flex-col"),Je.removeClass(i,"justify-start"),Je.removeClass(i,"justify-end"),Je.removeClass(i,"justify-between"),u.style.display="none"),"100"===e){Je.addClass(i,"h-full"),Je.addClass(i,"flex"),Je.addClass(i,"flex-col"),Je.removeClass(i,"justify-start"),Je.removeClass(i,"justify-end"),Je.addClass(i,"justify-between"),u.style.display="block",o.querySelectorAll(".cmd-content-justify").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(o.querySelector('.cmd-content-justify[data-value="space-between"]'),"on")}o.querySelectorAll(".cmd-content-height").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(t,"on"),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-content-pos").forEach((t=>{t.addEventListener("click",(()=>{let e=this.builder.activeBox,i=e.querySelector(".is-box-centered"),n=e.querySelector(".is-container");this.builder.editor.saveForUndo(),Je.removeClass(e.querySelector(".edge-y--5"),"edge-y--5"),Je.removeClass(e.querySelector(".edge-y--4"),"edge-y--4"),Je.removeClass(e.querySelector(".edge-y--3"),"edge-y--3"),Je.removeClass(e.querySelector(".edge-y--2"),"edge-y--2"),Je.removeClass(e.querySelector(".edge-y--1"),"edge-y--1"),Je.removeClass(e.querySelector(".edge-y-0"),"edge-y-0"),Je.removeClass(e.querySelector(".edge-y-0-25"),"edge-y-0-25"),Je.removeClass(e.querySelector(".edge-y-0-5"),"edge-y-0-5"),Je.removeClass(e.querySelector(".edge-y-0-75"),"edge-y-0-75"),Je.removeClass(e.querySelector(".edge-y-1"),"edge-y-1"),Je.removeClass(e.querySelector(".edge-y-2"),"edge-y-2"),Je.removeClass(e.querySelector(".edge-y-3"),"edge-y-3"),Je.removeClass(e.querySelector(".edge-y-4"),"edge-y-4"),Je.removeClass(e.querySelector(".edge-y-5"),"edge-y-5"),Je.removeClass(e.querySelector(".edge-x--1"),"edge-x--1"),Je.removeClass(e.querySelector(".edge-x--0-75"),"edge-x--0-75"),Je.removeClass(e.querySelector(".edge-x--0-5"),"edge-x--0-5"),Je.removeClass(e.querySelector(".edge-x--0-25"),"edge-x--0-25"),Je.removeClass(e.querySelector(".edge-x-0"),"edge-x-0"),Je.removeClass(e.querySelector(".edge-x-0-25"),"edge-x-0-25"),Je.removeClass(e.querySelector(".edge-x-0-5"),"edge-x-0-5"),Je.removeClass(e.querySelector(".edge-x-0-75"),"edge-x-0-75"),Je.removeClass(e.querySelector(".edge-x-1"),"edge-x-1"),Je.removeClass(e.querySelector(".edge-x-2"),"edge-x-2"),Je.removeClass(e.querySelector(".edge-x-3"),"edge-x-3"),Je.removeClass(e.querySelector(".edge-x-4"),"edge-x-4"),Je.removeClass(e.querySelector(".edge-x-5"),"edge-x-5"),Je.removeClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.removeClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.removeClass(e,"is-content-top"),Je.removeClass(e,"is-content-bottom"),Je.removeClass(e.querySelector(".is-container"),"is-content-left"),Je.removeClass(e.querySelector(".is-container"),"is-content-right");let s=t.getAttribute("data-value");"topleft"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.addClass(e,"is-content-top"),Je.addClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),"topcenter"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.addClass(e,"is-content-top"),Je.removeClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(i,"edge-y-1")),"topright"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-top"),Je.addClass(e,"is-content-top"),Je.addClass(e.querySelector(".is-container"),"is-content-right"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),"middleleft"===s&&(Je.addClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(n,"edge-x-0-5")),"middleright"===s&&(Je.addClass(e.querySelector(".is-container"),"is-content-right"),Je.addClass(n,"edge-x-0-5")),"bottomleft"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.addClass(e,"is-content-bottom"),Je.addClass(e.querySelector(".is-container"),"is-content-left"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),"bottomcenter"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.addClass(e,"is-content-bottom"),Je.addClass(i,"edge-y-1")),"bottomright"===s&&(Je.addClass(e.querySelector(".is-box-centered"),"is-content-bottom"),Je.addClass(e,"is-content-bottom"),Je.addClass(e.querySelector(".is-container"),"is-content-right"),Je.addClass(i,"edge-y-1"),Je.addClass(n,"edge-x-0-5")),o.querySelectorAll(".cmd-box-content-pos").forEach((t=>{Je.removeClass(t,"on")})),Je.addClass(t,"on"),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-content-edge-x").forEach((t=>{t.addEventListener("click",(()=>{let e=this.builder.activeBox.querySelector(".is-container");this.builder.editor.saveForUndo();let i=t.getAttribute("data-value");if("-"===i){if(Je.hasClass(e,"edge-x--1"))return!1;Je.hasClass(e,"edge-x--0-75")?(Je.removeClass(e,"edge-x--0-75"),Je.addClass(e,"edge-x--1")):Je.hasClass(e,"edge-x--0-5")?(Je.removeClass(e,"edge-x--0-5"),Je.addClass(e,"edge-x--0-75")):Je.hasClass(e,"edge-x--0-25")?(Je.removeClass(e,"edge-x--0-25"),Je.addClass(e,"edge-x--0-5")):Je.hasClass(e,"edge-x-0")?(Je.removeClass(e,"edge-x-0"),Je.addClass(e,"edge-x--0-25")):Je.hasClass(e,"edge-x-0-25")?(Je.removeClass(e,"edge-x-0-25"),Je.addClass(e,"edge-x-0")):Je.hasClass(e,"edge-x-0-5")?(Je.removeClass(e,"edge-x-0-5"),Je.addClass(e,"edge-x-0-25")):Je.hasClass(e,"edge-x-0-75")?(Je.removeClass(e,"edge-x-0-75"),Je.addClass(e,"edge-x-0-5")):Je.hasClass(e,"edge-x-1")?(Je.removeClass(e,"edge-x-1"),Je.addClass(e,"edge-x-0-75")):Je.hasClass(e,"edge-x-2")?(Je.removeClass(e,"edge-x-2"),Je.addClass(e,"edge-x-1")):Je.hasClass(e,"edge-x-3")?(Je.removeClass(e,"edge-x-3"),Je.addClass(e,"edge-x-2")):Je.hasClass(e,"edge-x-4")?(Je.removeClass(e,"edge-x-4"),Je.addClass(e,"edge-x-3")):Je.hasClass(e,"edge-x-5")?(Je.removeClass(e,"edge-x-5"),Je.addClass(e,"edge-x-4")):Je.hasClass(e,"edge-x-6")?(Je.removeClass(e,"edge-x-6"),Je.addClass(e,"edge-x-5")):Je.addClass(e,"edge-x-0")}if("+"===i)if(Je.hasClass(e,"edge-x--1"))Je.removeClass(e,"edge-x--1"),Je.addClass(e,"edge-x--0-75");else if(Je.hasClass(e,"edge-x--0-75"))Je.removeClass(e,"edge-x--0-75"),Je.addClass(e,"edge-x--0-5");else if(Je.hasClass(e,"edge-x--0-5"))Je.removeClass(e,"edge-x--0-5"),Je.addClass(e,"edge-x--0-25");else if(Je.hasClass(e,"edge-x--0-25"))Je.removeClass(e,"edge-x--0-25"),Je.addClass(e,"edge-x-0");else if(Je.hasClass(e,"edge-x-0"))Je.removeClass(e,"edge-x-0"),Je.addClass(e,"edge-x-0-25");else if(Je.hasClass(e,"edge-x-0-25"))Je.removeClass(e,"edge-x-0-25"),Je.addClass(e,"edge-x-0-5");else if(Je.hasClass(e,"edge-x-0-5"))Je.removeClass(e,"edge-x-0-5"),Je.addClass(e,"edge-x-0-75");else if(Je.hasClass(e,"edge-x-0-75"))Je.removeClass(e,"edge-x-0-75"),Je.addClass(e,"edge-x-1");else if(Je.hasClass(e,"edge-x-1"))Je.removeClass(e,"edge-x-1"),Je.addClass(e,"edge-x-2");else if(Je.hasClass(e,"edge-x-2"))Je.removeClass(e,"edge-x-2"),Je.addClass(e,"edge-x-3");else if(Je.hasClass(e,"edge-x-3"))Je.removeClass(e,"edge-x-3"),Je.addClass(e,"edge-x-4");else if(Je.hasClass(e,"edge-x-4"))Je.removeClass(e,"edge-x-4"),Je.addClass(e,"edge-x-5");else if(Je.hasClass(e,"edge-x-5"))Je.removeClass(e,"edge-x-5"),Je.addClass(e,"edge-x-6");else{if(Je.hasClass(e,"edge-x-6"))return!1;Je.addClass(e,"edge-x-0")}""===i&&(Je.removeClass(e,"edge-x--1"),Je.removeClass(e,"edge-x--0-75"),Je.removeClass(e,"edge-x--0-5"),Je.removeClass(e,"edge-x--0-25"),Je.removeClass(e,"edge-x-0"),Je.removeClass(e,"edge-x-0-25"),Je.removeClass(e,"edge-x-0-5"),Je.removeClass(e,"edge-x-0-75"),Je.removeClass(e,"edge-x-1"),Je.removeClass(e,"edge-x-2"),Je.removeClass(e,"edge-x-3"),Je.removeClass(e,"edge-x-4"),Je.removeClass(e,"edge-x-5"),Je.removeClass(e,"edge-x-6")),this.builder.settings.onChange()}))}));o.querySelectorAll(".cmd-box-content-edge-y").forEach((t=>{t.addEventListener("click",(()=>{let e=this.builder.activeBox.querySelector(".is-box-centered");this.builder.editor.saveForUndo();let i=t.getAttribute("data-value");if("-"===i){if(Je.hasClass(e,"edge-y--5"))return!1;Je.hasClass(e,"edge-y--4")?(Je.removeClass(e,"edge-y--4"),Je.addClass(e,"edge-y--5")):Je.hasClass(e,"edge-y--3")?(Je.removeClass(e,"edge-y--3"),Je.addClass(e,"edge-y--4")):Je.hasClass(e,"edge-y--2")?(Je.removeClass(e,"edge-y--2"),Je.addClass(e,"edge-y--3")):Je.hasClass(e,"edge-y--1")?(Je.removeClass(e,"edge-y--1"),Je.addClass(e,"edge-y--2")):Je.hasClass(e,"edge-y-0")?(Je.removeClass(e,"edge-y-0"),Je.addClass(e,"edge-y--1")):Je.hasClass(e,"edge-y-0-25")?(Je.removeClass(e,"edge-y-0-25"),Je.addClass(e,"edge-y-0")):Je.hasClass(e,"edge-y-0-5")?(Je.removeClass(e,"edge-y-0-5"),Je.addClass(e,"edge-y-0-25")):Je.hasClass(e,"edge-y-0-75")?(Je.removeClass(e,"edge-y-0-75"),Je.addClass(e,"edge-y-0-5")):Je.hasClass(e,"edge-y-1")?(Je.removeClass(e,"edge-y-1"),Je.addClass(e,"edge-y-0-75")):Je.hasClass(e,"edge-y-2")?(Je.removeClass(e,"edge-y-2"),Je.addClass(e,"edge-y-1")):Je.hasClass(e,"edge-y-3")?(Je.removeClass(e,"edge-y-3"),Je.addClass(e,"edge-y-2")):Je.hasClass(e,"edge-y-4")?(Je.removeClass(e,"edge-y-4"),Je.addClass(e,"edge-y-3")):Je.hasClass(e,"edge-y-5")?(Je.removeClass(e,"edge-y-5"),Je.addClass(e,"edge-y-4")):Je.hasClass(e,"edge-y-6")?(Je.removeClass(e,"edge-y-6"),Je.addClass(e,"edge-y-5")):Je.hasClass(e,"edge-y-7")?(Je.removeClass(e,"edge-y-7"),Je.addClass(e,"edge-y-6")):Je.hasClass(e,"edge-y-8")?(Je.removeClass(e,"edge-y-8"),Je.addClass(e,"edge-y-7")):Je.addClass(e,"edge-y-0")}if("+"==i)if(Je.hasClass(e,"edge-y--5"))Je.removeClass(e,"edge-y--5"),Je.addClass(e,"edge-y--4");else if(Je.hasClass(e,"edge-y--4"))Je.removeClass(e,"edge-y--4"),Je.addClass(e,"edge-y--3");else if(Je.hasClass(e,"edge-y--3"))Je.removeClass(e,"edge-y--3"),Je.addClass(e,"edge-y--2");else if(Je.hasClass(e,"edge-y--2"))Je.removeClass(e,"edge-y--2"),Je.addClass(e,"edge-y--1");else if(Je.hasClass(e,"edge-y--1"))Je.removeClass(e,"edge-y--1"),Je.addClass(e,"edge-y-0");else if(Je.hasClass(e,"edge-y-0"))Je.removeClass(e,"edge-y-0"),Je.addClass(e,"edge-y-0-25");else if(Je.hasClass(e,"edge-y-0-25"))Je.removeClass(e,"edge-y-0-25"),Je.addClass(e,"edge-y-0-5");else if(Je.hasClass(e,"edge-y-0-5"))Je.removeClass(e,"edge-y-0-5"),Je.addClass(e,"edge-y-0-75");else if(Je.hasClass(e,"edge-y-0-75"))Je.removeClass(e,"edge-y-0-75"),Je.addClass(e,"edge-y-1");else if(Je.hasClass(e,"edge-y-1"))Je.removeClass(e,"edge-y-1"),Je.addClass(e,"edge-y-2");else if(Je.hasClass(e,"edge-y-2"))Je.removeClass(e,"edge-y-2"),Je.addClass(e,"edge-y-3");else if(Je.hasClass(e,"edge-y-3"))Je.removeClass(e,"edge-y-3"),Je.addClass(e,"edge-y-4");else if(Je.hasClass(e,"edge-y-4"))Je.removeClass(e,"edge-y-4"),Je.addClass(e,"edge-y-5");else if(Je.hasClass(e,"edge-y-5"))Je.removeClass(e,"edge-y-5"),Je.addClass(e,"edge-y-6");else if(Je.hasClass(e,"edge-y-6"))Je.removeClass(e,"edge-y-6"),Je.addClass(e,"edge-y-7");else if(Je.hasClass(e,"edge-y-7"))Je.removeClass(e,"edge-y-7"),Je.addClass(e,"edge-y-8");else{if(Je.hasClass(e,"edge-y-8"))return!1;Je.addClass(e,"edge-y-0")}""==i&&(Je.removeClass(e,"edge-y--5"),Je.removeClass(e,"edge-y--4"),Je.removeClass(e,"edge-y--3"),Je.removeClass(e,"edge-y--2"),Je.removeClass(e,"edge-y--1"),Je.removeClass(e,"edge-y-0"),Je.removeClass(e,"edge-y-0-25"),Je.removeClass(e,"edge-y-0-5"),Je.removeClass(e,"edge-y-0-75"),Je.removeClass(e,"edge-y-1"),Je.removeClass(e,"edge-y-2"),Je.removeClass(e,"edge-y-3"),Je.removeClass(e,"edge-y-4"),Je.removeClass(e,"edge-y-5"),Je.removeClass(e,"edge-y-6"),Je.removeClass(e,"edge-y-7"),Je.removeClass(e,"edge-y-8")),this.builder.settings.onChange()}))}));o.querySelector("#chkOptimizeTextSize").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxOptimizeTextSize(),this.builder.settings.onChange()}));o.querySelector("#chkParallaxContent").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxContainerAnim(),this.builder.settings.onChange()}));o.querySelector("#chkFadeContent").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxContainerAnim(),this.builder.settings.onChange()}));o.querySelector("#chkAutofitContent").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxContentAutofit(),this.builder.settings.onChange()}));o.querySelector(".cmd-box-pickphoto").addEventListener("click",(()=>{const t=o.querySelector(".is-modal.pickphoto");this.builder.showModal(t);const e=this.builder.settings.photoselect;t.querySelector("iframe").setAttribute("src",e)}));o.querySelector("#chkAnimateBg").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxAnimateBg(),this.builder.settings.onChange()}));o.querySelector("#chkParallaxBg").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxParallaxBg(),this.builder.settings.onChange()}));o.querySelector("#chkParallaxBg2").addEventListener("click",(()=>{this.builder.editor.saveForUndo(),this.boxParallaxBg2(),this.builder.settings.onChange()}));o.querySelectorAll(".cmd-box-overlayopacity").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();let e=t.getAttribute("data-value");this.boxOverlayOpacity(e),this.builder.settings.onChange()}))}));const p=o.querySelector(".cmd-box-selectasset");p&&p.addEventListener("click",(()=>{this.boxSelectAsset()}));const h=o.querySelector(".cmd-box-animate");h.addEventListener("change",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(),Je.removeClass(t,"is-animated"),Je.removeClass(t,"is-pulse"),Je.removeClass(t,"is-bounceIn"),Je.removeClass(t,"is-fadeIn"),Je.removeClass(t,"is-fadeInDown"),Je.removeClass(t,"is-fadeInLeft"),Je.removeClass(t,"is-fadeInRight"),Je.removeClass(t,"is-fadeInUp"),Je.removeClass(t,"is-flipInX"),Je.removeClass(t,"is-flipInY"),Je.removeClass(t,"is-slideInUp"),Je.removeClass(t,"is-slideInDown"),Je.removeClass(t,"is-slideInLeft"),Je.removeClass(t,"is-slideInRight"),Je.removeClass(t,"is-zoomIn"),Je.removeClass(t,"animated"),Je.removeClass(t,"pulse"),Je.removeClass(t,"bounceIn"),Je.removeClass(t,"fadeIn"),Je.removeClass(t,"fadeInDown"),Je.removeClass(t,"fadeInLeft"),Je.removeClass(t,"fadeInRight"),Je.removeClass(t,"fadeInUp"),Je.removeClass(t,"flipInX"),Je.removeClass(t,"flipInY"),Je.removeClass(t,"slideInUp"),Je.removeClass(t,"slideInDown"),Je.removeClass(t,"slideInLeft"),Je.removeClass(t,"slideInRight"),Je.removeClass(t,"zoomIn"),t.removeAttribute("data-scroll"),Je.removeClass(t,"is-inview"),""!==h.value?(Je.addClass(t,"is-animated"),Je.addClass(t,h.value),t.style.transition="none",t.style.opacity=0,setTimeout((()=>{t.style.transition="",t.style.opacity="",t.setAttribute("data-scroll",""),this.builder.settings.onChange(),this.builder.settings.onRender()}),30)):(this.builder.settings.onChange(),this.builder.settings.onRender())}));o.querySelector(".cmd-box-animate-test").addEventListener("click",(()=>{const t=this.builder.activeBox;Je.removeClass(t,"animated"),Je.removeClass(t,"pulse"),Je.removeClass(t,"bounceIn"),Je.removeClass(t,"fadeIn"),Je.removeClass(t,"fadeInDown"),Je.removeClass(t,"fadeInLeft"),Je.removeClass(t,"fadeInRight"),Je.removeClass(t,"fadeInUp"),Je.removeClass(t,"flipInX"),Je.removeClass(t,"flipInY"),Je.removeClass(t,"slideInUp"),Je.removeClass(t,"slideInDown"),Je.removeClass(t,"slideInLeft"),Je.removeClass(t,"slideInRight"),Je.removeClass(t,"zoomIn"),t.removeAttribute("data-scroll"),Je.removeClass(t,"is-inview"),""!==h.value?(Je.addClass(t,"is-animated"),Je.addClass(t,h.value),t.style.transition="none",t.style.opacity=0,setTimeout((()=>{t.style.transition="",t.style.opacity="",t.setAttribute("data-scroll",""),this.builder.settings.onChange(),this.builder.settings.onRender()}),30)):(this.builder.settings.onChange(),this.builder.settings.onRender())}));const g=o.querySelector("#chkAnimOnce");g.addEventListener("click",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(),g.checked?Je.addClass(t,"once"):Je.removeClass(t,"once"),this.builder.settings.onChange(),this.builder.settings.onRender()}));const f=o.querySelector(".cmd-box-animatedelay");f.addEventListener("change",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(),Je.removeClass(t,"delay-0ms"),Je.removeClass(t,"delay-100ms"),Je.removeClass(t,"delay-200ms"),Je.removeClass(t,"delay-300ms"),Je.removeClass(t,"delay-400ms"),Je.removeClass(t,"delay-500ms"),Je.removeClass(t,"delay-600ms"),Je.removeClass(t,"delay-700ms"),Je.removeClass(t,"delay-800ms"),Je.removeClass(t,"delay-900ms"),Je.removeClass(t,"delay-1000ms"),Je.removeClass(t,"delay-1100ms"),Je.removeClass(t,"delay-1200ms"),Je.removeClass(t,"delay-1300ms"),Je.removeClass(t,"delay-1400ms"),Je.removeClass(t,"delay-1500ms"),Je.removeClass(t,"delay-1600ms"),Je.removeClass(t,"delay-1700ms"),Je.removeClass(t,"delay-1800ms"),Je.removeClass(t,"delay-1900ms"),Je.removeClass(t,"delay-2000ms"),Je.removeClass(t,"delay-2100ms"),Je.removeClass(t,"delay-2200ms"),Je.removeClass(t,"delay-2300ms"),Je.removeClass(t,"delay-2400ms"),Je.removeClass(t,"delay-2500ms"),Je.removeClass(t,"delay-2600ms"),Je.removeClass(t,"delay-2700ms"),Je.removeClass(t,"delay-2800ms"),Je.removeClass(t,"delay-2900ms"),Je.removeClass(t,"delay-3000ms"),""!==f.value&&Je.addClass(t,f.value),this.builder.settings.onChange()}));const m=o.querySelector(".input-box-bgimage");m&&m.addEventListener("click",(()=>{const t=this.builder.activeBox.querySelector(".is-overlay-bg");let e="";t&&t.style.backgroundImage&&-1!==t.style.backgroundImage.indexOf("url(")&&(e=t.style.backgroundImage.slice(4,-1).replace(/["']/g,"")),this.builder.editor.openImagePicker(e,(t=>{this.boxImage(t);const e=this.builder.activeBox,i=e.querySelector(".is-overlay"),n=e.querySelector(".is-overlay-bg");n.style.filter="",i.style.filter="";o.querySelector(".chk-box-bgimage-grayscale").checked=!1,n.style.backgroundPosition="50% 60%",n.removeAttribute("data-scale"),n.removeAttribute("data-x"),n.removeAttribute("data-y"),n.style.top="",n.style.bottom="",n.style.left="",n.style.right="",n.style.width="",n.style.height=""}),m)}));const b=o.querySelector(".input-box-bgimageadjust");b&&b.addEventListener("click",(()=>{const t=this.builder.activeBox.querySelector(".is-overlay-bg");this.builder.editor.openImageAdjust(t,b)}));const v=o.querySelector(".chk-box-bgimage-grayscale");v.addEventListener("click",(()=>{const t=this.builder.activeBox,e=t.querySelector(".is-overlay"),i=t.querySelector(".is-overlay-bg");v.checked?(i.style.filter="grayscale(1)",e.style.filter="grayscale(1)"):(i.style.filter&&(i.style.filter=i.style.filter.replace("grayscale(1)","")),e.style.filter&&(e.style.filter=e.style.filter.replace("grayscale(1)","")))}));o.querySelector(".cmd-box-addtext").addEventListener("click",(()=>{const t=this.builder.activeBox,e=t.querySelector(".is-overlay");Je.appendHtml(e,'\n <div class="is-boxes">\n <div class="is-box-centered">\n <div class="is-container container" style="max-width: 440px;">\n \n </div>\n </div>\n </div>\n ',"afterend");let i=t.querySelector(".is-container");this.builder.editor.applyBehaviorOn(i),this.builder.onChange(),this.edit()}));o.querySelector(".cmd-box-removetext").addEventListener("click",(()=>{this.builder.editor.util.confirm(n("Are you sure you want to remove all text/content in this box?"),(t=>{if(t){const t=this.builder.activeBox.querySelector(".is-overlay").nextElementSibling;t.parentNode.removeChild(t),this.edit()}}))}));const y=o.querySelector(".input-box-bgremove");y&&y.addEventListener("click",(()=>{this.boxImage("")}));const _=this.builder.editor.colorpicker(),x=o.querySelector(".input-box-bgcolor");x.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeBox;let e=x.style.backgroundColor,i=t.querySelector(".is-overlay");_.open((e=>{t.style.backgroundColor="",t.style.backgroundImage="",i.style.backgroundColor=e,i.style.backgroundImage="",x.style.backgroundColor=e}),e)})),o.querySelector(".input-box-gradient").addEventListener("click",(()=>{const t=this.builder.activeBox;this.builder.editor.saveForUndo(!0);let e=t.querySelector(".is-overlay");this.builder.editor.gradientpicker().open(e,(()=>{t.style.backgroundColor="",t.style.backgroundImage=""}))}));const w=o.querySelector(".input-box-overlaycolor");w.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.builder.activeBox;let e=t.querySelector(".is-overlay");e||(t.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),e=t.querySelector(".is-overlay"));let i=e.querySelector(".is-overlay-bg");i||(e.insertAdjacentHTML("beforeend",'<div class="is-overlay-bg"></div>'),i=e.querySelector(".is-overlay-bg"));let n=i.querySelector(".is-overlay-color");n||(i.insertAdjacentHTML("beforeend",`<div class="is-overlay-color ${this.builder.cssClasses.opacity.opacity_5}"></div>`),n=i.querySelector(".is-overlay-color"));let o=n.style.backgroundColor;_.open((t=>{if("none"!==n.style.display&&0!==n.style.opacity||(n.style.display="block",n.style.opacity=.1),""===t){let t=i.querySelector(".is-overlay-color");t&&t.parentNode.removeChild(t)}else{let e=i.querySelector(".is-overlay-color");e||(i.insertAdjacentHTML("beforeend",`<div class="is-overlay-color ${this.builder.cssClasses.opacity.opacity_5}"></div>`),e=i.querySelector(".is-overlay-color")),e.style.backgroundColor=t}return w.style.backgroundColor=t,!1}),o)}));let S=this.builder.settings.largerImageHandler,C=this.builder.settings.onLargerImageUpload,k=this.builder.settings.onImageSelectClick,E=this.builder.settings.imageselect,A=this.builder.settings.onFileSelectClick,L=this.builder.settings.fileselect;""!==S||C||(o.querySelector(".image-larger5").style.display="none"),k||""!==E||(o.querySelector(".input-select").style.display="none");const q=o.querySelector(".input-src");try{this.builder.editor.dom.observeElement(q,"value",((t,e)=>{const i=this.builder.activeBox;let n=i.getAttribute("data-modal-url");n||(n=""),n!==e&&(this.builder.editor.saveForUndo(),this.builder.editor.dom.addClass(i,"block-click"),i.setAttribute("data-modal-url",e),this.builder.onChange())}))}catch(t){}if(k||E||A||L){const t=o.querySelector(".input-select");t&&t.addEventListener("click",(()=>{this.builder.editor.openAsset(o.querySelector(".input-src"),"media",t)}))}let T=o.querySelector("#fileImage5");T.addEventListener("change",(t=>{let e=T;for(;"form"!==e.nodeName.toLowerCase();)e=e.parentNode;let i=e;this.builder.editor.dom.addClass(i,"please-wait"),o.querySelector("#hidRefId5_box").value=this.builder.settings.customval,C?C(t):i.submit(),T.value=""})),q.addEventListener("focus",(()=>{this.builder.editor.saveForUndo(!0)})),q.addEventListener("keyup",(()=>{const t=this.builder.activeBox;""===q.value?(this.builder.editor.dom.removeClass(t,"block-click"),t.removeAttribute("data-modal-url")):(this.builder.editor.dom.addClass(t,"block-click"),t.setAttribute("data-modal-url",q.value)),this.builder.onChange()})),o.querySelector(".cmd-box-testclick").addEventListener("click",(()=>{const t=this.builder.activeBox;this.builder.editor.openMedia(t)}));s.querySelector(".input-ok").addEventListener("click",(()=>{let t=this.builder.activeBox.querySelector(".is-overlay-content[data-module]");this.builder.editor.saveForUndo();const i=e.querySelector("#hidBoxCustomCode"),n=e.querySelector("#txtBoxCustomCode");i.value=n.value,t.setAttribute("data-html",encodeURIComponent(i.value));let o=document.createRange();t.innerHTML="",t.appendChild(o.createContextualFragment(i.value)),this.builder.settings.onRender(),this.builder.settings.onChange(),this.builder.hideModal(s)}));a.querySelector(".input-ok").addEventListener("click",(()=>{let t=this.builder.doc.querySelector('[data-module-active="1"]');this.builder.editor.saveForUndo();let i=a.querySelector("iframe");i.contentWindow.construct&&i.contentWindow.construct(),this.builder.editor.saveForUndo();const n=e.querySelector("#hidModuleCode"),o=e.querySelector("#hidModuleSettings");t.setAttribute("data-html",encodeURIComponent(n.value)),t.setAttribute("data-settings",encodeURIComponent(o.value));let s=document.createRange();t.innerHTML="",t.appendChild(s.createContextualFragment(n.value)),this.builder.settings.onRender(),this.builder.settings.onChange(),this.builder.hideModal(a)}))}edit(){this.targetBox=null,this.builder.sidebar.closeSidebar();const t=this.builderStuff.querySelector(".is-modal.editbox"),e=this.builder.activeBox;let i=e.querySelector(".is-overlay");const n=e.querySelector(".is-overlay-bg"),o=e.querySelector(".is-video-bg"),s=e.querySelector(".is-overlay-content");let a=!1;if(n){this.builder.editor.dom.elementChildren(n).forEach((t=>{Je.hasClass(t,"is-overlay-color")||(a=!0)}))}if(n?(""==this.builder.settings.photoselect?t.querySelector("#divBoxPickPhoto").style.display="none":t.querySelector("#divBoxPickPhoto").style.display="block",a?(t.querySelector("#chkAnimateBg").parentNode.parentNode.style.display="none",t.querySelector("#chkParallaxBg").parentNode.parentNode.style.display="none"):t.querySelector("#chkAnimateBg").parentNode.parentNode.style.display=""):t.querySelector("#divBoxPickPhoto").style.display="none",this.builder.settings.enableAnimation?t.querySelector("#tabBoxAnimate").style.display="":t.querySelector("#tabBoxAnimate").style.display="none",e.querySelector(".is-container")){e.querySelector(".is-container .is-module")?t.querySelector("#tabBoxContentText").style.display="none":t.querySelector("#tabBoxContentText").style.display="";let i=window.getComputedStyle(e,null).getPropertyValue("display");"table"===i||"table-cell"===i||"flex"===i?(t.querySelector("#tabBoxContentContainer").style.display="",t.querySelector("#divContentSize").style.display=""):(t.querySelector("#tabBoxContentContainer").style.display="none",t.querySelector("#divContentSize").style.display="none")}else t.querySelector("#tabBoxContentText").style.display="none",t.querySelector("#tabBoxContentContainer").style.display="none",t.querySelector("#divContentSize").style.display="none";let r="middle";(Je.hasClass(e,"is-content-top")||e.querySelector(".is-content-top"))&&(r="top"),(Je.hasClass(e,"is-content-bottom")||e.querySelector(".is-content-bottom"))&&(r="bottom");const l=e.querySelector(".is-builder");let d="center";if(l&&(Je.hasClass(l,"is-content-left")&&(d="left"),Je.hasClass(l,"is-content-right")&&(d="right")),t.querySelectorAll(".cmd-box-content-pos").forEach((t=>{Je.removeClass(t,"on")})),"top"===r&&"left"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="topleft"]'),"on"),"top"===r&&"center"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="topcenter"]'),"on"),"top"===r&&"right"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="topright"]'),"on"),"middle"===r&&"left"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="middleleft"]'),"on"),"middle"===r&&"center"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="middlecenter"]'),"on"),"middle"===r&&"right"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="middleright"]'),"on"),"bottom"===r&&"left"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="bottomleft"]'),"on"),"bottom"===r&&"center"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="bottomcenter"]'),"on"),"bottom"===r&&"right"===d&&Je.addClass(t.querySelector('.cmd-box-content-pos[data-value="bottomright"]'),"on"),t.querySelector("#divContainerTransparency").style.display="",t.querySelector("#divContainerTextAlign").style.display="",s&&(t.querySelector("#tabBoxContentText").style.display="",e.querySelector(".is-container")||(t.querySelector("#divContainerTransparency").style.display="none",t.querySelector("#divContainerTextAlign").style.display="none")),o?t.querySelector("#divBoxBackgroundColor").style.display="none":(t.querySelector("#divBoxBackgroundColor").style.display="",a&&(t.querySelector("#divBoxBackgroundColor").style.display="none")),n&&(Je.hasClass(n,"is-scale-animated")?t.querySelector("#chkAnimateBg").checked=!0:t.querySelector("#chkAnimateBg").checked=!1,n.getAttribute("data-top-bottom")||n.getAttribute("data-bottom-top")?t.querySelector("#chkParallaxBg").checked=!0:t.querySelector("#chkParallaxBg").checked=!1,"fixed"===n.style.backgroundAttachment?t.querySelector("#chkParallaxBg2").checked=!0:t.querySelector("#chkParallaxBg2").checked=!1),Je.hasClass(e,"is-section")?t.querySelector("#divBoxSize").style.display="none":t.querySelector("#divBoxSize").style.display="block",t.querySelector("#chkParallaxContent").checked=!1,t.querySelector("#chkFadeContent").checked=!1,l){let e=l.getAttribute("data-bottom-top");e&&(-1!==e.indexOf("translateY")&&(t.querySelector("#chkParallaxContent").checked=!0),-1!==e.indexOf("opacity")&&(t.querySelector("#chkFadeContent").checked=!0))}t.querySelector("#chkOptimizeTextSize").checked=!1,l&&Je.hasClass(l,"v2")&&(t.querySelector("#chkOptimizeTextSize").checked=!0),t.querySelector("#chkAutofitContent").checked=!1,Je.hasClass(e,"box-autofit")&&(t.querySelector("#chkAutofitContent").checked=!0),Je.addClass(e,"box-active"),this.builder.showModal(t,!1,(()=>{Je.removeClass(e,"box-active")})),t.focus(),l&&(t.querySelector(".val-box-size").innerHTML="",l.classList.forEach((e=>{if(-1!==e.indexOf("is-content-")&&"is-content-left"!==e&&"is-content-right"!==e){let i=e.replace("is-content-","");t.querySelector(".val-box-size").innerHTML=i}})));const c=t.querySelector(".cmd-box-animate");c.value="",Je.hasClass(e,"is-pulse")&&(c.value="is-pulse"),Je.hasClass(e,"is-bounceIn")&&(c.value="is-bounceIn"),Je.hasClass(e,"is-fadeIn")&&(c.value="is-fadeIn"),Je.hasClass(e,"is-fadeInDown")&&(c.value="is-fadeInDown"),Je.hasClass(e,"is-fadeInLeft")&&(c.value="is-fadeInLeft"),Je.hasClass(e,"is-fadeInRight")&&(c.value="is-fadeInRight"),Je.hasClass(e,"is-fadeInUp")&&(c.value="is-fadeInUp"),Je.hasClass(e,"is-flipInX")&&(c.value="is-flipInX"),Je.hasClass(e,"is-flipInY")&&(c.value="is-flipInY"),Je.hasClass(e,"is-slideInUp")&&(c.value="is-slideInUp"),Je.hasClass(e,"is-slideInDown")&&(c.value="is-slideInDown"),Je.hasClass(e,"is-slideInLeft")&&(c.value="is-slideInLeft"),Je.hasClass(e,"is-slideInRight")&&(c.value="is-slideInRight"),Je.hasClass(e,"is-zoomIn")&&(c.value="is-zoomIn");const u=t.querySelector("#chkAnimOnce");Je.hasClass(e,"once")?u.checked=!0:u.checked=!1;const p=t.querySelector(".cmd-box-animatedelay");Je.hasClass(e,"delay-0ms")&&(p.value="delay-0ms"),Je.hasClass(e,"delay-100ms")&&(p.value="delay-100ms"),Je.hasClass(e,"delay-200ms")&&(p.value="delay-20ms"),Je.hasClass(e,"delay-300ms")&&(p.value="delay-300ms"),Je.hasClass(e,"delay-400ms")&&(p.value="delay-400ms"),Je.hasClass(e,"delay-500ms")&&(p.value="delay-500ms"),Je.hasClass(e,"delay-600ms")&&(p.value="delay-600ms"),Je.hasClass(e,"delay-700ms")&&(p.value="delay-700ms"),Je.hasClass(e,"delay-800ms")&&(p.value="delay-800ms"),Je.hasClass(e,"delay-900ms")&&(p.value="delay-900ms"),Je.hasClass(e,"delay-1000ms")&&(p.value="delay-1000ms"),Je.hasClass(e,"delay-1100ms")&&(p.value="delay-1100ms"),Je.hasClass(e,"delay-1200ms")&&(p.value="delay-1200ms"),Je.hasClass(e,"delay-1300ms")&&(p.value="delay-1300ms"),Je.hasClass(e,"delay-1400ms")&&(p.value="delay-1400ms"),Je.hasClass(e,"delay-1500ms")&&(p.value="delay-1500ms"),Je.hasClass(e,"delay-1600ms")&&(p.value="delay-1600ms"),Je.hasClass(e,"delay-1700ms")&&(p.value="delay-1700ms"),Je.hasClass(e,"delay-1800ms")&&(p.value="delay-1800ms"),Je.hasClass(e,"delay-1900ms")&&(p.value="delay-1900ms"),Je.hasClass(e,"delay-2000ms")&&(p.value="delay-2000ms"),Je.hasClass(e,"delay-2100ms")&&(p.value="delay-2100ms"),Je.hasClass(e,"delay-2200ms")&&(p.value="delay-2200ms"),Je.hasClass(e,"delay-2300ms")&&(p.value="delay-2300ms"),Je.hasClass(e,"delay-2400ms")&&(p.value="delay-2400ms"),Je.hasClass(e,"delay-2500ms")&&(p.value="delay-2500ms"),Je.hasClass(e,"delay-2600ms")&&(p.value="delay-2600ms"),Je.hasClass(e,"delay-2700ms")&&(p.value="delay-2700ms"),Je.hasClass(e,"delay-2800ms")&&(p.value="delay-2800ms"),Je.hasClass(e,"delay-2900ms")&&(p.value="delay-2900ms"),Je.hasClass(e,"delay-3000ms")&&(p.value="delay-3000ms"),t.querySelector("#tabBoxImage").style.display="none";let h="";n&&n.style.backgroundImage&&-1!==n.style.backgroundImage.indexOf("url(")&&(h=n.style.backgroundImage.slice(4,-1).replace(/["']/g,""),t.querySelector("#tabBoxImage").style.display="inline-block");const g=t.querySelector(".box-bgimage-preview"),f=t.querySelector(".input-box-bgimageadjust"),m=t.querySelector(".label-box-bgimage-grayscale"),b=t.querySelector(".chk-box-bgimage-grayscale");f.style.display="none",m.style.display="none";const v=t.querySelector(".input-box-bgremove");v.style.display="none",b.checked=!1,""!==h?(g.innerHTML=`<img src="${h}">`,i&&i.style.filter&&-1!==i.style.filter.indexOf("grayscale")&&(b.checked=!0),n&&n.style.filter&&-1!==n.style.filter.indexOf("grayscale")&&(b.checked=!0,i.style.filter="grayscale(1)",n.style.filter=n.style.filter.replace("grayscale(1)","")),f.style.display="flex",v.style.display="flex",m.style.display="flex"):g.innerHTML="";const y=e.querySelector(".is-overlay-color"),_=t.querySelector(".input-box-overlaycolor");_.style.backgroundColor=y?y.style.backgroundColor:"transparent";const x=t.querySelector(".input-src");h=e.getAttribute("data-modal-url"),x.value=""!==h?h:"","none"===t.querySelector("#divBoxSize").style.display&&"none"===t.querySelector("#divBoxBackgroundColor").style.display&&"none"===t.querySelector("#tabBoxContentText").style.display&&"none"===t.querySelector("#tabBoxContentContainer").style.display&&"none"===t.querySelector("#tabBoxImage").style.display&&"none"===t.querySelector("#tabBoxAnimate").style.display&&"none"===t.querySelector("#tabBoxCustomHtml").style.display?t.querySelector("#divNoBoxSettings").style.display="block":t.querySelector("#divNoBoxSettings").style.display="none",i||(e.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),i=e.querySelector(".is-overlay")),Je.hasClass(e,"is-bg-light")&&(Je.removeClass(e,"is-bg-light"),i.style.backgroundColor||(i.style.backgroundColor="rgb(255, 255, 255)")),Je.hasClass(e,"is-bg-dark")&&(Je.removeClass(e,"is-bg-dark"),i.style.backgroundColor||(i.style.backgroundColor="rgb(17, 17, 17)")),Je.hasClass(e,"is-bg-grey")&&(Je.removeClass(e,"is-bg-grey"),i.style.backgroundColor||(i.style.backgroundColor="rgb(238, 239, 240)"));let w=t.querySelector(".input-box-bgcolor"),S=i.style.backgroundColor;S||(S=window.getComputedStyle(e,null).getPropertyValue("background-color"),"rgba(0, 0, 0, 0)"===S&&(S="")),w.style.backgroundColor=S;const C=t.querySelector(".cmd-box-addtext"),k=t.querySelector(".cmd-box-removetext");l?(C.style.display="none",k.style.display="flex"):(C.style.display="flex",k.style.display="none");let E=t.querySelectorAll(".cmd-content-height"),A=t.querySelector(".div-content-justify");E.forEach((t=>{Je.removeClass(t,"on")})),t.querySelectorAll(".cmd-content-justify").forEach((t=>{Je.removeClass(t,"on")})),l&&("100%"===l.style.height||Je.hasClass(l,"h-full")?(Je.addClass(t.querySelector('.cmd-content-height[data-value="100"]'),"on"),A.style.display="block",("flex-start"===l.style.justifyContent||Je.hasClass(l,"justify-start"))&&Je.addClass(t.querySelector('.cmd-content-justify[data-value="flex-start"]'),"on"),("flex-end"===l.style.justifyContent||Je.hasClass(l,"justify-end"))&&Je.addClass(t.querySelector('.cmd-content-justify[data-value="flex-end"]'),"on"),("space-between"===l.style.justifyContent||Je.hasClass(l,"justify-between"))&&Je.addClass(t.querySelector('.cmd-content-justify[data-value="space-between"]'),"on")):(Je.addClass(t.querySelector('.cmd-content-height[data-value=""]'),"on"),A.style.display="none"))}async editModule(){const t=this.builder.builderStuff;let e=this.builder.activeBox.querySelector(".is-overlay-content[data-module]");this.builder.wrapperEl.querySelectorAll("[data-module-active]").forEach((t=>{t.removeAttribute("data-module-active")})),e.setAttribute("data-module-active","1");let i=e.getAttribute("data-module");if("code"===i)if(this.builder.settings.htmlSyntaxHighlighting){let i=decodeURIComponent(e.getAttribute("data-html"));i=(0,Qe.html)(i),t.querySelector("#txtBoxCustomCode").value=i;let n=t.querySelectorAll("[data-source-active]");n.forEach((t=>{t.removeAttribute("data-source-active")})),n=t.querySelectorAll("[data-source-ok]"),n.forEach((t=>{t.removeAttribute("data-source-ok")})),n=t.querySelectorAll("[data-source-cancel]"),n.forEach((t=>{t.removeAttribute("data-source-cancel")}));let o=t.querySelector("#txtBoxCustomCode");o.setAttribute("data-source-active","1"),o.setAttribute("data-source-ok",".editcustomcode .input-ok"),o.setAttribute("data-source-cancel",".editcustomcode"),this.builder.editor.viewHtmlNormal()}else{const i=t.querySelector(".is-modal.editcustomcode");this.builder.showModal(i);let n=decodeURIComponent(e.getAttribute("data-html"));n=(0,Qe.html)(n);let o=t.querySelector("#txtBoxCustomCode");o.value=n,o.focus()}else{const t=document.querySelector(".is-modal.editmodule"),o=t.querySelector("iframe");o.style.opacity=0,o.style.transition="opacity 0.1s ease";let s=await fetch(this.builder.settings.modulePath+i+".html");s=await s.text();let a=o.contentWindow.document;a.open(),a.write(s),a.close(),this.builder.showModal(t),setTimeout((()=>{o.style.opacity=1}),200);let r=e.getAttribute("data-module-desc");const l=t.querySelector(".is-modal-bar");l.innerHTML=r||n("Module Settings");let d=e.getAttribute("data-dialog-width");d&&""!=d||(d="900px");let c=e.getAttribute("data-dialog-height");c&&""!=c||(c="570px"),t.childNodes.forEach((t=>{Je.hasClass(t,"is-modal-overlay")||(t.style.maxWidth=d,t.style.height=c)}))}}refreshModule(){const t=document.querySelector(".is-modal.editmodule"),e=this.builderStuff;let i=this.builder.doc.querySelector('[data-module-active="1"]'),n=t.querySelector("iframe");n.contentWindow.construct&&n.contentWindow.construct();const o=e.querySelector("#hidModuleCode"),s=e.querySelector("#hidModuleSettings");i.setAttribute("data-html",encodeURIComponent(o.value)),i.setAttribute("data-settings",encodeURIComponent(s.value));let a=document.createRange();i.innerHTML="",i.appendChild(a.createContextualFragment(o.value)),this.builder.settings.onRender(),this.builder.settings.onChange()}boxWidthSmaller(){let t,e;if(t=this.builder.activeBox,t.nextElementSibling){if(Je.hasClass(t,"is-box-1"))return;if(e=t.nextElementSibling,Je.hasClass(e,"is-box-12"))return;return this.boxMinus(t),this.boxPlus(e),!1}if(t.previousElementSibling){if(Je.hasClass(t,"is-box-1"))return;if(e=t.previousElementSibling,Je.hasClass(e,"is-box-12"))return;return this.boxMinus(t),this.boxPlus(e),!1}}boxWidthLarger(){let t,e;if(t=this.builder.activeBox,t.nextElementSibling){if(e=t.nextElementSibling,Je.hasClass(e,"is-box-1"))return;if(Je.hasClass(t,"is-box-12"))return;return this.boxPlus(t),this.boxMinus(e),!1}if(t.previousElementSibling){if(e=t.previousElementSibling,Je.hasClass(e,"is-box-1"))return;if(Je.hasClass(t,"is-box-12"))return;return this.boxPlus(t),this.boxMinus(e),!1}}boxPlus(t){for(let e=1;e<12;e++)if(Je.hasClass(t,"is-box-"+e))return Je.removeClass(t,"is-box-"+e),void Je.addClass(t,"is-box-"+(e+1))}boxMinus(t){for(let e=12;e>1;e--)if(Je.hasClass(t,"is-box-"+e))return Je.removeClass(t,"is-box-"+e),void Je.addClass(t,"is-box-"+(e-1))}boxTextColor(t){let e=this.builder.activeBox;"light"==t&&(Je.removeClass(e,"is-dark-text"),Je.addClass(e,"is-light-text")),"dark"==t&&(Je.removeClass(e,"is-light-text"),Je.addClass(e,"is-dark-text")),""==t&&(Je.removeClass(e,"is-dark-text"),Je.removeClass(e,"is-light-text"))}boxTextAlign(t){let e=this.builder.activeBox,i=e.querySelector(".center");Je.removeClass(i,"center"),e.querySelectorAll(".is-builder > div > div, .is-builder > div > div > *").forEach((t=>{t.style.textAlign="",Je.removeClass(t,this.builder.cssClasses.textAlign.left),Je.removeClass(t,this.builder.cssClasses.textAlign.center),Je.removeClass(t,this.builder.cssClasses.textAlign.right),Je.removeClass(t,this.builder.cssClasses.textAlign.justify),this.builder.editor.dom.doFunction(t,(t=>{t.closest(".is-section-tool")||t.closest(".is-box-tool")||t.closest(".is-tool")||t.closest(".is-rowadd-tool")||(t.style.textAlign="",Je.removeClass(t,this.builder.cssClasses.textAlign.left),Je.removeClass(t,this.builder.cssClasses.textAlign.center),Je.removeClass(t,this.builder.cssClasses.textAlign.right),Je.removeClass(t,this.builder.cssClasses.textAlign.justify))}),!0)})),"right"==t?(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-center"),Je.removeClass(e,"is-align-justify"),Je.addClass(e,"is-align-right")):"center"==t?(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-justify"),Je.addClass(e,"is-align-center")):"left"==t?(Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-center"),Je.removeClass(e,"is-align-justify"),Je.addClass(e,"is-align-left")):"justify"==t?(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-center"),Je.addClass(e,"is-align-justify")):""==t&&(Je.removeClass(e,"is-align-left"),Je.removeClass(e,"is-align-right"),Je.removeClass(e,"is-align-center"),Je.removeClass(e,"is-align-justify"))}boxTextOpacity(t){let e=this.builder.activeBox.querySelector(".is-box-centered");if("+"!==t)if("-"!==t)Je.removeClass(e,"is-opacity-20"),Je.removeClass(e,"is-opacity-25"),Je.removeClass(e,"is-opacity-30"),Je.removeClass(e,"is-opacity-35"),Je.removeClass(e,"is-opacity-40"),Je.removeClass(e,"is-opacity-45"),Je.removeClass(e,"is-opacity-50"),Je.removeClass(e,"is-opacity-55"),Je.removeClass(e,"is-opacity-60"),Je.removeClass(e,"is-opacity-65"),Je.removeClass(e,"is-opacity-70"),Je.removeClass(e,"is-opacity-75"),Je.removeClass(e,"is-opacity-80"),Je.removeClass(e,"is-opacity-85"),Je.removeClass(e,"is-opacity-90"),Je.removeClass(e,"is-opacity-95"),"0.7"==t&&Je.addClass(e,"is-opacity-70"),"0.75"==t&&Je.addClass(e,"is-opacity-75"),"0.8"==t&&Je.addClass(e,"is-opacity-80"),"0.85"==t&&Je.addClass(e,"is-opacity-85"),"0.90"==t&&Je.addClass(e,"is-opacity-90"),"0.95"==t&&Je.addClass(e,"is-opacity-95");else{if(Je.hasClass(e,"is-opacity-20"))return;Je.hasClass(e,"is-opacity-25")?(Je.removeClass(e,"is-opacity-25"),Je.addClass(e,"is-opacity-20")):Je.hasClass(e,"is-opacity-30")?(Je.removeClass(e,"is-opacity-30"),Je.addClass(e,"is-opacity-25")):Je.hasClass(e,"is-opacity-35")?(Je.removeClass(e,"is-opacity-35"),Je.addClass(e,"is-opacity-30")):Je.hasClass(e,"is-opacity-40")?(Je.removeClass(e,"is-opacity-40"),Je.addClass(e,"is-opacity-35")):Je.hasClass(e,"is-opacity-45")?(Je.removeClass(e,"is-opacity-45"),Je.addClass(e,"is-opacity-40")):Je.hasClass(e,"is-opacity-50")?(Je.removeClass(e,"is-opacity-50"),Je.addClass(e,"is-opacity-45")):Je.hasClass(e,"is-opacity-55")?(Je.removeClass(e,"is-opacity-55"),Je.addClass(e,"is-opacity-50")):Je.hasClass(e,"is-opacity-60")?(Je.removeClass(e,"is-opacity-60"),Je.addClass(e,"is-opacity-55")):Je.hasClass(e,"is-opacity-65")?(Je.removeClass(e,"is-opacity-65"),Je.addClass(e,"is-opacity-60")):Je.hasClass(e,"is-opacity-70")?(Je.removeClass(e,"is-opacity-70"),Je.addClass(e,"is-opacity-65")):Je.hasClass(e,"is-opacity-75")?(Je.removeClass(e,"is-opacity-75"),Je.addClass(e,"is-opacity-70")):Je.hasClass(e,"is-opacity-80")?(Je.removeClass(e,"is-opacity-80"),Je.addClass(e,"is-opacity-75")):Je.hasClass(e,"is-opacity-85")?(Je.removeClass(e,"is-opacity-85"),Je.addClass(e,"is-opacity-80")):Je.hasClass(e,"is-opacity-90")?(Je.removeClass(e,"is-opacity-90"),Je.addClass(e,"is-opacity-85")):Je.hasClass(e,"is-opacity-95")?(Je.removeClass(e,"is-opacity-95"),Je.addClass(e,"is-opacity-90")):Je.addClass(e,"is-opacity-95")}else Je.hasClass(e,"is-opacity-20")?(Je.removeClass(e,"is-opacity-20"),Je.addClass(e,"is-opacity-25")):Je.hasClass(e,"is-opacity-25")?(Je.removeClass(e,"is-opacity-25"),Je.addClass(e,"is-opacity-30")):Je.hasClass(e,"is-opacity-30")?(Je.removeClass(e,"is-opacity-30"),Je.addClass(e,"is-opacity-35")):Je.hasClass(e,"is-opacity-35")?(Je.removeClass(e,"is-opacity-35"),Je.addClass(e,"is-opacity-40")):Je.hasClass(e,"is-opacity-40")?(Je.removeClass(e,"is-opacity-40"),Je.addClass(e,"is-opacity-45")):Je.hasClass(e,"is-opacity-45")?(Je.removeClass(e,"is-opacity-45"),Je.addClass(e,"is-opacity-50")):Je.hasClass(e,"is-opacity-50")?(Je.removeClass(e,"is-opacity-50"),Je.addClass(e,"is-opacity-55")):Je.hasClass(e,"is-opacity-55")?(Je.removeClass(e,"is-opacity-55"),Je.addClass(e,"is-opacity-60")):Je.hasClass(e,"is-opacity-60")?(Je.removeClass(e,"is-opacity-60"),Je.addClass(e,"is-opacity-65")):Je.hasClass(e,"is-opacity-65")?(Je.removeClass(e,"is-opacity-65"),Je.addClass(e,"is-opacity-70")):Je.hasClass(e,"is-opacity-70")?(Je.removeClass(e,"is-opacity-70"),Je.addClass(e,"is-opacity-75")):Je.hasClass(e,"is-opacity-75")?(Je.removeClass(e,"is-opacity-75"),Je.addClass(e,"is-opacity-80")):Je.hasClass(e,"is-opacity-80")?(Je.removeClass(e,"is-opacity-80"),Je.addClass(e,"is-opacity-85")):Je.hasClass(e,"is-opacity-85")?(Je.removeClass(e,"is-opacity-85"),Je.addClass(e,"is-opacity-90")):Je.hasClass(e,"is-opacity-90")?(Je.removeClass(e,"is-opacity-90"),Je.addClass(e,"is-opacity-95")):Je.hasClass(e,"is-opacity-95")&&Je.removeClass(e,"is-opacity-95")}boxAnimateBg(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");e&&(this.modalEditBox.querySelector("#chkAnimateBg").checked?(Je.addClass(e,"is-scale-animated"),Je.addClass(e,"is-appeared")):(Je.removeClass(e,"is-scale-animated"),Je.removeClass(e,"is-appeared")))}boxParallaxBg(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");if(e)if(this.modalEditBox.querySelector("#chkParallaxBg").checked)e.setAttribute("data-bottom-top","transform:translateY(-120px) scale(1);"),e.setAttribute("data-top-bottom","transform:translateY(50px) scale(1.4)"),this.builder.settings.onRender();else{Je.removeClass(e,"skrollable"),Je.removeClass(e,"skrollable-between"),e.removeAttribute("data-bottom-top"),e.removeAttribute("data-top-bottom"),e.style.transform="translateY(0) scale(1)",e.style.transform="";let i=e.outerHTML;e.parentNode.removeChild(e),Je.appendHtml(t,i)}}boxParallaxBg2(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");e&&(this.modalEditBox.querySelector("#chkParallaxBg2").checked?e.style.backgroundAttachment="fixed":e.style.backgroundAttachment="")}boxOptimizeTextSize(){let t=this.builder.activeBox.querySelector(".is-builder");this.modalEditBox.querySelector("#chkOptimizeTextSize").checked?Je.addClass(t,"v2"):Je.removeClass(t,"v2")}boxContentAutofit(){let t=this.builder.activeBox;this.modalEditBox.querySelector("#chkAutofitContent").checked?Je.addClass(t,"box-autofit"):Je.removeClass(t,"box-autofit")}boxContainerAnim(){let t=this.builder.activeBox,e=this.builder.activeSection,i=t.querySelector(".is-builder"),n="20%",o=parseInt(window.getComputedStyle(e,null).getPropertyValue("min-height"));parseInt(o)<=50&&(n="10%");let s=this.modalEditBox.querySelector("#chkParallaxContent").checked,a=this.modalEditBox.querySelector("#chkFadeContent").checked;i.removeAttribute("data-100-bottom"),i.removeAttribute("data-center"),s&&!a?(i.setAttribute("data-bottom-top",`transform:translateY(-${n})`),i.removeAttribute("data-100-bottom"),i.setAttribute("data-top-bottom",`transform:translateY(${n})`)):a&&!s?(i.setAttribute("data-bottom-top","opacity:0"),i.setAttribute("data-100-bottom","opacity:1"),i.removeAttribute("data-top-bottom")):a&&s?(i.setAttribute("data-bottom-top",`transform:translateY(-${n});opacity:0;`),i.setAttribute("data-100-bottom","opacity:1"),i.setAttribute("data-top-bottom",`transform:translateY(${n})`)):(Je.removeClass(i,"skrollable"),Je.removeClass(i,"skrollable-between"),i.removeAttribute("data-bottom-top"),i.removeAttribute("data-100-bottom"),i.removeAttribute("data-top-bottom"),i.style.transform=""),this.builder.settings.onRender()}setElementClass(t,e,i,n){let o;for(let n=0;n<Object.keys(i).length;n++){let s=Object.values(i)[n];if(Je.hasClass(t,s)){if("+"===e){if(n+1===Object.keys(i).length)return;o=Object.values(i)[n+1];break}if("-"===e){if(n-1<0)return;o=Object.values(i)[n-1];break}}}if(o){for(let e=0;e<Object.keys(i).length;e++){let n=Object.values(i)[e];Je.removeClass(t,n)}Je.addClass(t,o)}else Je.addClass(t,n)}removeElementClass(t,e){for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];Je.removeClass(t,n)}}boxOverlayOpacity(t){let e=this.builder.activeBox.querySelector(".is-overlay");if(!e)return;let i=e.querySelector(".is-overlay-color");if(!i){e.querySelector(".is-overlay-bg").insertAdjacentHTML("afterbegin",`<div class="is-overlay-color ${this.builder.cssClasses.opacity.opacity_5}"></div>`),i=e.querySelector(".is-overlay-color")}if(this.builder.useCssClasses){const e=this.builder.cssClasses.opacity;"0"===t?(this.removeElementClass(i,e),Je.addClass(i,e.opacity_0)):this.setElementClass(i,t,e,e.opacity_10),i.style.opacity="",i.style.display=""}else{if("+"===t){let t=i.style.opacity;i.style.opacity=t?"0.01"===t?.025:"0.025"===t?.04:"0.04"===t?.055:"0.055"===t?.07:"0.07"===t?.085:"0.085"===t?.1:"0.1"===t?.125:"0.125"===t?.15:"0.15"===t?.2:"0.2"===t?.25:"0.25"===t?.3:"0.3"===t?.35:"0.35"===t?.4:"0.4"===t?.45:"0.45"===t?.5:"0.5"===t?.55:"0.55"===t||"0.6"===t?.6:.15:.1}if("-"===t){let t=i.style.opacity;i.style.opacity=t?"0.01"===t||"0.025"===t?.01:"0.04"===t?.025:"0.055"===t?.04:"0.07"===t?.055:"0.085"===t?.07:"0.1"===t?.085:"0.125"===t?.1:"0.15"===t?.125:"0.2"===t?.15:"0.25"===t?.2:"0.3"===t?.25:"0.35"===t?.3:"0.4"===t?.35:"0.45"===t?.4:"0.5"===t?.45:"0.55"===t?.5:"0.6"===t?.55:.15:.085}"0"===t&&(i.style.opacity="0")}return!1}boxSelectAsset(){let t=this.builder.activeBox.querySelector(".is-overlay");if(!t)return;let e=t.querySelector(".is-overlay-bg");return e?(this.builder.settings.onCoverImageSelectClick&&this.builder.settings.onCoverImageSelectClick(e),!1):void 0}boxImage(t,e){const i=this.builderStuff,n=i.querySelector(".waiting-indicator"),o=i.querySelector(".waiting-indicator-overlay");if(n&&n.parentNode.removeChild(n),o&&o.parentNode.removeChild(o),e)return void alert(e);let s;this.targetBox?(s=this.targetBox,this.targetBox=null):s=this.builder.activeBox;const a=this.modalEditBox;this.builder.editor.saveForUndo();let r=s.querySelector(".is-overlay");r||(s.insertAdjacentHTML("afterbegin",'<div class="is-overlay"></div>'),r=s.querySelector(".is-overlay"));const l=a.querySelector(".box-bgimage-preview"),d=a.querySelector(".input-box-bgimageadjust");d.style.display="none";const c=a.querySelector(".label-box-bgimage-grayscale");c.style.display="none";const u=a.querySelector(".input-box-bgremove");if(u.style.display="none",""!==t){let e=r.querySelector(".is-overlay-bg");e||(r.insertAdjacentHTML("beforeend",'<div class="is-overlay-bg"></div>'),e=r.querySelector(".is-overlay-bg")),e.style.backgroundImage="url('"+t+"')",e.style.backgroundPosition="50% 60%",l.innerHTML=`<img src="${t}">`,d.style.display="flex",u.style.display="flex",c.style.display="flex",e.style.filter="",r.style.filter="";a.querySelector(".chk-box-bgimage-grayscale").checked=!1,e.style.backgroundPosition="50% 60%",e.removeAttribute("data-scale"),e.removeAttribute("data-x"),e.removeAttribute("data-y"),e.style.top="",e.style.bottom="",e.style.left="",e.style.right="",e.style.width="",e.style.height="",a.querySelector("#tabBoxImage").style.display="inline-block"}else{let t=r.querySelector(".is-overlay-bg");t&&t.parentNode.removeChild(t);let e=r.querySelector(".is-overlay-color");e&&e.parentNode.removeChild(e);let i=r.querySelector(".is-overlay-content");i&&""===i.innerHTML&&i.parentNode.removeChild(i),l.innerHTML="";a.querySelector(".input-box-overlaycolor").style.backgroundColor="",a.querySelector("#tabBoxImage").style.display="none"}this.builder.onRender(),this.builder.onChange()}}var ei="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ii={exports:{}};!function(t,e){t.exports=function(){var t="object",e="function",i="undefined",n=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],o=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function r(i,n){var o=typeof i[n];return o==e||!(o!=t||!i[n])||"unknown"==o}function l(e,i){return!(typeof e[i]!=t||!e[i])}function d(t,e){return typeof t[e]!=i}function c(t){return function(e,i){for(var n=i.length;n--;)if(!t(e,i[n]))return!1;return!0}}var u=c(r),p=c(l),h=c(d);function g(t){return t&&u(t,a)&&h(t,s)}function f(t){return l(t,"body")?t.body:t.getElementsByTagName("body")[0]}var m,b,v={},y=typeof window!=i&&typeof document!=i,_={isHostMethod:r,isHostObject:l,isHostProperty:d,areHostMethods:u,areHostObjects:p,areHostProperties:h,isTextRange:g,getBody:f,forEach:[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var i=0,n=t.length;i<n;++i)e(t[i],i)}},x={version:"1.3.0",initialized:!1,isBrowser:y,supported:!0,util:_,features:{},modules:v,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==i||rangyAutoInitialize}};function w(t){typeof console!=i&&r(console,"log")&&console.log(t)}function S(t,e){y&&e?alert(t):w(t)}function C(t){x.initialized=!0,x.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,x.config.alertOnFail)}function k(t){S("Rangy warning: "+t,x.config.alertOnWarn)}x.fail=C,x.warn=k,{}.hasOwnProperty?(_.extend=m=function(t,e,i){var n,o;for(var s in e)e.hasOwnProperty(s)&&(n=t[s],o=e[s],i&&null!==n&&"object"==typeof n&&null!==o&&"object"==typeof o&&m(n,o,!0),t[s]=o);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},_.createOptions=function(t,e){var i={};return m(i,e),t&&m(i,t),i}):C("hasOwnProperty not supported"),y||C("Rangy can only run in a browser"),function(){var t;if(y){var e=document.createElement("div");e.appendChild(document.createElement("span"));var i=[].slice;try{1==i.call(e.childNodes,0)[0].nodeType&&(t=function(t){return i.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],i=0,n=t.length;i<n;++i)e[i]=t[i];return e}),_.toArray=t}(),y&&(r(document,"addEventListener")?b=function(t,e,i){t.addEventListener(e,i,!1)}:r(document,"attachEvent")?b=function(t,e,i){t.attachEvent("on"+e,i)}:C("Document does not have required addEventListener or attachEvent method"),_.addListener=b);var E=[];function A(t){return t.message||t.description||String(t)}function L(){if(y&&!x.initialized){var t,e=!1,i=!1;r(document,"createRange")&&(t=document.createRange(),u(t,o)&&h(t,n)&&(e=!0));var s=f(document);if(s&&"body"==s.nodeName.toLowerCase())if(s&&r(s,"createTextRange")&&g(t=s.createTextRange())&&(i=!0),e||i){var a;for(var l in x.initialized=!0,x.features={implementsDomRange:e,implementsTextRange:i},v)(a=v[l])instanceof O&&a.init(a,x);for(var d=0,c=E.length;d<c;++d)try{E[d](x)}catch(t){w("Rangy init listener threw an exception. Continuing. Detail: "+A(t))}}else C("Neither Range nor TextRange are available");else C("No body element found")}}function q(t,e,i){i&&(t+=" in module "+i.name),x.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function T(t,e,i,n){t[e]=function(){return q(e,i,n),t[i].apply(t,_.toArray(arguments))}}_.deprecationNotice=q,_.createAliasForDeprecatedMethod=T,x.init=L,x.addInitListener=function(t){x.initialized?t(x):E.push(t)};var M=[];function R(t){t=t||window,L();for(var e=0,i=M.length;e<i;++e)M[e](t)}function O(t,e,i){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=i}function B(t,e,i){var n=new O(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{i(x,e),e.supported=!0}catch(e){w("Module '"+t+"' failed to load: "+A(e)),e.stack&&w(e.stack)}}}));return v[t]=n,n}function N(){}function I(){}x.addShimListener=function(t){M.push(t)},y&&(x.shim=x.createMissingNativeApi=R,T(x,"createMissingNativeApi","shim")),O.prototype={init:function(){for(var t,e,i=this.dependencies||[],n=0,o=i.length;n<o;++n){if(e=i[n],!((t=v[e])&&t instanceof O))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){x.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){x.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},x.createModule=function(t){var e,i;2==arguments.length?(e=arguments[1],i=[]):(e=arguments[2],i=arguments[1]);var n=B(t,i,e);x.initialized&&x.supported&&n.init()},x.createCoreModule=function(t,e,i){B(t,e,i)},x.RangePrototype=N,x.rangePrototype=new N,x.selectionPrototype=new I,x.createCoreModule("DomUtil",[],(function(t,e){var i="undefined",n=t.util,o=n.getBody;n.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),n.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var s=document.createElement("div");n.areHostMethods(s,["insertBefore","appendChild","cloneNode"]||!n.areHostObjects(s,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),n.isHostProperty(s,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");n.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||!n.areHostObjects(s,["previousSibling","nextSibling","childNodes","parentNode"])||!n.areHostProperties(a,["data"]))||e.fail("Incomplete Text Node implementation");var r=function(t,e){for(var i=t.length;i--;)if(t[i]===e)return!0;return!1};function l(t){var e;return typeof t.namespaceURI==i||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function d(t){var e=t.parentNode;return 1==e.nodeType?e:null}function c(t){for(var e=0;t=t.previousSibling;)++e;return e}function u(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function p(t,e){var i,n=[];for(i=t;i;i=i.parentNode)n.push(i);for(i=e;i;i=i.parentNode)if(r(n,i))return i;return null}function h(t,e,i){for(var n=i?e:e.parentNode;n;){if(n===t)return!0;n=n.parentNode}return!1}function g(t,e){return h(t,e,!0)}function f(t,e,i){for(var n,o=i?t:t.parentNode;o;){if((n=o.parentNode)===e)return o;o=n}return null}function m(t){var e=t.nodeType;return 3==e||4==e||8==e}function b(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function v(t,e){var i=e.nextSibling,n=e.parentNode;return i?n.insertBefore(t,i):n.appendChild(t),t}function y(t,e,i){var n=t.cloneNode(!1);if(n.deleteData(0,e),t.deleteData(e,t.length-e),v(n,t),i)for(var o,s=0;o=i[s++];)o.node==t&&o.offset>e?(o.node=n,o.offset-=e):o.node==t.parentNode&&o.offset>c(t)&&++o.offset;return n}function _(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=i)return t.ownerDocument;if(typeof t.document!=i)return t.document;if(t.parentNode)return _(t.parentNode);throw e.createError("getDocument: no document found for node")}function x(t){var n=_(t);if(typeof n.defaultView!=i)return n.defaultView;if(typeof n.parentWindow!=i)return n.parentWindow;throw e.createError("Cannot get a window object for node")}function w(t){if(typeof t.contentDocument!=i)return t.contentDocument;if(typeof t.contentWindow!=i)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function S(t){if(typeof t.contentWindow!=i)return t.contentWindow;if(typeof t.contentDocument!=i)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function C(t){return t&&n.isHostMethod(t,"setTimeout")&&n.isHostObject(t,"document")}function k(t,e,i){var o;if(t?n.isHostProperty(t,"nodeType")?o=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?w(t):_(t):C(t)&&(o=t.document):o=document,!o)throw e.createError(i+"(): Parameter must be a Window object or DOM node");return o}function E(t){for(var e;e=t.parentNode;)t=e;return t}function A(t,i,n,o){var s,a,r,l,d;if(t==n)return i===o?0:i<o?-1:1;if(s=f(n,t,!0))return i<=c(s)?-1:1;if(s=f(t,n,!0))return c(s)<o?-1:1;if(!(a=p(t,n)))throw new Error("comparePoints error: nodes have no common ancestor");if((r=t===a?a:f(t,a,!0))===(l=n===a?a:f(n,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(d=a.firstChild;d;){if(d===r)return-1;if(d===l)return 1;d=d.nextSibling}}var L,q=!1;function T(t){try{return t.parentNode,!1}catch(t){return!0}}function M(t){if(!t)return"[No node]";if(q&&T(t))return"[Broken node]";if(m(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+c(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function R(t){for(var e,i=_(t).createDocumentFragment();e=t.firstChild;)i.appendChild(e);return i}function O(t,e,i){var n=o(t),s=t.createElement("div");s.contentEditable=""+!!i,e&&(s.innerHTML=e);var a=n.firstChild;return a?n.insertBefore(s,a):n.appendChild(s),s}function B(t){return t.parentNode.removeChild(t)}function N(t){this.root=t,this._next=t}function I(t){return new N(t)}function D(t,e){this.node=t,this.offset=e}function P(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var i=e.firstChild;e.innerHTML="<br />",q=T(i),t.features.crashyTextNodes=q}(),typeof window.getComputedStyle!=i?L=function(t,e){return x(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=i?L=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),N.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,i=this._current=this._next;if(this._current)if(t=i.firstChild)this._next=t;else{for(e=null;i!==this.root&&!(e=i.nextSibling);)i=i.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},D.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+M(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},P.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},P.prototype.toString=function(){return this.message},t.dom={arrayContains:r,isHtmlNamespace:l,parentElement:d,getNodeIndex:c,getNodeLength:u,getCommonAncestor:p,isAncestorOf:h,isOrIsAncestorOf:g,getClosestAncestorIn:f,isCharacterDataNode:m,isTextOrCommentNode:b,insertAfter:v,splitDataNode:y,getDocument:_,getWindow:x,getIframeWindow:S,getIframeDocument:w,getBody:o,isWindow:C,getContentDocument:k,getRootContainer:E,comparePoints:A,isBrokenNode:T,inspectNode:M,getComputedStyleProperty:L,createTestElement:O,removeNode:B,fragmentFromNodeChildren:R,createIterator:I,DomPosition:D},t.DOMException=P})),x.createCoreModule("DomRange",["DomUtil"],(function(t,e){var i=t.dom,n=t.util,o=i.DomPosition,s=t.DOMException,a=i.isCharacterDataNode,r=i.getNodeIndex,l=i.isOrIsAncestorOf,d=i.getDocument,c=i.comparePoints,u=i.splitDataNode,p=i.getClosestAncestorIn,h=i.getNodeLength,g=i.arrayContains,f=i.getRootContainer,m=t.features.crashyTextNodes,b=i.removeNode;function v(t,e){return 3!=t.nodeType&&(l(t,e.startContainer)||l(t,e.endContainer))}function y(t){return t.document||d(t.startContainer)}function _(t){return f(t.startContainer)}function x(t){return new o(t.parentNode,r(t))}function w(t){return new o(t.parentNode,r(t)+1)}function S(t,e,n){var o=11==t.nodeType?t.firstChild:t;return a(e)?n==e.length?i.insertAfter(t,e):e.parentNode.insertBefore(t,0==n?e:u(e,n)):n>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[n]),o}function C(t,e,i){if(Y(t),Y(e),y(e)!=y(t))throw new s("WRONG_DOCUMENT_ERR");var n=c(t.startContainer,t.startOffset,e.endContainer,e.endOffset),o=c(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return i?n<=0&&o>=0:n<0&&o>0}function k(t){for(var e,i,n,o=y(t.range).createDocumentFragment();i=t.next();){if(e=t.isPartiallySelectedSubtree(),i=i.cloneNode(!e),e&&(n=t.getSubtreeIterator(),i.appendChild(k(n)),n.detach()),10==i.nodeType)throw new s("HIERARCHY_REQUEST_ERR");o.appendChild(i)}return o}function E(t,e,n){var o,s,a,r;for(n=n||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(n.stop=!0);if(E(r=t.getSubtreeIterator(),e,n),r.detach(),n.stop)return}else for(o=i.createIterator(a);s=o.next();)if(!1===e(s))return void(n.stop=!0)}function A(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(A(e=t.getSubtreeIterator()),e.detach()):t.remove()}function L(t){for(var e,i,n=y(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),i=t.getSubtreeIterator(),e.appendChild(L(i)),i.detach()):t.remove(),10==e.nodeType)throw new s("HIERARCHY_REQUEST_ERR");n.appendChild(e)}return n}function q(t,e,i){var n,o=!(!e||!e.length),s=!!i;o&&(n=new RegExp("^("+e.join("|")+")$"));var r=[];return E(new M(t,!1),(function(e){if((!o||n.test(e.nodeType))&&(!s||i(e))){var l=t.startContainer;if(e!=l||!a(l)||t.startOffset!=l.length){var d=t.endContainer;e==d&&a(d)&&0==t.endOffset||r.push(e)}}})),r}function T(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+i.inspectNode(t.startContainer)+":"+t.startOffset+", "+i.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function M(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var i=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==i||a(this.sc)?p(this.sc,i,!0):this.sc.childNodes[this.so],this._last=this.ec!==i||a(this.ec)?p(this.ec,i,!0):this.ec.childNodes[this.eo-1])}}M.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,i=this._current;!a(i)||i!==this.sc&&i!==this.ec?i.parentNode&&b(i):(t=i===this.sc?this.so:0)!=(e=i===this.ec?this.eo:i.length)&&i.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return v(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new mt(y(this.range));var e=this._current,i=e,n=0,o=e,s=h(e);l(e,this.sc)&&(i=this.sc,n=this.so),l(e,this.ec)&&(o=this.ec,s=this.eo),ft(t,i,n,o,s)}return new M(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var R=[1,3,4,5,7,8,10],O=[2,9,11],B=[5,6,10,12],N=[1,3,4,5,7,8,10,11],I=[1,3,4,5,7,8];function D(t){return function(e,i){for(var n,o=i?e:e.parentNode;o;){if(n=o.nodeType,g(t,n))return o;o=o.parentNode}return null}}var P=D([9,11]),$=D(B),z=D([6,10,12]);function H(t,e){if(z(t,e))throw new s("INVALID_NODE_TYPE_ERR")}function j(t,e){if(!g(e,t.nodeType))throw new s("INVALID_NODE_TYPE_ERR")}function F(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new s("INDEX_SIZE_ERR")}function U(t,e){if(P(t,!0)!==P(e,!0))throw new s("WRONG_DOCUMENT_ERR")}function W(t){if($(t,!0))throw new s("NO_MODIFICATION_ALLOWED_ERR")}function V(t,e){if(!t)throw new s(e)}function G(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function X(t){return!!t.startContainer&&!!t.endContainer&&!(m&&(i.isBrokenNode(t.startContainer)||i.isBrokenNode(t.endContainer)))&&f(t.startContainer)==f(t.endContainer)&&G(t.startContainer,t.startOffset)&&G(t.endContainer,t.endOffset)}function Y(t){if(!X(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var K=document.createElement("style"),Z=!1;try{K.innerHTML="<b>x</b>",Z=3==K.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=Z;var Q=Z?function(t){var e=this.startContainer,n=d(e);if(!e)throw new s("INVALID_STATE_ERR");var o=null;return 1==e.nodeType?o=e:a(e)&&(o=i.parentElement(e)),(o=null===o||"HTML"==o.nodeName&&i.isHtmlNamespace(d(o).documentElement)&&i.isHtmlNamespace(o)?n.createElement("body"):o.cloneNode(!1)).innerHTML=t,i.fragmentFromNodeChildren(o)}:function(t){var e=y(this).createElement("body");return e.innerHTML=t,i.fragmentFromNodeChildren(e)};function J(t,e){Y(t);var i=t.startContainer,n=t.startOffset,o=t.endContainer,s=t.endOffset,l=i===o;a(o)&&s>0&&s<o.length&&u(o,s,e),a(i)&&n>0&&n<i.length&&(i=u(i,n,e),l?(s-=n,o=i):o==i.parentNode&&s>=r(i)&&s++,n=0),t.setStartAndEnd(i,n,o,s)}function tt(t){Y(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var et=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],it=0,nt=1,ot=2,st=3,at=0,rt=1,lt=2,dt=3;function ct(t){t.START_TO_START=it,t.START_TO_END=nt,t.END_TO_END=ot,t.END_TO_START=st,t.NODE_BEFORE=at,t.NODE_AFTER=rt,t.NODE_BEFORE_AND_AFTER=lt,t.NODE_INSIDE=dt}function ut(t){ct(t),ct(t.prototype)}function pt(t,e){return function(){Y(this);var i,n=this.startContainer,o=this.startOffset,s=this.commonAncestorContainer,a=new M(this,!0);n!==s&&(n=(i=w(p(n,s,!0))).node,o=i.offset),E(a,W),a.reset();var r=t(a);return a.detach(),e(this,n,o,n,o),r}}function ht(e,i){function o(t,e){return function(i){j(i,R),j(f(i),O);var n=(t?x:w)(i);(e?s:l)(this,n.node,n.offset)}}function s(t,e,n){var o=t.endContainer,s=t.endOffset;e===t.startContainer&&n===t.startOffset||(f(e)==f(o)&&1!=c(e,n,o,s)||(o=e,s=n),i(t,e,n,o,s))}function l(t,e,n){var o=t.startContainer,s=t.startOffset;e===t.endContainer&&n===t.endOffset||(f(e)==f(o)&&-1!=c(e,n,o,s)||(o=e,s=n),i(t,o,s,e,n))}var d=function(){};d.prototype=t.rangePrototype,e.prototype=new d,n.extend(e.prototype,{setStart:function(t,e){H(t,!0),F(t,e),s(this,t,e)},setEnd:function(t,e){H(t,!0),F(t,e),l(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],n=t[1],o=e,s=n;switch(t.length){case 3:s=t[2];break;case 4:o=t[2],s=t[3]}i(this,e,n,o,s)},setBoundary:function(t,e,i){this["set"+(i?"Start":"End")](t,e)},setStartBefore:o(!0,!0),setStartAfter:o(!1,!0),setEndBefore:o(!0,!1),setEndAfter:o(!1,!1),collapse:function(t){Y(this),t?i(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):i(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){H(t,!0),i(this,t,0,t,h(t))},selectNode:function(t){H(t,!1),j(t,R);var e=x(t),n=w(t);i(this,e.node,e.offset,n.node,n.offset)},extractContents:pt(L,i),deleteContents:pt(A,i),canSurroundContents:function(){Y(this),W(this.startContainer),W(this.endContainer);var t=new M(this,!0),e=t._first&&v(t._first,this)||t._last&&v(t._last,this);return t.detach(),!e},splitBoundaries:function(){J(this)},splitBoundariesPreservingPositions:function(t){J(this,t)},normalizeBoundaries:function(){Y(this);var t,e=this.startContainer,n=this.startOffset,o=this.endContainer,s=this.endOffset,l=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(o=t,s=t.length,t.appendData(e.data),b(e))},d=function(t){var i=t.previousSibling;if(i&&i.nodeType==t.nodeType){e=t;var a=t.length;if(n=i.length,t.insertData(0,i.data),b(i),e==o)s+=n,o=e;else if(o==t.parentNode){var l=r(t);s==l?(o=t,s=a):s>l&&s--}}},c=!0;if(a(o))s==o.length?l(o):0==s&&(t=o.previousSibling)&&t.nodeType==o.nodeType&&(s=t.length,e==o&&(c=!1),t.appendData(o.data),b(o),o=t);else{if(s>0){var u=o.childNodes[s-1];u&&a(u)&&l(u)}c=!this.collapsed}if(c){if(a(e))0==n?d(e):n==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(o==t&&(o=e,s+=e.length),e.appendData(t.data),b(t));else if(n<e.childNodes.length){var p=e.childNodes[n];p&&a(p)&&d(p)}}else e=o,n=s;i(this,e,n,o,s)},collapseToPoint:function(t,e){H(t,!0),F(t,e),this.setStartAndEnd(t,e)}}),ut(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:i.getCommonAncestor(t.startContainer,t.endContainer)}function ft(t,e,n,o,s){t.startContainer=e,t.startOffset=n,t.endContainer=o,t.endOffset=s,t.document=i.getDocument(e),gt(t)}function mt(t){this.startContainer=t,this.startOffset=0,this.endContainer=t,this.endOffset=0,this.document=t,gt(this)}n.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var i,n,o,s;Y(this),U(this.startContainer,e.startContainer);var a=t==st||t==it?"start":"end",r=t==nt||t==it?"start":"end";return i=this[a+"Container"],n=this[a+"Offset"],o=e[r+"Container"],s=e[r+"Offset"],c(i,n,o,s)},insertNode:function(t){if(Y(this),j(t,N),W(this.startContainer),l(t,this.startContainer))throw new s("HIERARCHY_REQUEST_ERR");var e=S(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(Y(this),this.collapsed)return y(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=y(this).createDocumentFragment()).appendChild(t),e;var i=new M(this,!0);return t=k(i),i.detach(),t},canSurroundContents:function(){Y(this),W(this.startContainer),W(this.endContainer);var t=new M(this,!0),e=t._first&&v(t._first,this)||t._last&&v(t._last,this);return t.detach(),!e},surroundContents:function(t){if(j(t,I),!this.canSurroundContents())throw new s("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);S(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){Y(this);for(var t,e=new mt(y(this)),i=et.length;i--;)e[t=et[i]]=this[t];return e},toString:function(){Y(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],i=new M(this,!0);return E(i,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),i.detach(),e.join("")},compareNode:function(t){Y(this);var e=t.parentNode,i=r(t);if(!e)throw new s("NOT_FOUND_ERR");var n=this.comparePoint(e,i),o=this.comparePoint(e,i+1);return n<0?o>0?lt:at:o>0?rt:dt},comparePoint:function(t,e){return Y(this),V(t,"HIERARCHY_REQUEST_ERR"),U(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)<0?-1:c(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return tt(this)},intersectsNode:function(t,e){if(Y(this),f(t)!=_(this))return!1;var i=t.parentNode,n=r(t);if(!i)return!0;var o=c(i,n,this.endContainer,this.endOffset),s=c(i,n+1,this.startContainer,this.startOffset);return e?o<=0&&s>=0:o<0&&s>0},isPointInRange:function(t,e){return Y(this),V(t,"HIERARCHY_REQUEST_ERR"),U(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)>=0&&c(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return C(this,t,!1)},intersectsOrTouchesRange:function(t){return C(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=c(this.startContainer,this.startOffset,t.startContainer,t.startOffset),i=c(this.endContainer,this.endOffset,t.endContainer,t.endOffset),n=this.cloneRange();return-1==e&&n.setStart(t.startContainer,t.startOffset),1==i&&n.setEnd(t.endContainer,t.endOffset),n}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==c(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==c(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new s("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==dt},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,h(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var i=e.getNodes([3]);if(i.length>0){e.setStart(i[0],0);var n=i.pop();return e.setEnd(n,n.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return Y(this),q(this,t,e)},getDocument:function(){return y(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var n=y(this),o=t.createRange(n);e=e||i.getBody(n),o.selectNodeContents(e);var s=this.intersection(o),a=0,r=0;return s&&(o.setEnd(s.startContainer,s.startOffset),r=(a=o.toString().length)+s.toString().length),{start:a,end:r,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,i=0;this.setStart(e,0),this.collapse(!0);for(var n,o,s,a,r=[e],l=!1,d=!1;!d&&(n=r.pop());)if(3==n.nodeType)o=i+n.length,!l&&t.start>=i&&t.start<=o&&(this.setStart(n,t.start-i),l=!0),l&&t.end>=i&&t.end<=o&&(this.setEnd(n,t.end-i),d=!0),i=o;else for(s=(a=n.childNodes).length;s--;)r.push(a[s])},getName:function(){return"DomRange"},equals:function(t){return mt.rangesEqual(this,t)},isValid:function(){return X(this)},inspect:function(){return T(this)},detach:function(){}}),ht(mt,ft),n.extend(mt,{rangeProperties:et,RangeIterator:M,copyComparisonConstants:ut,createPrototypeRange:ht,inspect:T,toHtml:tt,getRangeDocument:y,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=mt})),x.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var i,n,o=t.dom,s=t.util,a=o.DomPosition,r=t.DomRange,l=o.getBody,d=o.getContentDocument,c=o.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var n,a,c=r.rangeProperties;function u(t){for(var e,i=c.length;i--;)t[e=c[i]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function p(t,e,i,n,o){var s=t.startContainer!==e||t.startOffset!=i,a=t.endContainer!==n||t.endOffset!=o,r=!t.equals(t.nativeRange);(s||a||r)&&(t.setEnd(n,o),t.setStart(e,i))}i=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,u(this)},r.createPrototypeRange(i,p),(n=i.prototype).selectNode=function(t){this.nativeRange.selectNode(t),u(this)},n.cloneContents=function(){return this.nativeRange.cloneContents()},n.surroundContents=function(t){this.nativeRange.surroundContents(t),u(this)},n.collapse=function(t){this.nativeRange.collapse(t),u(this)},n.cloneRange=function(){return new i(this.nativeRange.cloneRange())},n.refresh=function(){u(this)},n.toString=function(){return this.nativeRange.toString()};var h=document.createTextNode("test");l(document).appendChild(h);var g=document.createRange();g.setStart(h,0),g.setEnd(h,0);try{g.setStart(h,1),n.setStart=function(t,e){this.nativeRange.setStart(t,e),u(this)},n.setEnd=function(t,e){this.nativeRange.setEnd(t,e),u(this)},a=function(t){return function(e){this.nativeRange[t](e),u(this)}}}catch(t){n.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(i){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}u(this)},n.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(i){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}u(this)},a=function(t,e){return function(i){try{this.nativeRange[t](i)}catch(n){this.nativeRange[e](i),this.nativeRange[t](i)}u(this)}}}n.setStartBefore=a("setStartBefore","setEndBefore"),n.setStartAfter=a("setStartAfter","setEndAfter"),n.setEndBefore=a("setEndBefore","setStartBefore"),n.setEndAfter=a("setEndAfter","setStartAfter"),n.selectNodeContents=function(t){this.setStartAndEnd(t,0,o.getNodeLength(t))},g.selectNodeContents(h),g.setEnd(h,3);var f=document.createRange();f.selectNodeContents(h),f.setEnd(h,4),f.setStart(h,2),-1==g.compareBoundaryPoints(g.START_TO_END,f)&&1==g.compareBoundaryPoints(g.END_TO_START,f)?n.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:n.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var m=document.createElement("div");m.innerHTML="123";var b=m.firstChild,v=l(document);v.appendChild(m),g.setStart(b,1),g.setEnd(b,2),g.deleteContents(),"13"==b.data&&(n.deleteContents=function(){this.nativeRange.deleteContents(),u(this)},n.extractContents=function(){var t=this.nativeRange.extractContents();return u(this),t}),v.removeChild(m),v=null,s.isHostMethod(g,"createContextualFragment")&&(n.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),l(document).removeChild(h),n.getName=function(){return"WrappedRange"},t.WrappedRange=i,t.createNativeRange=function(t){return(t=d(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var u=function(t){var e=t.parentElement(),i=t.duplicate();i.collapse(!0);var n=i.parentElement();(i=t.duplicate()).collapse(!1);var s=i.parentElement(),a=n==s?n:o.getCommonAncestor(n,s);return a==e?a:o.getCommonAncestor(e,a)},p=function(t){return 0==t.compareEndPoints("StartToEnd",t)},h=function(t,e,i,n,s){var r=t.duplicate();r.collapse(i);var l=r.parentElement();if(o.isOrIsAncestorOf(e,l)||(l=e),!l.canHaveHTML){var d=new a(l.parentNode,o.getNodeIndex(l));return{boundaryPosition:d,nodeInfo:{nodeIndex:d.offset,containerElement:d.node}}}var u=o.getDocument(l).createElement("span");u.parentNode&&o.removeNode(u);for(var p,h,g,f,m,b=i?"StartToStart":"StartToEnd",v=s&&s.containerElement==l?s.nodeIndex:0,y=l.childNodes.length,_=y,x=_;x==y?l.appendChild(u):l.insertBefore(u,l.childNodes[x]),r.moveToElementText(u),0!=(p=r.compareEndPoints(b,t))&&v!=_;){if(-1==p){if(_==v+1)break;v=x}else _=_==v+1?v:x;x=Math.floor((v+_)/2),l.removeChild(u)}if(m=u.nextSibling,-1==p&&m&&c(m)){var w;if(r.setEndPoint(i?"EndToStart":"EndToEnd",t),/[\r\n]/.test(m.data)){var S=r.duplicate(),C=S.text.replace(/\r\n/g,"\r").length;for(w=S.moveStart("character",C);-1==(p=S.compareEndPoints("StartToEnd",S));)w++,S.moveStart("character",1)}else w=r.text.length;f=new a(m,w)}else h=(n||!i)&&u.previousSibling,f=(g=(n||i)&&u.nextSibling)&&c(g)?new a(g,0):h&&c(h)?new a(h,h.data.length):new a(l,o.getNodeIndex(u));return o.removeNode(u),{boundaryPosition:f,nodeInfo:{nodeIndex:x,containerElement:l}}},g=function(t,e){var i,n,s,a,r=t.offset,d=o.getDocument(t.node),u=l(d).createTextRange(),p=c(t.node);return p?n=(i=t.node).parentNode:(i=r<(a=t.node.childNodes).length?a[r]:null,n=t.node),(s=d.createElement("span")).innerHTML="&#feff;",i?n.insertBefore(s,i):n.appendChild(s),u.moveToElementText(s),u.collapse(!e),n.removeChild(s),p&&u[e?"moveStart":"moveEnd"]("character",r),u};(n=function(t){this.textRange=t,this.refresh()}).prototype=new r(document),n.prototype.refresh=function(){var t,e,i,n=u(this.textRange);p(this.textRange)?e=t=h(this.textRange,n,!0,!0).boundaryPosition:(t=(i=h(this.textRange,n,!0,!1)).boundaryPosition,e=h(this.textRange,n,!1,!1,i.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},n.prototype.getName=function(){return"WrappedTextRange"},r.copyComparisonConstants(n);var f=function(t){if(t.collapsed)return g(new a(t.startContainer,t.startOffset),!0);var e=g(new a(t.startContainer,t.startOffset),!0),i=g(new a(t.endContainer,t.endOffset),!1),n=l(r.getRangeDocument(t)).createTextRange();return n.setEndPoint("StartToStart",e),n.setEndPoint("EndToEnd",i),n};if(n.rangeToTextRange=f,n.prototype.toTextRange=function(){return f(this)},t.WrappedTextRange=n,!t.features.implementsDomRange||t.config.preferTextRange){var m=Function("return this;")();void 0===m.Range&&(m.Range=n),t.createNativeRange=function(t){return t=d(t,e,"createNativeRange"),l(t).createTextRange()},t.WrappedRange=n}}t.createRange=function(i){return i=d(i,e,"createRange"),new t.WrappedRange(t.createNativeRange(i))},t.createRangyRange=function(t){return t=d(t,e,"createRangyRange"),new r(t)},s.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),s.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var i=e.document;void 0===i.createRange&&(i.createRange=function(){return t.createRange(i)}),i=e=null}))})),x.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var i,n,o="boolean",s="number",a=t.dom,r=t.util,l=r.isHostMethod,d=t.DomRange,c=t.WrappedRange,u=t.DOMException,p=a.DomPosition,h=t.features,g="Control",f=a.getDocument,m=a.getBody,b=d.rangesEqual;function v(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function y(t,i){if(t){if(a.isWindow(t))return t;if(t instanceof X)return t.win;var n=a.getContentDocument(t,e,i);return a.getWindow(n)}return window}function _(t){return y(t,"getWinSelection").getSelection()}function x(t){return y(t,"getDocSelection").document.selection}function w(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var S=l(window,"getSelection"),C=r.isHostObject(document,"selection");h.implementsWinGetSelection=S,h.implementsDocSelection=C;var k=C&&(!S||t.config.preferTextRange);if(k)i=x,t.isSelectionValid=function(t){var e=y(t,"isSelectionValid").document,i=e.selection;return"None"!=i.type||f(i.createRange().parentElement())==e};else{if(!S)return e.fail("Neither document.selection or window.getSelection() detected."),!1;i=_,t.isSelectionValid=function(){return!0}}t.getNativeSelection=i;var E=i();if(!E)return e.fail("Native selection was null (possibly issue 138?)"),!1;var A=t.createNativeRange(document),L=m(document),q=r.areHostProperties(E,["anchorNode","focusNode","anchorOffset","focusOffset"]);h.selectionHasAnchorAndFocus=q;var T=l(E,"extend");h.selectionHasExtend=T;var M=typeof E.rangeCount==s;h.selectionHasRangeCount=M;var R=!1,O=!0,B=T?function(e,i){var n=d.getRangeDocument(i),o=t.createRange(n);o.collapseToPoint(i.endContainer,i.endOffset),e.addRange(H(o)),e.extend(i.startContainer,i.startOffset)}:null;r.areHostMethods(E,["addRange","getRangeAt","removeAllRanges"])&&typeof E.rangeCount==s&&h.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var i=e.rangeCount,n=i>1,o=[],s=w(e),r=0;r<i;++r)o[r]=e.getRangeAt(r);var l=a.createTestElement(document,"",!1),d=l.appendChild(document.createTextNode(" ")),c=document.createRange();if(c.setStart(d,1),c.collapse(!0),e.removeAllRanges(),e.addRange(c),O=1==e.rangeCount,e.removeAllRanges(),!n){var u=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(u&&parseInt(u[1])>=36)R=!1;else{var p=c.cloneRange();c.setStart(d,0),p.setEnd(d,3),p.setStart(d,2),e.addRange(c),e.addRange(p),R=2==e.rangeCount}}for(a.removeNode(l),e.removeAllRanges(),r=0;r<i;++r)0==r&&s?B?B(e,o[r]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(o[r])):e.addRange(o[r])}}(),h.selectionSupportsMultipleRanges=R,h.collapsedNonEditableSelectionsSupported=O;var N,I,D=!1;function P(t,e,i){var n=i?"end":"start",o=i?"start":"end";t.anchorNode=e[n+"Container"],t.anchorOffset=e[n+"Offset"],t.focusNode=e[o+"Container"],t.focusOffset=e[o+"Offset"]}function $(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function z(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0}function H(e){var i;return e instanceof d?((i=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),i.setStart(e.startContainer,e.startOffset)):e instanceof c?i=e.nativeRange:h.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(i=e),i}function j(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,i=t.length;e<i;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function F(t){var i=t.getNodes();if(!j(i))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return i[0]}function U(t){return!!t&&void 0!==t.text}function W(t,e){var i=new c(e);t._ranges=[i],P(t,i,!1),t.rangeCount=1,t.isCollapsed=i.collapsed}function V(e){if(e._ranges.length=0,"None"==e.docSelection.type)z(e);else{var i=e.docSelection.createRange();if(U(i))W(e,i);else{e.rangeCount=i.length;for(var n,o=f(i.item(0)),s=0;s<e.rangeCount;++s)(n=t.createRange(o)).selectNode(i.item(s)),e._ranges.push(n);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,P(e,e._ranges[e.rangeCount-1],!1)}}}function G(t,i){for(var n=t.docSelection.createRange(),o=F(i),s=f(n.item(0)),a=m(s).createControlRange(),r=0,l=n.length;r<l;++r)a.add(n.item(r));try{a.add(o)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),V(t)}function X(t,e,i){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=i,this.refresh()}function Y(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0}L&&l(L,"createControlRange")&&(N=L.createControlRange(),r.areHostProperties(N,["item","add"])&&(D=!0)),h.implementsControlRange=D,n=q?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},l(E,"getRangeAt")?I=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:q&&(I=function(e){var i=f(e.anchorNode),n=t.createRange(i);return n.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),n.collapsed!==this.isCollapsed&&n.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),n}),X.prototype=t.selectionPrototype;var K=[];function Z(t,e){for(var i,n,o=K.length;o--;)if(n=(i=K[o]).selection,"deleteAll"==e)Y(n);else if(i.win==t)return"delete"==e?(K.splice(o,1),!0):n;return"deleteAll"==e&&(K.length=0),null}var Q=function(t){if(t&&t instanceof X)return t.refresh(),t;var e=Z(t=y(t,"getNativeSelection")),n=i(t),o=C?x(t):null;return e?(e.nativeSelection=n,e.docSelection=o,e.refresh()):(e=new X(n,o,t),K.push({win:t,selection:e})),e};t.getSelection=Q,r.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var J,tt=X.prototype;function et(t,i){for(var n,o=f(i[0].startContainer),s=m(o).createControlRange(),a=0,r=i.length;a<r;++a){n=F(i[a]);try{s.add(n)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}s.select(),V(t)}if(!k&&q&&r.areHostMethods(E,["removeAllRanges","addRange"])){tt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),z(this)};var it=function(t,e){B(t.nativeSelection,e),t.refresh()};tt.addRange=M?function(e,i){if(D&&C&&this.docSelection.type==g)G(this,e);else if(v(i)&&T)it(this,e);else{var o;R?o=this.rangeCount:(this.removeAllRanges(),o=0);var s=H(e).cloneRange();try{this.nativeSelection.addRange(s)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==o+1){if(t.config.checkSelectionRanges){var a=I(this.nativeSelection,this.rangeCount-1);a&&!b(a,e)&&(e=new c(a))}this._ranges[this.rangeCount-1]=e,P(this,e,nt(this.nativeSelection)),this.isCollapsed=n(this)}else this.refresh()}}:function(t,e){v(e)&&T?it(this,t):(this.nativeSelection.addRange(H(t)),this.refresh())},tt.setRanges=function(t){if(D&&C&&t.length>1)et(this,t);else{this.removeAllRanges();for(var e=0,i=t.length;e<i;++e)this.addRange(t[e])}}}else{if(!(l(E,"empty")&&l(A,"select")&&D&&k))return e.fail("No means of selecting a Range or TextRange was found"),!1;tt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=f(this.anchorNode);else if(this.docSelection.type==g){var e=this.docSelection.createRange();e.length&&(t=f(e.item(0)))}t&&(m(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}z(this)},tt.addRange=function(e){this.docSelection.type==g?G(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,P(this,e,!1))},tt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?et(this,t):e&&this.addRange(t[0])}}if(tt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new u("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},k)J=function(e){var i;t.isSelectionValid(e.win)?i=e.docSelection.createRange():(i=m(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==g?V(e):U(i)?W(e,i):z(e)};else if(l(E,"getRangeAt")&&typeof E.rangeCount==s)J=function(e){if(D&&C&&e.docSelection.type==g)V(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var i=0,o=e.rangeCount;i<o;++i)e._ranges[i]=new t.WrappedRange(e.nativeSelection.getRangeAt(i));P(e,e._ranges[e.rangeCount-1],nt(e.nativeSelection)),e.isCollapsed=n(e)}else z(e)};else{if(!q||typeof E.isCollapsed!=o||typeof A.collapsed!=o||!h.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;J=function(t){var e,i=t.nativeSelection;i.anchorNode?(e=I(i,0),t._ranges=[e],t.rangeCount=1,$(t),t.isCollapsed=n(t)):z(t)}}tt.refresh=function(t){var e=t?this._ranges.slice(0):null,i=this.anchorNode,n=this.anchorOffset;if(J(this),t){var o=e.length;if(o!=this._ranges.length)return!0;if(this.anchorNode!=i||this.anchorOffset!=n)return!0;for(;o--;)if(!b(e[o],this._ranges[o]))return!0;return!1}};var nt,ot=function(t,e){var i=t.getAllRanges();t.removeAllRanges();for(var n=0,o=i.length;n<o;++n)b(e,i[n])||t.addRange(i[n]);t.rangeCount||z(t)};function st(t,e){if(t.win.document!=f(e))throw new u("WRONG_DOCUMENT_ERR")}function at(e){return function(i,n){var o;this.rangeCount?(o=this.getRangeAt(0))["set"+(e?"Start":"End")](i,n):(o=t.createRange(this.win.document)).setStartAndEnd(i,n),this.setSingleRange(o,this.isBackward())}}function rt(t){var e=[],i=new p(t.anchorNode,t.anchorOffset),n=new p(t.focusNode,t.focusOffset),o="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var s=0,a=t.rangeCount;s<a;++s)e[s]=d.inspect(t.getRangeAt(s));return"["+o+"(Ranges: "+e.join(", ")+")(anchor: "+i.inspect()+", focus: "+n.inspect()+"]"}tt.removeRange=D&&C?function(t){if(this.docSelection.type==g){for(var e=this.docSelection.createRange(),i=F(t),n=f(e.item(0)),o=m(n).createControlRange(),s=!1,a=0,r=e.length;a<r;++a)e.item(a)!==i||s?o.add(e.item(a)):s=!0;o.select(),V(this)}else ot(this,t)}:function(t){ot(this,t)},!k&&q&&h.implementsDomRange?(nt=w,tt.isBackward=function(){return nt(this)}):nt=tt.isBackward=function(){return!1},tt.isBackwards=tt.isBackward,tt.toString=function(){for(var t=[],e=0,i=this.rangeCount;e<i;++e)t[e]=""+this._ranges[e];return t.join("")},tt.collapse=function(e,i){st(this,e);var n=t.createRange(e);n.collapseToPoint(e,i),this.setSingleRange(n),this.isCollapsed=!0},tt.collapseToStart=function(){if(!this.rangeCount)throw new u("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},tt.collapseToEnd=function(){if(!this.rangeCount)throw new u("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},tt.selectAllChildren=function(e){st(this,e);var i=t.createRange(e);i.selectNodeContents(e),this.setSingleRange(i)},tt.deleteFromDocument=function(){if(D&&C&&this.docSelection.type==g){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var i=this.getAllRanges();if(i.length){this.removeAllRanges();for(var n=0,o=i.length;n<o;++n)i[n].deleteContents();this.addRange(i[o-1])}}},tt.eachRange=function(t,e){for(var i=0,n=this._ranges.length;i<n;++i)if(t(this.getRangeAt(i)))return e},tt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},tt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},tt.callMethodOnEachRange=function(t,e){var i=[];return this.eachRange((function(n){i.push(n[t].apply(n,e||[]))})),i},tt.setStart=at(!0),tt.setEnd=at(!1),t.rangePrototype.select=function(t){Q(this.getDocument()).setSingleRange(this,t)},tt.changeEachRange=function(t){var e=[],i=this.isBackward();this.eachRange((function(i){t(i),e.push(i)})),this.removeAllRanges(),i&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},tt.containsNode=function(t,e){return this.eachRange((function(i){return i.containsNode(t,e)}),!0)||!1},tt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},tt.moveToBookmark=function(e){for(var i,n,o=[],s=0;i=e.rangeBookmarks[s++];)(n=t.createRange(this.win)).moveToBookmark(i),o.push(n);e.backward?this.setSingleRange(o[0],"backward"):this.setRanges(o)},tt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},tt.restoreRanges=function(t){this.removeAllRanges();for(var e,i=0;e=t.ranges[i];++i)this.addRange(e,t.backward&&0==i)},tt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(d.toHtml(e))})),t.join("")},h.implementsTextRange&&(tt.getNativeTextRange=function(){var i;if(i=this.docSelection){var n=i.createRange();if(U(n))return n;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),tt.getName=function(){return"WrappedSelection"},tt.inspect=function(){return rt(this)},tt.detach=function(){Z(this.win,"delete"),Y(this)},X.detachAll=function(){Z(null,"deleteAll")},X.inspect=rt,X.isDirectionBackward=v,t.Selection=X,t.selectionPrototype=tt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return Q(t)}),t=null}))}));var D=!1,P=function(t){D||(D=!0,!x.initialized&&x.config.autoInitialize&&L())};return y&&("complete"==document.readyState?P():(r(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",P,!1),b(window,"load",P))),x}()}(ii);var ni=ii.exports;class oi{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}confirm(t,e,i,n){const o=this.dom;let s="";s=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(s=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const a=this.builder.builderStuff;let r=a.querySelector(".is-confirm");r||(o.appendHtml(a,s),r=a.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let l=r.querySelector(".is-confirm .input-ok");o.addEventListener(l,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let d=r.querySelector(".is-confirm .input-cancel");o.addEventListener(d,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()}))}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const o=e=>{if(!t.contains(e.target)&&!i.contains(e.target)){const i=document.querySelector(".pickcolormore.active");if(i&&i.contains(e.target))return;this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o)}},s=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))};t.addEventListener("keydown",s),document.addEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",o)}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",this.handlePopClickOut)}showPop(t,e,i){const n=this.dom;let o=document.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(o,(e=>{e!==t&&(e.style.display="",n.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),this.clearAllEventListener(t),t.style.display="flex",n.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",this.handlePopClickOut)}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n){const o=this.dom;o.addClass(t,"active"),t.setAttribute("aria-hidden",!1);const s=e=>{if(27===e.keyCode){o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",s);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}};t.addEventListener("keydown",s);let a=t.querySelector(".is-tab-content.active");a?(a.focus(),this.builder.tabs.setupTabKey(a)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const l=t.querySelector(".is-modal-overlay");if(l&&l.parentNode.removeChild(l),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");o.addEventListener(e,"click",(()=>{this.hideModal(t),t.removeEventListener("keydown",s);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}))}}const d=()=>{o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",s);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()},c=t.querySelector(".is-modal-close");c&&o.addEventListener(c,"click",d)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active")}refreshModuleLayout(t){let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let i=document.createRange();i.setStart(t,0),t.appendChild(i.createContextualFragment(e));let n=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(n,(e=>{t.getAttribute("data-html-"+o)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+o))),o++}))}fixLayout(t){const e=this.dom;Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||(t.style.width="",t.style.flex="")}));let i=2;t.querySelector(".is-row-overlay")&&(i=3);const n=t.childElementCount-i,o=this.builder.opts.row,s=this.builder.opts.cols,a=this.builder.opts.colequal;if(a.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=s.length-1;i++)e.removeClass(t,s[i]);for(let i=0;i<=a.length-1;i++)if(a[i].length===n){e.addClass(t,a[i][0]);break}1===n&&e.addClass(t,s[s.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==o&&s.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){i++;for(var o=0;o<=s.length-1;o++)e.removeClass(t,s[o]);1===n&&e.addClass(t,s[11]),2===n&&e.addClass(t,s[5]),3===n&&e.addClass(t,s[3]),4===n&&e.addClass(t,s[2]),5===n&&(5===i?e.addClass(t,s[3]):e.addClass(t,s[1])),6===n&&e.addClass(t,s[1]),7===n&&(i>=6?e.addClass(t,s[0]):e.addClass(t,s[1])),8===n&&(i>=5?e.addClass(t,s[0]):e.addClass(t,s[1])),9===n&&(i>=4?e.addClass(t,s[0]):e.addClass(t,s[1])),10===n&&(i>=3?e.addClass(t,s[0]):e.addClass(t,s[1])),11===n&&(i>=2?e.addClass(t,s[0]):e.addClass(t,s[1])),12===n&&e.addClass(t,s[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const o=this.cellSelected();let s;if(o)s=o.parentNode;else{if(s=this.builder.doc.querySelector(".row-active"),!s)return;e="row"}if("cell"===e||"cell-left"===e||"cell-right"===e){let a=4;this.builder.maxColumns&&(a=this.builder.maxColumns);let r,l=2;if(s.querySelector(".is-row-overlay")&&(l=3),s.childElementCount>=a+l)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),r=this.createElementFromHTML(t)}else{r=o.cloneNode(!0),r.removeAttribute("data-noedit"),r.removeAttribute("data-protected"),r.removeAttribute("data-module"),r.removeAttribute("data-module-desc"),r.removeAttribute("data-dialog-width"),r.removeAttribute("data-html"),r.removeAttribute("data-settings");for(let t=1;t<=20;t++)r.removeAttribute("data-html-"+t);r.removeAttribute("data-noedit"),n.removeClass(r,"cell-active"),n.removeClass(r,"is-light-text"),n.removeClass(r,"is-dark-text"),n.removeClass(r,"padding-0"),n.removeClass(r,"p-0"),r.removeAttribute("data-click"),r.removeAttribute("style"),i&&r.setAttribute(i,""),r.innerHTML=t}s.insertBefore(r,o),"cell"!==e&&"cell-right"!==e||n.moveAfter(r,o);let d=this.builder.doc.querySelector(".builder-active");d&&this.builder.applyBehaviorOn(d),this.fixLayout(s),r.click()}if("row"===e){let e,o;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let s=this.builder.opts.cellFormat,a=s.indexOf("</");t=s.substring(0,a)+t+s.substring(a);let r=n.elementChildren(e);for(;r.length>0&&(r=r[0],n.elementChildren(r).length>0);)r=n.elementChildren(r);r.innerHTML=t,o=r.firstChild,i&&o.setAttribute(i,"")}else o=n.createElement("div"),n.addClass(o,this.builder.opts.cols[this.builder.opts.cols.length-1]),o.innerHTML=t,i&&o.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,o);s.parentNode.insertBefore(e,s),n.moveAfter(e,s);let a=this.builder.doc.querySelector(".builder-active");a&&this.builder.applyBehaviorOn(a),o.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i=e;i.insertAdjacentHTML("afterend",t);let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n);let o=i.nextElementSibling;if("img"===o.tagName.toLowerCase()){let t=setInterval((()=>{o.complete&&(o.click(),clearInterval(t))}),30)}else o.click();let s=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(s)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let o,s,a,r,l=!1;const d=this.builder.builderStuff.querySelector(".quickadd").getAttribute("data-mode");if(!e||"cell"!==d&&"cell-left"!==d&&"cell-right"!==d){if(e&&"row"===d){let e;if(a=document.createElement("div"),a.className=this.builder.opts.cols[this.builder.opts.cols.length-1],a.innerHTML=t,i&&a.setAttribute("data-noedit",""),o=document.createElement("div"),o.className=this.builder.opts.row,o.appendChild(a),s=this.builder.cellSelected(),s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}e.parentNode.insertBefore(o,e),n.moveAfter(o,e);let d=this.builder.doc.querySelector(".builder-active");d&&this.builder.applyBehaviorOn(d),a.click(),o.className=o.className.replace("row-outline",""),r=this.builder.doc.querySelector(".is-column-tool"),r.className=r.className.replace("active","")}else{if(e)return void(i?this.addContent(t,d,"data-noedit"):this.addContent(t,d));{var c=document.createElement("div");c.innerHTML=t;var u=c.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(u,(e=>{t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId());for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t})),1===c.childNodes.length&&1===c.childNodes[0].childNodes.length&&("cell"===d||"cell-left"===d||"cell-right"===d)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+2)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=c.childNodes[0].childNodes[0];var p=document.createRange();t.parentNode.insertBefore(p.createContextualFragment(n.outerHTML),t),"cell"!==d&&"cell-right"!==d||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let o=this.builder.doc.querySelector(".builder-active");return o||(o=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(o),this.fixLayout(e),"cell"===d||"cell-right"===d?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(s=this.builder.activeCol,s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}p=document.createRange(),e.parentNode.insertBefore(p.createContextualFragment(c.innerHTML),e.nextSibling),o=c.childNodes[0],o=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),a=o.querySelector("div"),a&&a.click(),o.className=o.className.replace("row-outline",""),r=this.builder.doc.querySelector(".is-column-tool"),r.className=r.className.replace("active","")}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,d,"data-noedit"):this.addContent(t,d)}clearActiveCell(){const t=this.builder.builderStuff;if(!t)return;if(t.getAttribute("preventDevault"))return void setTimeout((()=>{t.removeAttribute("preventDevault")}),30);let e=this.builder.doc.getElementsByClassName("cell-active");for(;e.length;)e[0].classList.remove("cell-active");for(e=this.builder.doc.getElementsByClassName("row-outline");e.length;)e[0].classList.remove("row-outline");for(e=this.builder.doc.getElementsByClassName("row-active");e.length;)e[0].classList.remove("row-active");for(e=this.builder.doc.getElementsByClassName("builder-active");e.length;)e[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")})),o=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")}));let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-column-tool")||e.classList.contains("is-element-tool")||(e.style.display="",t.removeClass(e,"active"))}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)})),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none"}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none"}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff,n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"icon-active")}));let o=this.builder.doc.querySelectorAll(".elm-inspected");if(Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-inspected")})),o=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-active")})),i.querySelector(".is-element-tool").style.display="",i.querySelector("#divLinkTool").style.display="",t){this.builder.activeIcon=null,this.builder.inspectedElement=null,this.builder.activeElement=null;let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let o=i.querySelector(".elementrte-more-options");o&&(o.style.display="");let s=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(s,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;if(e.getAttribute("preventDevault"))return void setTimeout((()=>{e.removeAttribute("preventDevault")}),30);let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));var s=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(s,(e=>{t.removeClass(e,"active")}));let a=this.builder.doc.querySelectorAll("[data-saveforundo]");Array.prototype.forEach.call(a,(t=>{t.removeAttribute("data-saveforundo")})),a=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-inspected")}));let r=e.querySelector(".is-rte-tool");r&&(r.style.display="none");let l=e.querySelector(".is-elementrte-tool");l&&(l.style.display="none");let d=e.querySelector(".rte-more-options");d&&(d.style.display="");let c=e.querySelector(".elementrte-more-options");c&&(c.style.display=""),a=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-active")}));let u=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(u,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}));let p=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(p,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display=""}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){const t=this.dom.getSelection();if(!t)return;const e=t.anchorNode;if(e){const s=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement,a=s&&s.innerText===t.toString();let r=!1;for(var i=[],n=ni.getSelection(),o=0;o<n.rangeCount;++o)i=i.concat(n.getRangeAt(o).getNodes());const l=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(i.forEach((t=>{if(t.tagName){const e=t.tagName.toLowerCase();-1!==l.indexOf(e)&&(r=!0)}})),this.builder.selectionMulti=!!r,a||""===t.toString().trim()){this.builder.selectionElm=s;let t=s.nodeName.toLowerCase();this.builder.activeLink="a"===t?s:null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let o=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)o.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),o=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(o,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let s,a=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<a.length;t++)i=new RegExp("<"+a[t]+".*?"+a[t]+"(.*?)>","gi"),n=n.replace(i,"");s=e?["style","start"]:["start"];for(let t=0;t<s.length;t++){let e=new RegExp(" "+s[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/ /gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const e=this.dom,i=e.elementChildren(t);let n=!0;if(i.forEach((t=>{e.hasClass(t,"row-add-initial")||e.hasClass(t,"dummy-space")||(n=!1)})),n){let i=t.querySelector(".row-add-initial");i||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,i=t.querySelector(".row-add-initial")),i.addEventListener("click",(()=>{this.clearActiveCell();const n=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"builder-active")})),e.addClass(t,"builder-active"),e.addClass(i,"row-active");let o=this.builder.builderStuff.querySelector(".quickadd");o.querySelector(".is-pop-tabs").style.display="none";const s=window.innerHeight;let a,r;if(this.builder.iframe){let t=this.builder.iframe.getBoundingClientRect().top,e=this.builder.iframe.getBoundingClientRect().left;a=i.getBoundingClientRect().top+t,r=i.getBoundingClientRect().left+(i.offsetWidth*this.builder.opts.zoom/2-11)+e}else a=i.getBoundingClientRect().top,r=i.getBoundingClientRect().left+i.offsetWidth*this.builder.opts.zoom/2-11;o.style.display="flex",this.showPop(o,!1,i);const l=o.offsetWidth,d=o.offsetHeight;s-a>d?(a=a+i.offsetHeight*this.builder.opts.zoom-19,o.style.top=a+window.pageYOffset+27+"px",o.style.left=r-l/2+7+"px",e.removeClass(o,"arrow-bottom"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-top"),e.addClass(o,"center")):(o.style.top=a+window.pageYOffset-d-8+"px",o.style.left=r-l/2+7+"px",e.removeClass(o,"arrow-top"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-bottom"),e.addClass(o,"center")),o.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var o=this.builder.doc.createElement("div");o.innerHTML=t;for(var s,a,r=this.builder.doc.createDocumentFragment();s=o.firstChild;)a=r.appendChild(s);var l=r.firstChild;n.insertNode(r),a&&((n=n.cloneRange()).setStartAfter(a),e?n.setStartBefore(l):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var d=i.createRange();d.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",d),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var o=document.createRange();o.setStart(t,0),t.appendChild(o.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s))),s++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(t){let e=this.builder.colTool.columnTool,i=this.builder.activeCol;t?(e.style.transition="all 100ms ease",setTimeout((()=>{e.style.top=i.getBoundingClientRect().top-29+this.builder.win.pageYOffset+"px",e.style.left=i.getBoundingClientRect().left-1+"px",setTimeout((()=>{e.style.transition=""}),100)}),10)):(e.style.top=i.getBoundingClientRect().top-29+this.builder.win.pageYOffset+"px",e.style.left=i.getBoundingClientRect().left-1+"px")}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),o=(n>>16)+e;o>255?o=255:o<0&&(o=0);var s=(n>>8&255)+e;s>255?s=255:s<0&&(s=0);var a=(255&n)+e;return a>255?a=255:a<0&&(a=0),(i?"#":"")+String("000000"+(a|s<<8|o<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'<button class="style-helper"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <input type="text" class="style-helper-input" style="display:none;">\n <label class="style-helper-label" style="display:none;"></label>\n <input class="style-helper-checkbox" type="checkbox" style="display:none;">\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" style="display:none;"><option value=""></option></select>\n ');const t=this.builder.builderStuff.querySelector(".style-helper"),e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-label"),n=this.builder.builderStuff.querySelector(".style-helper-select"),o=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=this.getUIStyleValue(t,"modal-color","background-color"),this.builder.styleModalBackground=this.getUIStyleValue(t,"modal-background","background-color"),this.builder.styleButtonPickColorBorder=this.getUIStyleValue(t,"button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=this.getUIStyleValue(t,"button-pickcolor-background","background-color"),this.builder.styleToolBackground=window.getComputedStyle(t,null).getPropertyValue("background-color"),this.builder.styleButtonColor=window.getComputedStyle(t,null).getPropertyValue("color"),this.builder.styleButtonSvgFill=window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill"),this.builder.styleButtonBackgroundHover=this.getUIStyleValue(t,"hover","background-color"),this.builder.styleSnippetColor=this.getUIStyleValue(t,"snippet-color","background-color"),this.builder.styleSnippetBackground=this.getUIStyleValue(t,"snippet-background","background-color"),this.builder.styleSnippetTabsBackground=this.getUIStyleValue(t,"snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=this.getUIStyleValue(t,"snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=this.getUIStyleValue(t,"snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=this.getUIStyleValue(t,"snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=this.getUIStyleValue(t,"snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=this.getUIStyleValue(t,"snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=this.getUIStyleValue(t,"snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=this.getUIStyleValue(t,"snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=this.getUIStyleValue(t,"snippet-more-item-color","background-color"),this.builder.styleTabsBackground=this.getUIStyleValue(t,"tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=this.getUIStyleValue(t,"tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=this.getUIStyleValue(t,"tab-item-color","background-color"),this.builder.styleTabsMoreBackground=this.getUIStyleValue(t,"tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=this.getUIStyleValue(t,"tabs-more-border","border"),this.builder.styleTabsMoreItemColor=this.getUIStyleValue(t,"tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=this.getUIStyleValue(t,"tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=this.getUIStyleValue(t,"separator-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(n.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleLabelColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(o,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(o,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(o,"hover","background-color"),this.builder.styleOutlineColor=this.getUIStyleValue(t,"outline-color","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let o=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),o}getFontFamilyStyle(t){return`\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n `}refreshFontFamilyStyle1(){let t=this.builder.rte.rteFontFamilyOptions.querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}refreshFontFamilyStyle2(){let t=this.builder.builderStuff.querySelector(".is-modal.pickfontfamily").querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(!0),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}getFontPreview(){let t=this.builder.fontAssetPath,e="";return e=`\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${t}arial.png"></li>\n\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${t}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${t}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${t}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${t}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${t}serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abel, sans-serif"><div></div><img src="${t}abel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abril Fatface"><div></div><img src="${t}abril_fatface.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Advent Pro, sans-serif" data-font-style="300"><div></div><img src="${t}advent_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aladin, cursive"><div></div><img src="${t}aladin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya, serif" data-font-style="400,400i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}alegreya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya Sans SC, sans-serif" data-font-style="300,700"><div></div><img src="${t}alegreya_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya SC, serif" data-font-style="400,400i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}alegreya_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alice, serif"><div></div><img src="${t}alice.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allerta Stencil, sans-serif"><div></div><img src="${t}allerta_stencil.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allura, cursive"><div></div><img src="${t}allura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Almendra Display, cursive"><div></div><img src="${t}almendra_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Amatic SC, cursive" data-font-style="400,700"><div></div><img src="${t}amatic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Andika, sans-serif"><div></div><img src="${t}andika.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anonymous Pro, monospace" data-font-style="400,400i,700,700i"><div></div><img src="${t}anonymous_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Architects Daughter, cursive"><div></div><img style="transform:scale(1.1);" src="${t}architects_daughter.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arimo, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}arimo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arsenal, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}arsenal.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Assistant" data-font-style="300,700"><div></div><img src="${t}assistant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aubrey, cursive"><div></div><img src="${t}aubrey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anton, sans-serif"><div></div><img src="${t}anton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Archivo Narrow, sans-serif"><div></div><img src="${t}archivo_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bad Script, cursive"><div></div><img src="${t}bad_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="BenchNine, sans-serif"><div></div><img src="${t}benchNine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bevan, cursive"><div></div><img src="${t}bevan.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bigelow Rules, cursive"><div></div><img src="${t}bigelow_rules.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bilbo, cursive"><div></div><img src="${t}bilbo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bonbon, cursive"><div></div><img src="${t}bonbon.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bowlby One SC, cursive"><div></div><img src="${t}bowlby_one_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cabin Condensed, sans-serif"><div></div><img src="${t}cabin_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Carrois Gothic SC, sans-serif"><div></div><img src="${t}carrois_gothic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Caveat, cursive" data-font-style="400,700"><div></div><img src="${t}caveat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Chewy, cursive"><div></div><img src="${t}chewy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cinzel, serif"><div></div><img src="${t}cinzel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Comfortaa, cursive" data-font-style="300"><div></div><img src="${t}comfortaa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Concert One, cursive"><div></div><img src="${t}concert_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant, serif" data-font-style="300,300i,600,600i,700,700i"><div></div><img src="${t}cormorant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Garamond, serif" data-font-style="300,300i,600,600i,700,700i"><div></div><img src="${t}cormorant_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Infant, serif" data-font-style="300,300i,600,600i,700,700i"><div></div><img src="${t}cormorant_infant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant SC, serif" data-font-style="300,600,700"><div></div><img src="${t}cormorant_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Unicase, serif" data-font-style="300,600,700"><div></div><img src="${t}cormorant_unicase.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cousine" data-font-style="400,700"><div></div><img src="${t}cousine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Crafty Girls, cursive"><div></div><img src="${t}crafty_girls.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cuprum, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}cuprum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cutive Mono, monospace"><div></div><img src="${t}cutive_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Devonshire, cursive"><div></div><img src="${t}devonshire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Didact Gothic, sans-serif"><div></div><img src="${t}didact_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Diplomata SC, cursive"><div></div><img src="${t}diplomata_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Dosis, sans-serif" data-font-style="200"><div></div><img src="${t}dosis.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="EB Garamond, serif" data-font-style="400,400i,600,600i,700,700i,800,800i"><div></div><img src="${t}eb_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="El Messiri, sans-serif" data-font-style="400,600,700"><div></div><img src="${t}el_messiri.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Elsie, cursive" data-font-style="400,900"><div></div><img src="${t}elsie.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Encode Sans, sans-serif" data-font-style="300,700"><div></div><img src="${t}encode_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Exo, sans-serif" data-font-style="100"><div></div><img src="${t}exo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Exo 2', sans-serif" data-font-style="200,200i,600,600i,700,700i,800,800i,900,900i" data-font-display="swap"><div></div><img src="${t}exo_2.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Felipa, cursive"><div></div><img src="${t}felipa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Code, monospace" data-font-style="300,500,600,700"><div></div><img src="${t}fira_code.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Mono, monospace" data-font-style="400,500,700"><div></div><img src="${t}fira_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans, sans-serif" data-font-style="200,200i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}fira_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Condensed, sans-serif" data-font-style="200,200i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}fira_sans_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Extra Condensed, sans-serif" data-font-style="200,200i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}fira_sans_extra_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fjalla One, sans-serif"><div></div><img src="${t}fjalla_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Forum, cursive"><div></div><img src="${t}forum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Frank Ruhl Libre" data-font-style="300,700"><div></div><img src="${t}frank_ruhl_libre.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fredericka the Great, cursive"><div></div><img src="${t}fredericka_the_great.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gabriela, serif"><div></div><img src="${t}gabriela.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gilda Display, serif"><div></div><img src="${t}gilda_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Give You Glory, cursive"><div></div><img style="transform:scale(1.3);" src="${t}give_you_glory.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gruppo, cursive"><div></div><img src="${t}gruppo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Handlee, cursive"><div></div><img src="${t}handlee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Happy Monkey, cursive"><div></div><img src="${t}happy_monkey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Hind" data-font-style="300,700"><div></div><img src="${t}hind.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Mono, monospace" data-font-style="300,300i,500,500i,600,600i,700,700i"><div></div><img src="${t}ibm_plex_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Sans, sans-serif" data-font-style="300,300i,500,500i,600,600i,700,700i"><div></div><img src="${t}ibm_plex_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Serif, serif" data-font-style="300,300i,500,500i,600,600i,700,700i"><div></div><img src="${t}ibm_plex_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Iceland, cursive"><div></div><img src="${t}iceland.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Inconsolata, monospace" data-font-style="400,700"><div></div><img src="${t}inconsolata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Josefin Sans, sans-serif" data-font-style="300,700"><div></div><img src="${t}josefin_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Istok Web, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}istok_web.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julee, cursive"><div></div><img src="${t}julee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julius Sans One, sans-serif"><div></div><img src="${t}julius_sans_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Junge, serif"><div></div><img src="${t}junge.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Jura, sans-serif" data-font-style="300,600,700"><div></div><img src="${t}jura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Just Me Again Down Here, cursive"><div></div><img style="transform:scale(1.1);" src="${t}just_me_again_down_here.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kaushan Script, cursive"><div></div><img src="${t}kaushan_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kelly Slab, cursive"><div></div><img src="${t}kelly_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kite One, sans-serif"><div></div><img src="${t}kite_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi, sans-serif"><div></div><img src="${t}kosugi.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi Maru, sans-serif"><div></div><img src="${t}kosugi_maru.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kurale, serif"><div></div><img src="${t}kurale.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lato, sans-serif" data-font-style="300,700"><div></div><img src="${t}lato.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ledger, serif" data-font-style="300,700" data-font-display="swap"><div></div><img src="${t}ledger.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lekton, sans-serif" data-font-style="400,700"><div></div><img src="${t}lekton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Life Savers, cursive"><div></div><img src="${t}life_savers.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Literata, serif" data-font-style="400,400i,600,600i,700,700i"><div></div><img src="${t}literata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster, cursive"><div></div><img src="${t}lobster.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster Two, cursive"><div></div><img src="${t}lobster_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Londrina Shadow, cursive"><div></div><img src="${t}londrina_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lora, serif" data-font-style="400,700"><div></div><img src="${t}lora.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lovers Quarrel, cursive"><div></div><img style="transform:scale(1.1);" src="${t}lovers_quarrel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS 1p', sans-serif" data-font-style="300,500,700,800,900" data-font-display="swap"><div></div><img src="${t}m_plus_1p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS Rounded 1c', sans-serif" data-font-style="300,500,700,800,900" data-font-display="swap"><div></div><img src="${t}m_plus_rounded_1c.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Macondo, cursive"><div></div><img src="${t}macondo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marcellus SC, serif"><div></div><img src="${t}marcellus_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marck Script, cursive"><div></div><img src="${t}marck_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Martel, serif" data-font-style="300,700"><div></div><img src="${t}martel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Maven Pro, sans-serif"><div></div><img src="${t}maven_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather, serif" data-font-style="300,700"><div></div><img src="${t}merriweather.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather Sans" data-font-style="300,700"><div></div><img src="${t}merriweather_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Mogra, cursive"><div></div><img src="${t}mogra.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Monoton, cursive"><div></div><img src="${t}monoton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montez, cursive"><div></div><img src="${t}montez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat, sans-serif" data-font-style="300,400,700"><div></div><img src="${t}montserrat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Alternates, sans-serif" data-font-style="300,300i,500,500i,700,700i,800,800i,900,900i"><div></div><img src="${t}montserrat_alternates.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Subrayada, sans-serif"><div></div><img src="${t}montserrat_subrayada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neucha, cursive"><div></div><img src="${t}neucha.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neuton, serif" data-font-style="200,700"><div></div><img src="${t}neuton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nixie One, cursive"><div></div><img src="${t}nixie_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nothing You Could Do, cursive"><div></div><img style="transform:scale(1.1);" src="${t}nothing_you_could_do.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}noto_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans SC, sans-serif" data-font-style="300,500,700,900"><div></div><img src="${t}noto_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif, serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}noto_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif TC, serif" data-font-style="300,600,700,900"><div></div><img src="${t}noto_serif_tc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nunito, sans-serif" data-font-style="200,200i,600,600i,700,700i,800,800i,900,900i"><div></div><img src="${t}nunito.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Old Standard TT, serif" data-font-style="400,400i,700"><div></div><img src="${t}old_standard_tt.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans, sans-serif" data-font-style="300,400,600,800"><div></div><img src="${t}open_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans Condensed, sans-serif" data-font-style="300,300i,700"><div></div><img src="${t}open_sans_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oranienbaum, serif"><div></div><img src="${t}oranienbaum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oswald, sans-serif" data-font-style="300,400,700"><div></div><img src="${t}oswald.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oxygen, sans-serif" data-font-style="300,700"><div></div><img src="${t}oxygen.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pacifico, cursive"><div></div><img src="${t}pacifico.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pangolin, cursive"><div></div><img src="${t}pangolin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Passion One, cursive"><div></div><img src="${t}passion_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pathway Gothic One, sans-serif"><div></div><img src="${t}pathway_gothic_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pattaya, sans-serif"><div></div><img src="${t}pattaya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Petit Formal Script, cursive"><div></div><img style="transform:scale(1.1);" src="${t}petit_formal_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Philosopher, sans-serif"><div></div><img src="${t}philosopher.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Play, sans-serif" data-font-style="400,700"><div></div><img src="${t}play.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display, serif" data-font-style="400,400i,700,700i,900,900i"><div></div><img src="${t}playfair_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display SC, serif" data-font-style="400,400i,700,700i,900,900i"><div></div><img src="${t}playfair_display_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Podkova, serif" data-font-style="400,600,700,800"><div></div><img src="${t}podkova.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Poiret One, cursive"><div></div><img src="${t}poiret_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pompiere, cursive"><div></div><img style="transform:scale(1.1);" src="${t}pompiere.png"></li>\n `,e+=`<li role="option" tabindex="0" data-provider="google" data-font-family="Poppins, sans-serif" data-font-style="400,600"><div></div><img src="${t}poppins.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prata, serif"><div></div><img src="${t}prata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Press Start 2P', cursive" data-font-display="swap"><div></div><img src="${t}press_start_2p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prosto One, cursive"><div></div><img src="${t}prosto_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Mono, monospace"><div></div><img src="${t}pt_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}pt_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Caption, sans-serif" data-font-style="400,700"><div></div><img src="${t}pt_sans_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Narrow, sans-serif" data-font-style="400,700"><div></div><img src="${t}pt_sans_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif, serif" data-font-style="400,700"><div></div><img src="${t}pt_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif Caption, serif" data-font-style="400,700"><div></div><img src="${t}pt_serif_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento Sans, sans-serif"><div></div><img src="${t}quattrocento_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento, serif"><div></div><img src="${t}quattrocento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quicksand, sans-serif"><div></div><img src="${t}quicksand.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Qwigley, cursive"><div></div><img src="${t}qwigley.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway, sans-serif" data-font-style="100"><div></div><img src="${t}raleway.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway Dots, sans-serif"><div></div><img src="${t}raleway_dots.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Redressed, cursive"><div></div><img src="${t}redressed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ribeye Marrow, cursive"><div></div><img src="${t}ribeye_marrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Righteous, cursive"><div></div><img src="${t}righteous.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto, sans-serif" data-font-style="300"><div></div><img src="${t}roboto.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Condensed, sans-serif" data-font-style="300,300i,700,700i"><div></div><img src="${t}roboto_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Mono, monospace" data-font-style="300,700"><div></div><img src="${t}roboto_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Slab, serif" data-font-style="200,600,700,800,900"><div></div><img src="${t}roboto_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rochester, cursive"><div></div><img src="${t}rochester.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rouge Script, cursive"><div></div><img src="${t}rouge_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik, sans-serif" data-font-style="300,300i,500,500i,700,700i,900,900i"><div></div><img src="${t}rubik.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik Mono One, sans-serif"><div></div><img src="${t}rubik_mono_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ruslan Display, cursive"><div></div><img src="${t}ruslan_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Russo One, sans-serif"><div></div><img src="${t}russo_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sacramento, cursive"><div></div><img src="${t}sacramento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sanchez, serif"><div></div><img src="${t}sanchez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Satisfy, cursive"><div></div><img src="${t}satisfy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sawarabi Gothic, sans-serif"><div></div><img src="${t}sawarabi_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Scada, sans-serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}scada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seaweed Script, cursive"><div></div><img src="${t}seaweed_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seymour One, sans-serif"><div></div><img src="${t}seymour_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Shadows Into Light Two, cursive"><div></div><img src="${t}shadows_into_light_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Six Caps, sans-serif"><div></div><img src="${t}six_caps.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Snowburst One, cursive"><div></div><img src="${t}snowburst_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Code Pro, monospace" data-font-style="300,700"><div></div><img src="${t}source_code_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Sans Pro, sans-serif" data-font-style="200"><div></div><img src="${t}source_sans_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Special Elite, cursive"><div></div><img src="${t}special_elite.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral, serif" data-font-style="200,200i,600,600i,700,700i,800,800i"><div></div><img src="${t}spectral.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral SC, serif" data-font-style="300,300i,600,600i,700,700i,800,800i"><div></div><img src="${t}spectral_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Squada One, cursive"><div></div><img src="${t}squada_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stalinist One, cursive"><div></div><img src="${t}stalinist_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stint Ultra Expanded, cursive"><div></div><img src="${t}stint_ultra_expanded.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Syncopate, sans-serif"><div></div><img src="${t}syncopate.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tangerine, cursive"><div></div><img src="${t}tangerine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tenor Sans, sans-serif"><div></div><img src="${t}tenor_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tinos, serif" data-font-style="400,400i,700,700i"><div></div><img src="${t}tinos.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu, sans-serif" data-font-style="300,300i,500,500i,700,700i"><div></div><img src="${t}ubuntu.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Condensed, sans-serif"><div></div><img src="${t}ubuntu_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Mono, monospace" data-font-style="400,700"><div></div><img src="${t}ubuntu_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Underdog, cursive"><div></div><img src="${t}underdog.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="UnifrakturMaguntia, cursive"><div></div><img src="${t}unifrakturmaguntia.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vast Shadow, cursive"><div></div><img src="${t}vast_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Viga, sans-serif"><div></div><img src="${t}viga.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn, serif" data-font-style="400,400i,600,600i,700,700i,900,900i"><div></div><img src="${t}vollkorn.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn SC, serif" data-font-style="400,600,700,900"><div></div><img src="${t}vollkorn_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Voltaire, sans-serif"><div></div><img src="${t}voltaire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Wire One, sans-serif"><div></div><img src="${t}wire_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yanone Kaffeesatz, sans-serif" data-font-style="300,700"><div></div><img src="${t}yanone_kaffeesatz.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yeseva One, cursive"><div></div><img src="${t}yeseva_one.png"></li>\n `,e}getFontFamilyHTML(t){return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style id="mainstyle">\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n ${this.getFontPreview()}\n </ul>\n\n <script type="text/javascript">\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.rte-fontfamily-options.active, .pickfontfamily.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}getFontFamilyEmail(t){let e=this.builder.fontAssetPath;return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style>\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${e}arial.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${e}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${e}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${e}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${e}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${e}serif.png"></li>\n </ul>\n\n <script type="text/javascript">\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.is-rte-pop.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}}class si{constructor(t){this.builder=t}getScale(t){let e=window.getComputedStyle(t).transform.split("(")[1];e=e.split(")")[0],e=e.split(",");let i=e[0],n=e[1];return Math.sqrt(i*i+n*n)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,o,s,a=e.split(" ");for(i=0,o=a.length;i<o;++i){if(!a[i])continue;let e=a[i],o="",r=t.className.split(" ");for(n=0,s=r.length;n<s;++n)r[n]&&r[n]!==e&&(o+=r[n]+" ");t.className=o.trim()}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let o=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(o,e)){let s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,{get:function(){return s.get.apply(this,arguments)},set:function(){let t=this[e];s.set.apply(this,arguments);let o=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,o),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelection();if(!n)return;const o=n.anchorNode;if(o){const l=o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE?o:o.parentElement,d=l&&l.innerText===n.toString();let c,u=!1;for(var s=[],a=ni.getSelection(),r=0;r<a.rangeCount;++r)s=s.concat(a.getRangeAt(r).getNodes());const p=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(s.forEach((t=>{if(t.tagName){const e=t.tagName.toLowerCase();-1!==p.indexOf(e)&&(u=!0,i(!0,t))}})),u)return;c=d||""===n.toString().trim()?this.updateSelection(t,e,l):this.replaceSelection(t,e,n,l),i&&i(!0,c)}else i&&i(!1)}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const o=i.getRangeAt(0),s=o.extractContents(),a=this.createSpan(n,t,e);return a.appendChild(s),this.cleanChildren(t,a),this.cleanUnusedSpan(a),o.insertNode(a),i.selectAllChildren(a),this.checkStyleIfSameAsParent(a,t),a}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,o=this.findParentStyle(t,e);if(o&&(n=o.style[e]),i===n){t.style[e]="";let o=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=o}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const o=this.getSelection();if(!o)return;const s=o.anchorNode;if(s){let d=s.nodeType!==Node.TEXT_NODE&&s.nodeType!==Node.COMMENT_NODE?s:s.parentElement;const c=d&&d.innerText===o.toString();let u=!1;for(var a=[],r=ni.getSelection(),l=0;l<r.rangeCount;++l)a=a.concat(r.getRangeAt(l).getNodes());const p=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(a.forEach((i=>{if(i.tagName){const n=i.tagName.toLowerCase();if(-1!==p.indexOf(n)){u=!0;for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}}})),u)return;(i||c||""===o.toString().trim())&&("block"===n&&"inline"===this.getStyle(d,"display")&&(d=this.getParentBlock(d)),this.updateSelectionClass(t,e,d))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}execCommandToggle(t,e,i){const n=this.getSelection();if(!n)return;const o=n.anchorNode;if(o){const l=o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE?o:o.parentElement,d=l&&l.innerText===n.toString();let c=!1;for(var s=[],a=ni.getSelection(),r=0;r<a.rangeCount;++r)s=s.concat(a.getRangeAt(r).getNodes());const u=["p","h1","h2","h3","h4","h5","h6","div","pre"];if(s.forEach((n=>{if(n.tagName){const o=n.tagName.toLowerCase();if(-1!==u.indexOf(o)){if(c=!0,"fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)?t="uppercase":this.hasClass(n,i.textTransform.lowercase)?t="lowercase":this.hasClass(n,i.textTransform.capitalize)?t="capitalize":this.hasClass(n,i.textTransform.normal)&&(t="normal"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t?this.addClass(n,i.textTransform.uppercase):"uppercase"===t?this.addClass(n,i.textTransform.lowercase):"lowercase"===t?this.addClass(n,i.textTransform.capitalize):"capitalize"===t||"normal"===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}}})),c)return;d||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,l):this.replaceSelectionToggle(t,e,i,n,l)}}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)?t="uppercase":this.hasClass(n,i.textTransform.lowercase)?t="lowercase":this.hasClass(n,i.textTransform.capitalize)?t="capitalize":this.hasClass(n,i.textTransform.normal)&&(t="normal"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t?this.addClass(n,i.textTransform.uppercase):"uppercase"===t?this.addClass(n,i.textTransform.lowercase):"lowercase"===t?this.addClass(n,i.textTransform.capitalize):"capitalize"===t?this.addClass(n,i.textTransform.normal):"normal"===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,o){const s=n.getRangeAt(0),a=s.extractContents(),r=document.createElement("span");if("fontWeight"===t){let t=!1;o.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(o,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(o,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(r,i.fontWeight.defaultNormal):this.addClass(r,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;o.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(o,i.fontStyle.normal)&&(t=!1)),t?this.addClass(r,i.fontStyle.normal):this.addClass(r,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;o.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(r,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;o.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(r,i.textDecoration.linethrough)}if("textTransform"===t){let t="";o.closest(`.${i.textTransform.uppercase}`)?t="uppercase":o.closest(`.${i.textTransform.lowercase}`)?t="lowercase":o.closest(`.${i.textTransform.capitalize}`)?t="capitalize":o.closest(`.${i.textTransform.normal}`)&&(t="normal"),""===t?this.addClass(r,i.textTransform.uppercase):"uppercase"===t?this.addClass(r,i.textTransform.lowercase):"lowercase"===t?this.addClass(r,i.textTransform.capitalize):"capitalize"===t?this.addClass(r,i.textTransform.normal):"normal"===t&&this.addClass(r,i.textTransform.uppercase)}if("extend"===t){let t=!1;o.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(r,i.extend[e])}return r.appendChild(a),this.cleanChildrenToggle(t,e,r,i),this.cleanUnusedSpan(r),s.insertNode(r),n.selectAllChildren(r),r}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const o=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));o&&o.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let o=Array.prototype.filter.call(n,(t=>0===t.attributes.length));o&&o.length>0&&o.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}}var ai={exports:{}},ri={},li={exports:{}},di={},ci={};function ui(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function pi(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function hi(t,e){this.__indent_cache=new pi(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new ui(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}ui.prototype.clone_empty=function(){var t=new ui(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},ui.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},ui.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},ui.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},ui.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},ui.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},ui.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},ui.prototype.is_empty=function(){return 0===this.__items.length},ui.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},ui.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},ui.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},ui.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},ui.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},ui.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},ui.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},pi.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},pi.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},pi.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},pi.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},hi.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},hi.prototype.get_line_number=function(){return this.__lines.length},hi.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},hi.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},hi.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},hi.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},hi.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},hi.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},hi.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},hi.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},hi.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},hi.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},hi.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},hi.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},hi.prototype.just_added_newline=function(){return this.current_line.is_empty()},hi.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},hi.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new ui(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},ci.Output=hi;var gi={};gi.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var fi={};!function(t){var e="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",i="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",n="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+i+"])";t.identifier=new RegExp(o+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),t.identifierStart=new RegExp(o),t.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+e+i+n+"])+"),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")}(fi);var mi={},bi={};function vi(t,e){this.raw_options=yi(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function yi(t,e){var i,n={};for(i in t=_i(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function _i(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}vi.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},vi.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},vi.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},vi.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},vi.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},vi.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},vi.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},bi.Options=vi,bi.normalizeOpts=_i,bi.mergeOpts=yi;var xi=bi.Options,wi=["before-newline","after-newline","preserve-newline"];function Si(t){xi.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",wi),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}Si.prototype=new xi,mi.Options=Si;var Ci={},ki={},Ei=RegExp.prototype.hasOwnProperty("sticky");function Ai(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}Ai.prototype.restart=function(){this.__position=0},Ai.prototype.back=function(){this.__position>0&&(this.__position-=1)},Ai.prototype.hasNext=function(){return this.__position<this.__input_length},Ai.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},Ai.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},Ai.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||Ei&&t.sticky||i.index!==e&&(i=null),i},Ai.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},Ai.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},Ai.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},Ai.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},Ai.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},Ai.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},Ai.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&Ei&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},Ai.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},Ai.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},Ai.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},ki.InputScanner=Ai;var Li={},qi={};function Ti(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}Ti.prototype.restart=function(){this.__position=0},Ti.prototype.isEmpty=function(){return 0===this.__tokens_length},Ti.prototype.hasNext=function(){return this.__position<this.__tokens_length},Ti.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},Ti.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},Ti.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},qi.TokenStream=Ti;var Mi={},Ri={};function Oi(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}Oi.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},Oi.prototype.read_match=function(){return this._input.match(this._match_pattern)},Oi.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},Oi.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},Oi.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},Oi.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},Oi.prototype._create=function(){return new Oi(this._input,this)},Oi.prototype._update=function(){},Ri.Pattern=Oi;var Bi=Ri.Pattern;function Ni(t,e){Bi.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Ni.prototype=new Bi,Ni.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},Ni.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},Ni.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},Ni.prototype._create=function(){return new Ni(this._input,this)},Ni.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},Mi.WhitespacePattern=Ni;var Ii=ki.InputScanner,Di=gi.Token,Pi=qi.TokenStream,$i=Mi.WhitespacePattern,zi={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Hi=function(t,e){this._input=new Ii(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new $i(this._input)};Hi.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new Pi,this._reset();for(var e=new Di(zi.START,""),i=null,n=[],o=new Pi;e.type!==zi.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new Pi),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Hi.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Hi.prototype._reset=function(){},Hi.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(zi.RAW,i):this._create_token(zi.EOF,"")},Hi.prototype._is_comment=function(t){return!1},Hi.prototype._is_opening=function(t){return!1},Hi.prototype._is_closing=function(t,e){return!1},Hi.prototype._create_token=function(t,e){return new Di(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Hi.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Li.Tokenizer=Hi,Li.TOKEN=zi;var ji={};function Fi(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Fi.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Fi.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},ji.Directives=Fi;var Ui={},Wi=Ri.Pattern,Vi={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Gi(t,e){Wi.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Vi),this._excluded=Object.assign({},Vi),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new Wi(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Gi.prototype=new Wi,Gi.prototype._create=function(){return new Gi(this._input,this)},Gi.prototype._update=function(){this.__set_templated_pattern()},Gi.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Gi.prototype.read_options=function(t){var e=this._create();for(var i in Vi)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Gi.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Gi.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Gi.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Gi.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Ui.TemplatablePattern=Gi;var Xi=ki.InputScanner,Yi=Li.Tokenizer,Ki=Li.TOKEN,Zi=ji.Directives,Qi=fi,Ji=Ri.Pattern,tn=Ui.TemplatablePattern;function en(t,e){return-1!==e.indexOf(t)}var nn={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:Ki.START,RAW:Ki.RAW,EOF:Ki.EOF},on=new Zi(/\/\*/,/\*\//),sn=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,an=/[0-9]/,rn=/[^\d\.]/,ln=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),dn=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";dn=(dn="\\?\\.(?!\\d) "+(dn=dn.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var cn,un=new RegExp(dn),pn="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),hn=pn.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),gn=new RegExp("^(?:"+hn.join("|")+")$"),fn=function(t,e){Yi.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new Ji(this._input),n=new tn(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(Qi.identifier).matching(Qi.identifierMatch),number:i.matching(sn),punct:i.matching(un),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(Qi.lineBreak),shebang:i.starting_with(/#!/).until_after(Qi.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(fn.prototype=new Yi)._is_comment=function(t){return t.type===nn.COMMENT||t.type===nn.BLOCK_COMMENT||t.type===nn.UNKNOWN},fn.prototype._is_opening=function(t){return t.type===nn.START_BLOCK||t.type===nn.START_EXPR},fn.prototype._is_closing=function(t,e){return(t.type===nn.END_BLOCK||t.type===nn.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},fn.prototype._reset=function(){cn=!1},fn.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(nn.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(nn.UNKNOWN,this._input.next())},fn.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(Qi.allLineBreaks,"\n"),t.type!==nn.DOT&&(t.type!==nn.RESERVED||"set"!==t.text&&"get"!==t.text)&&gn.test(e)?"in"===e||"of"===e?this._create_token(nn.OPERATOR,e):this._create_token(nn.RESERVED,e):this._create_token(nn.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(nn.WORD,e):void 0},fn.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(nn.START_EXPR,t):")"===t||"]"===t?e=this._create_token(nn.END_EXPR,t):"{"===t?e=this._create_token(nn.START_BLOCK,t):"}"===t?e=this._create_token(nn.END_BLOCK,t):";"===t?e=this._create_token(nn.SEMICOLON,t):"."===t&&rn.test(this._input.peek(1))?e=this._create_token(nn.DOT,t):","===t&&(e=this._create_token(nn.COMMA,t)),e&&this._input.next(),e},fn.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(nn.EQUALS,t):"?."===t?this._create_token(nn.DOT,t):this._create_token(nn.OPERATOR,t)},fn.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(nn.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(nn.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(an)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(nn.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(Qi.newline);)e+=this._input.next();return cn=!0,this._create_token(nn.COMMENT,e)}}else if(cn&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return cn=!1,this._create_token(nn.COMMENT,e);return null},fn.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=on.get_directives(i);n&&"start"===n.ignore&&(i+=on.readIgnored(this._input)),i=i.replace(Qi.allLineBreaks,"\n"),(e=this._create_token(nn.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(nn.COMMENT,i))}return e},fn.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new Xi(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Qi.allLineBreaks,"\n"),this._create_token(nn.STRING,e)}return null},fn.prototype._allow_regexp_or_xml=function(t){return t.type===nn.RESERVED&&en(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===nn.END_EXPR&&")"===t.text&&t.opened.previous.type===nn.RESERVED&&en(t.opened.previous.text,["if","while","for"])||en(t.type,[nn.COMMENT,nn.START_EXPR,nn.START_BLOCK,nn.START,nn.END_BLOCK,nn.OPERATOR,nn.EQUALS,nn.EOF,nn.SEMICOLON,nn.COMMA])},fn.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(Qi.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(Qi.identifier)),this._create_token(nn.STRING,i)}return null},fn.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),a=0;n;){var r=!!n[1],l=n[2];if(!(!!n[n.length-1]||"![CDATA["===l.slice(0,8))&&(l===o||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(r?--a:++a),i+=n[0],a<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(Qi.allLineBreaks,"\n"),this._create_token(nn.STRING,i)}}return null},fn.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),a="";this._input.hasNext();){if((a=this._input.next())===t||!e&&Qi.newline.test(a)){this._input.back();break}"\\"===a&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),a+=this._input.next()):i&&("${"===i&&"$"===a&&"{"===this._input.peek()&&(a+=this._input.next()),i===a&&(a+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next()))),s+=a+=o.read()}return s},Ci.Tokenizer=fn,Ci.TOKEN=nn,Ci.positionable_operators=ln.slice(),Ci.line_starters=pn.slice();var mn=ci.Output,bn=gi.Token,vn=fi,yn=mi.Options,_n=Ci.Tokenizer,xn=Ci.line_starters,wn=Ci.positionable_operators,Sn=Ci.TOKEN;function Cn(t,e){return-1!==e.indexOf(t)}function kn(t,e){return t&&t.type===Sn.RESERVED&&t.text===e}function En(t,e){return t&&t.type===Sn.RESERVED&&Cn(t.text,e)}var An=["case","return","do","if","throw","else","await","break","continue","async"],Ln=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),qn=[Ln.before_newline,Ln.preserve_newline],Tn="BlockStatement",Mn="Statement",Rn="ObjectLiteral",On="ArrayLiteral",Bn="ForInitializer",Nn="Conditional",In="Expression";function Dn(t,e){e.multiline_frame||e.mode===Bn||e.mode===Nn||t.remove_indent(e.start_line_index)}function Pn(t){return t===On}function $n(t){return Cn(t,[In,Bn,Nn])}function zn(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new yn(e)}zn.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new bn(Sn.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},zn.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new mn(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Tn);var i=new _n(t,this._options);return this._tokens=i.tokenize(),t},zn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&vn.lineBreak.test(t||"")&&(e=t.match(vn.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},zn.prototype.handle_token=function(t,e){t.type===Sn.START_EXPR?this.handle_start_expr(t):t.type===Sn.END_EXPR?this.handle_end_expr(t):t.type===Sn.START_BLOCK?this.handle_start_block(t):t.type===Sn.END_BLOCK?this.handle_end_block(t):t.type===Sn.WORD||t.type===Sn.RESERVED?this.handle_word(t):t.type===Sn.SEMICOLON?this.handle_semicolon(t):t.type===Sn.STRING?this.handle_string(t):t.type===Sn.EQUALS?this.handle_equals(t):t.type===Sn.OPERATOR?this.handle_operator(t):t.type===Sn.COMMA?this.handle_comma(t):t.type===Sn.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===Sn.COMMENT?this.handle_comment(t,e):t.type===Sn.DOT?this.handle_dot(t):t.type===Sn.EOF?this.handle_eof(t):(t.type,Sn.UNKNOWN,this.handle_unknown(t,e))},zn.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&Pn(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var a=1;a<i;a+=1)this.print_newline(!0,e)}};var Hn=["async","break","continue","return","throw","yield"];zn.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(Cn(this._flags.last_token.text,wn)||Cn(t.text,wn)){var n=Cn(this._flags.last_token.text,wn)&&Cn(this._options.operator_position,qn)||Cn(t.text,wn);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(En(this._flags.last_token,Hn))return;this._output.set_wrap_point()}}},zn.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==Sn.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==Mn||this._flags.if_block&&kn(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},zn.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||Pn(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},zn.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===Sn.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},zn.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},zn.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},zn.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},zn.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Mn&&Dn(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},zn.prototype.start_of_object_property=function(){return this._flags.parent.mode===Rn&&this._flags.mode===Mn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||En(this._flags.last_token,["get","set"]))},zn.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||En(this._flags.last_token,["var","let","const"])&&t.type===Sn.WORD)||kn(this._flags.last_token,"do"))||!(this._flags.parent.mode===Rn&&this._flags.mode===Mn)&&En(this._flags.last_token,Hn)&&!t.newlines)||kn(this._flags.last_token,"else")&&!(kn(t,"if")&&!t.comments_before))||this._flags.last_token.type===Sn.END_EXPR&&(this._previous_flags.mode===Bn||this._previous_flags.mode===Nn))||this._flags.last_token.type===Sn.WORD&&this._flags.mode===Tn&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==Sn.WORD&&t.type!==Sn.RESERVED)||this._flags.mode===Rn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||En(this._flags.last_token,["get","set"])))&&(this.set_mode(Mn),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,En(t,["do","for","if","while"])),!0)},zn.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=In;if("["===t.text){if(this._flags.last_token.type===Sn.WORD||")"===this._flags.last_token.text)return En(this._flags.last_token,xn)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=On,Pn(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),Cn(this._flags.last_token.type,[Sn.START_EXPR,Sn.END_EXPR,Sn.WORD,Sn.OPERATOR,Sn.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Sn.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Bn):Cn(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Nn):Cn(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(Cn(this._flags.last_token.text,xn)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Sn.EQUALS||this._flags.last_token.type===Sn.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===Sn.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);En(i,["async","function"])||"*"===i.text&&En(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Rn&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===Sn.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(Cn(this._last_last_text,["function","yield"])||this._flags.mode===Rn&&Cn(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===Sn.START_BLOCK?this.print_newline():this._flags.last_token.type!==Sn.END_EXPR&&this._flags.last_token.type!==Sn.START_EXPR&&this._flags.last_token.type!==Sn.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==Sn.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},zn.prototype.handle_end_expr=function(t){for(;this._flags.mode===Mn;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&Pn(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==Sn.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),Dn(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Nn&&(this._previous_flags.mode=In,this._flags.do_block=!1,this._flags.do_while=!1)},zn.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===Sn.END_EXPR?(this.set_mode(Tn),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Tn):i&&(Cn(i.text,[":",","])&&Cn(e.type,[Sn.STRING,Sn.WORD,Sn.RESERVED])||Cn(e.text,["get","set","..."])&&Cn(i.type,[Sn.WORD,Sn.RESERVED]))?Cn(this._last_last_text,["class","interface"])?this.set_mode(Tn):this.set_mode(Rn):this._flags.last_token.type===Sn.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(Tn):Cn(this._flags.last_token.type,[Sn.EQUALS,Sn.START_EXPR,Sn.COMMA,Sn.OPERATOR])||En(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Rn):this.set_mode(Tn);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===Sn.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do{if(s+=1,(a=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==Sn.EOF&&(a.type!==Sn.END_BLOCK||a.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Sn.OPERATOR&&(o||this._flags.last_token.type===Sn.EQUALS||En(this._flags.last_token,An)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!Pn(this._previous_flags.mode)||this._flags.last_token.type!==Sn.START_EXPR&&this._flags.last_token.type!==Sn.COMMA||((this._flags.last_token.type===Sn.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Sn.COMMA||this._flags.last_token.type===Sn.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Sn.OPERATOR&&this._flags.last_token.type!==Sn.START_EXPR&&(this._flags.last_token.type!==Sn.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},zn.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===Mn;)this.restore_mode();var e=this._flags.last_token.type===Sn.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(Pn(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},zn.prototype.handle_word=function(t){if(t.type===Sn.RESERVED)if(Cn(t.text,["set","get"])&&this._flags.mode!==Rn)t.type=Sn.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=Sn.WORD;else if(Cn(t.text,["as","from"])&&!this._flags.import_block)t.type=Sn.WORD;else if(this._flags.mode===Rn){":"===this._tokens.peek().text&&(t.type=Sn.WORD)}if(this.start_of_statement(t)?En(this._flags.last_token,["var","let","const"])&&t.type===Sn.WORD&&(this._flags.declaration_statement=!0):!t.newlines||$n(this._flags.mode)||this._flags.last_token.type===Sn.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===Sn.EQUALS||!this._options.preserve_newlines&&En(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(kn(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&kn(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Mn;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&En(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==Sn.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==Sn.COMMA&&this._flags.last_token.type!==Sn.START_EXPR&&this._flags.last_token.type!==Sn.EQUALS&&this._flags.last_token.type!==Sn.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),kn(t,"function"))return(Cn(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!Cn(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==Sn.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===Sn.RESERVED||this._flags.last_token.type===Sn.WORD?En(this._flags.last_token,["get","set","new","export"])||En(this._flags.last_token,Hn)||kn(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Sn.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!$n(this._flags.mode)&&!Pn(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===Sn.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":En(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===Sn.SEMICOLON&&this._flags.mode===Tn?e="NEWLINE":this._flags.last_token.type===Sn.SEMICOLON&&$n(this._flags.mode)?e="SPACE":this._flags.last_token.type===Sn.STRING?e="NEWLINE":this._flags.last_token.type===Sn.RESERVED||this._flags.last_token.type===Sn.WORD||"*"===this._flags.last_token.text&&(Cn(this._last_last_text,["function","yield"])||this._flags.mode===Rn&&Cn(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===Sn.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===Sn.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),En(t,xn)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),En(t,["else","catch","finally"]))?(this._flags.last_token.type!==Sn.END_BLOCK||this._previous_flags.mode!==Tn||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?En(this._flags.last_token,An)||"declare"===this._flags.last_token.text&&En(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Sn.END_EXPR?this._flags.last_token.type===Sn.START_EXPR&&En(t,["var","let","const"])||":"===this._flags.last_token.text||(kn(t,"if")&&kn(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):En(t,xn)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&Pn(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==Sn.WORD&&t.previous.type!==Sn.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===Sn.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&kn(t,"from")&&(this._flags.import_block=!1))},zn.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==Mn||this._flags.if_block&&kn(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},zn.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==Sn.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===Sn.RESERVED||this._flags.last_token.type===Sn.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Sn.COMMA||this._flags.last_token.type===Sn.START_EXPR||this._flags.last_token.type===Sn.EQUALS||this._flags.last_token.type===Sn.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==Sn.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},zn.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},zn.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?($n(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===Rn||this._flags.mode===Mn&&this._flags.parent.mode===Rn?(this._flags.mode===Mn&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},zn.prototype.handle_operator=function(t){var e="*"===t.text&&(En(this._flags.last_token,["function","yield"])||Cn(this._flags.last_token.type,[Sn.START_BLOCK,Sn.COMMA,Sn.END_BLOCK,Sn.SEMICOLON])),i=Cn(t.text,["-","+"])&&(Cn(this._flags.last_token.type,[Sn.START_BLOCK,Sn.START_EXPR,Sn.EQUALS,Sn.OPERATOR])||Cn(this._flags.last_token.text,xn)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(En(this._flags.last_token,An))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==Sn.DOT)if("::"!==t.text){if(this._flags.last_token.type===Sn.OPERATOR&&Cn(this._options.operator_position,qn)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==Sn.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var o=!0,s=!0,a=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,a=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&Cn(t.text,wn)){var r=":"===t.text,l=r&&a,d=r&&!a;switch(this._options.operator_position){case Ln.before_newline:return this._output.space_before_token=!d,this.print_token(t),r&&!l||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case Ln.after_newline:return this._output.space_before_token=!0,!r||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case Ln.preserve_newline:return d||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||d),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var c=this._tokens.peek();s=c&&Cn(c.type,[Sn.WORD,Sn.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===Sn.START_BLOCK,s=!1):(Cn(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==Sn.COMMA&&this._flags.last_token.type!==Sn.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&$n(this._flags.mode)&&(o=!0),this._flags.last_token.type===Sn.RESERVED?o=!0:this._flags.last_token.type===Sn.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===Sn.OPERATOR&&(o=Cn(t.text,["--","-","++","+"])&&Cn(this._flags.last_token.text,["--","-","++","+"]),Cn(t.text,["+","-"])&&Cn(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==Tn||this._flags.inline_frame)&&this._flags.mode!==Mn||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},zn.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):vn.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},zn.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(vn.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,a=t.whitespace_before,r=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,a),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(r))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},zn.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},zn.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),En(this._flags.last_token,An)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},zn.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},zn.prototype.handle_eof=function(t){for(;this._flags.mode===Mn;)this.restore_mode();this.handle_whitespace_and_comments(t)},di.Beautifier=zn;var jn=di.Beautifier,Fn=mi.Options;li.exports=function(t,e){return new jn(t,e).beautify()},li.exports.defaultOptions=function(){return new Fn};var Un={exports:{}},Wn={},Vn={},Gn=bi.Options;function Xn(t){Gn.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Xn.prototype=new Gn,Vn.Options=Xn;var Yn=Vn.Options,Kn=ci.Output,Zn=ki.InputScanner,Qn=new(0,ji.Directives)(/\/\*/,/\*\//),Jn=/\r\n|[\r\n]/,to=/\r\n|[\r\n]/g,eo=/\s/,io=/(?:\s|\n)+/g,no=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,oo=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function so(t,e){this._source_text=t||"",this._options=new Yn(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}so.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},so.prototype.eatWhitespace=function(t){for(var e=eo.test(this._input.peek()),i=0;eo.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},so.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},so.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},so.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},so.prototype.indent=function(){this._indentLevel++},so.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},so.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&Jn.test(t||"")&&(e=t.match(Jn)[0]));var i=(t=t.replace(to,"\n")).match(/^[\t ]*/)[0];this._output=new Kn(this._options,i),this._input=new Zn(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,a=!1,r=!1,l=!1,d=!1,c=!1,u=this._ch;n=""!==this._input.read(io),o=u,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var p=this._input.read(no),h=Qn.get_directives(p);h&&"start"===h.ignore&&(p+=Qn.readIgnored(this._input)),this.print_string(p),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(oo)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var g=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);g.match(/[ :]$/)&&(g=this.eatString(": ").replace(/\s$/,""),this.print_string(g),this._output.space_before_token=!0),"extend"===(g=g.replace(/\s$/,""))?d=!0:"import"===g&&(c=!0),g in this.NESTED_AT_RULE?(this._nestedLevel+=1,g in this.CONDITIONAL_GROUP_RULE&&(l=!0)):a||0!==s||-1===g.indexOf(":")||(r=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(r&&(r=!1,this.outdent()),l?(l=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),c=!1,d=!1,r&&(this.outdent(),r=!1),this.print_string(this._ch),a=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!a&&!l||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||d||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),r||(r=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===s?(r&&(this.outdent(),r=!1),d=!1,c=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),s++,this.indent()):")"===this._ch?(s&&(s--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||r||0!==s||c||d?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||r||0!==s?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),eo.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&eo.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},Wn.Beautifier=so;var ao=Wn.Beautifier,ro=Vn.Options;Un.exports=function(t,e){return new ao(t,e).beautify()},Un.exports.defaultOptions=function(){return new ro};var lo={exports:{}},co={},uo={},po=bi.Options;function ho(t){po.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}ho.prototype=new po,uo.Options=ho;var go={},fo=Li.Tokenizer,mo=Li.TOKEN,bo=ji.Directives,vo=Ui.TemplatablePattern,yo=Ri.Pattern,_o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:mo.START,RAW:mo.RAW,EOF:mo.EOF},xo=new bo(/<\!--/,/-->/),wo=function(t,e){fo.call(this,t,e),this._current_tag_name="";var i=new vo(this._input).read_options(this._options),n=new yo(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(wo.prototype=new fo)._is_comment=function(t){return!1},wo.prototype._is_opening=function(t){return t.type===_o.TAG_OPEN},wo.prototype._is_closing=function(t,e){return t.type===_o.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},wo.prototype._reset=function(){this._current_tag_name=""},wo.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(_o.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(_o.UNKNOWN,this._input.next())},wo.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=xo.get_directives(i))&&"start"===n.ignore&&(i+=xo.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(_o.COMMENT,i)).directives=n));return e},wo.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(_o.COMMENT,i)).directives=null)}return e},wo.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(_o.TAG_OPEN,i)),n},wo.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(_o.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(_o.TAG_OPEN,i))),n},wo.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(_o.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(_o.TAG_CLOSE,"}}"))),n},wo.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(_o.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(_o.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===_o.EQUALS?this._create_token(_o.VALUE,o):this._create_token(_o.ATTRIBUTE,o));return n},wo.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},wo.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===_o.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=_o.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(_o.TEXT,n):null},wo.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(_o.TEXT,e)},go.Tokenizer=wo,go.TOKEN=_o;var So=uo.Options,Co=ci.Output,ko=go.Tokenizer,Eo=go.TOKEN,Ao=/\r\n|[\r\n]/,Lo=/\r\n|[\r\n]/g,qo=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new Co(t,e)};qo.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},qo.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},qo.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},qo.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},qo.prototype.print_preserved_newlines=function(t){var e=0;t.type!==Eo.TEXT&&t.previous.type!==Eo.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},qo.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},qo.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},qo.prototype.print_newline=function(t){this._output.add_new_line(t)},qo.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},qo.prototype.indent=function(){this.indent_level++},qo.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var To=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==Eo.EOF&&t.closed!==i;){if(i.type===Eo.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===Eo.EQUALS&&i.next.next&&i.next.next.type===Eo.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function Mo(t,e){return-1!==e.indexOf(t)}function Ro(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function Oo(t){this._printer=t,this._current_frame=null}function Bo(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new So(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}Oo.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},Oo.prototype.record_tag=function(t){var e=new Ro(this._current_frame,t,this._printer.indent_level);this._current_frame=e},Oo.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},Oo.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},Oo.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},Oo.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},Bo.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&Ao.test(t)&&(e=t.match(Ao)[0]));var i=(t=t.replace(Lo,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new No,s=new qo(this._options,i),a=new ko(t,this._options).tokenize();this._tag_stack=new Oo(s);for(var r=null,l=a.next();l.type!==Eo.EOF;)l.type===Eo.TAG_OPEN||l.type===Eo.COMMENT?o=r=this._handle_tag_open(s,l,o,n):l.type===Eo.ATTRIBUTE||l.type===Eo.EQUALS||l.type===Eo.VALUE||l.type===Eo.TEXT&&!o.tag_complete?r=this._handle_inside_tag(s,l,o,a):l.type===Eo.TAG_CLOSE?r=this._handle_tag_close(s,l,o):l.type===Eo.TEXT?r=this._handle_text(s,l,o):s.add_raw_token(l),n=r,l=a.next();return s._output.get_code(e)},Bo.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},Bo.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===Eo.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===Eo.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===Eo.EQUALS||e.type===Eo.VALUE&&e.previous.type===Eo.EQUALS)&&t.set_space_before_token(!1),e.type===Eo.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var a=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var r,l=!0,d=0;do{if((r=n.peek(d)).type===Eo.ATTRIBUTE){l=!1;break}d+=1}while(d<4&&r.type!==Eo.EOF&&r.type!==Eo.TAG_CLOSE);a=!l}a&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},Bo.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},Bo.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,a=1,r="",l="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new Bo(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-t.indent_level);var d=t.get_full_indent(a);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var c=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!c)return void t.add_raw_token(e);r=d+c[1]+"\n",s=c[4],c[5]&&(l=d+c[5]),s=s.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(e.whitespace_before=c[0])}if(s)if(o){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,s=o(d+s,new u)}else{var p=e.whitespace_before;p&&(s=s.replace(new RegExp("\n("+p+")?","g"),"\n")),s=d+s.replace(/\n/g,"\n"+d)}r&&(s=s?r+s+"\n"+l:r+l),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},Bo.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==Eo.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var No=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===Eo.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};Bo.prototype._get_tag_open_token=function(t){var e=new No(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||Mo(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&Mo(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&Mo(e.tag_check,this._options.content_unformatted),e.is_inline_element=Mo(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},Bo.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=To(i.tag_check,e)))),Mo(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===Eo.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===Eo.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},Bo.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Io=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],Do=["a","audio","del","ins","map","noscript","video"];Bo.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Io.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==Do.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},co.Beautifier=Bo;var Po=co.Beautifier,$o=uo.Options;lo.exports=function(t,e,i,n){return new Po(t,e,i,n).beautify()},lo.exports.defaultOptions=function(){return new $o};var zo=li.exports,Ho=Un.exports,jo=lo.exports;function Fo(t,e,i,n){return jo(t,e,i=i||zo,n=n||Ho)}Fo.defaultOptions=jo.defaultOptions,ri.js=zo,ri.css=Ho,ri.html=Fo,function(t){!function(t){var e=ri;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(t)}(ai);var Uo=ai.exports;function Wo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Vo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Go(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Vo(Object(i),!0).forEach((function(e){Wo(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Vo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Xo(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ko(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Zo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Qo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zo(Object(i),!0).forEach((function(e){Ko(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Jo(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}function ts(t){return function e(){for(var i=this,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return o.length>=t.length?t.apply(this,o):function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(i,[].concat(o,n))}}}function es(t){return{}.toString.call(t).includes("Object")}function is(t){return"function"==typeof t}var ns=ts((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),os={changes:function(t,e){return es(e)||ns("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&ns("changeField"),e},selector:function(t){is(t)||ns("selectorType")},handler:function(t){is(t)||es(t)||ns("handlerType"),es(t)&&Object.values(t).some((function(t){return!is(t)}))&&ns("handlersType")},initial:function(t){var e;t||ns("initialIsRequired"),es(t)||ns("initialType"),e=t,Object.keys(e).length||ns("initialContent")}};function ss(t,e){return is(e)?e(t.current):e}function as(t,e){return t.current=Qo(Qo({},t.current),e),e}function rs(t,e,i){return is(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var ls={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};os.initial(t),os.handler(e);var i={current:t},n=ts(rs)(i,e),o=ts(as)(i),s=ts(os.changes)(t),a=ts(ss)(i);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return os.selector(t),t(i.current)}function l(t){Jo(n,o,s,a)(t)}return[r,l]}};var ds,cs={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},us=(ds=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=ds.length?ds.apply(this,n):function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t.apply(e,[].concat(n,o))}})(cs),ps={config:function(t){var e;return t||us("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||us("configType"),t.urls?(console.warn(cs.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function hs(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],hs(t[i],e[i]))})),Go(Go({},t),e)}var gs={type:"cancelation",msg:"operation is manually canceled"};function fs(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(gs):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var ms,bs,vs=ls.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),ys=(bs=2,function(t){if(Array.isArray(t))return t}(ms=vs)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,o=!1,s=void 0;try{for(var a,r=t[Symbol.iterator]();!(n=(a=r.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){o=!0,s=t}finally{try{n||null==r.return||r.return()}finally{if(o)throw s}}return i}}(ms,bs)||function(t,e){if(t){if("string"==typeof t)return Yo(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Yo(t,e):void 0}}(ms,bs)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_s=ys[0],xs=ys[1];function ws(t){return document.body.appendChild(t)}function Ss(t){var e=_s((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function Cs(){var t=_s((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){ks(e),t.resolve(e)}),(function(e){t.reject(e)}))}function ks(t){_s().monaco||xs({monaco:t})}var Es=new Promise((function(t,e){return xs({resolve:t,reject:e})})),As={config:function(t){var e=ps.config(t),i=e.monaco,n=Xo(e,["monaco"]);xs((function(t){return{config:hs(t.config,n),monaco:i}}))},init:function(){var t=_s((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(xs({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),fs(Es);if(window.monaco&&window.monaco.editor)return ks(window.monaco),t.resolve(window.monaco),fs(Es);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(ws,Ss)(Cs)}return fs(Es)},__getMonacoInstance:function(){return _s((function(t){return t.monaco}))}};const Ls=new si;let qs={};class Ts{constructor(t){this.builder=t;const e=this.builder.util,i=this.builder.builderStuff;let n=i.querySelector(".viewhtml");if(!n){const t=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="max-width: 55vw;padding:0">\n <textarea style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:65vh;"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="max-width: 55vw;padding:0">\n <div class="input-code-editor" style="width:100%;height:65vh;"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;Ls.appendHtml(i,t),n=i.querySelector(".viewhtml");let o=i.querySelector(".viewhtmlmonaco"),s=i.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");Ls.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),Ls.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=o.querySelector(".input-ok"),Ls.addEventListener(a,"click",(()=>{this.applyHtml(o)})),a=o.querySelector(".input-cancel"),Ls.addEventListener(a,"click",(()=>{this.builder.hideModal(o)})),a=s.querySelector(".input-ok"),Ls.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)})),a=s.querySelector(".input-cancel"),Ls.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)}))}}applyHtml(t){const e=this.builder.util;let i=this.builder.codeEditorMode,n=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===i){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===i){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===i){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender()}if("full"===i){n.innerHTML="";let t=document.createRange();t.setStart(n,0),n.appendChild(t.createContextualFragment(o));let i=this.builder.doc.querySelector(".builder-active");i&&this.builder.applyBehaviorOn(i),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(e,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),e.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=document.querySelector("textarea[data-source-active]");let e=this.builder.builderStuff.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!e.querySelector(".monaco-editor"))return As.init().then((t=>{this.builder.monaco=t,e.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(e,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onKeyUp((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const i=this.builder.monaco.editor.createModel(t.value,"html");this.builder.codeEditorExternal.setModel(i),e.style.opacity=""}view(t,e,i){const n=this.builder.util,o=this.builder.builderStuff;let s;s=this.builder.opts.htmlSyntaxHighlighting?o.querySelector(".viewhtmlmonaco"):o.querySelector(".viewhtml"),n.showModal(s,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus())})),i&&i.setAttribute("data-focus",!0),s.querySelector(".input-code-editor").style.opacity=.01,this._view(t,e)}_view(t,e){const i=this.builder.util,n=this.builder.builderStuff;let o;if(this.builder.opts.htmlSyntaxHighlighting){o=n.querySelector(".viewhtmlmonaco");let i=o.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return As.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=o.querySelector("textarea");this.builder.codeEditor.onKeyUp((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else o=n.querySelector(".viewhtml");let s=o.querySelector("textarea");if("cell"===t){const t=i.cellSelected();if(!t)return;let e=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=i.cellSelected();if(t=e?e.parentNode:i.rowSelected(),!t)return;let s=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,s.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,Ls.removeClass(t,"row-outline");let a=n.querySelector(".is-column-tool");Ls.removeClass(a,"active")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const n=i.cellSelected();e=n?n.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,t.value=this.readHtml(e,!0),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(s.value,"html");this.builder.codeEditor.setModel(t)}n.querySelector(".is-pop.columnmore").style.display="",n.querySelector(".is-pop.rowmore").style.display="",this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,o.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in qs)t=t.replace(e,qs[e]);return t}readHtml(t,e,i){if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}if(this.builder.cleanHtmlFormatting&&this.builder.useCssClasses){let e=t.querySelectorAll(`.${this.builder.cssClasses.fontWeight.defaultNormal}`);e=t.querySelectorAll(`.${this.builder.cssClasses.extend.unset}`),Array.prototype.forEach.call(e,(t=>{Ls.removeClass(t,this.builder.cssClasses.extend.unset)}))}const n=this.builder.util,o=this.builder.builderStuff;let s=o.querySelector("#tmp_content");s&&o.removeChild(s),s=o.querySelector("#tmp_buildercontent"),s&&o.removeChild(s);let a='<div id="tmp_content" style="position:absolute;top:0;left:0;width:1px;height:1px;overflow:hidden;visibility:hidden;"></div>\n <div id="tmp_buildercontent" style="position:absolute;top:0;left:0;width:1px;height:1px;overflow:hidden;visibility:hidden;"></div>';Ls.appendHtml(o,a);let r=o.querySelector("#tmp_content");r.innerHTML=t.innerHTML;let l=r.querySelectorAll("[data-html]");Array.prototype.forEach.call(l,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),l=r.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,n.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+o)?"":decodeURIComponent(t.getAttribute("data-html-"+o)),o++}))})),e&&(qs={},l=r.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=n.makeId();qs[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=n.makeId(),qs[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=n.makeId(),qs[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))})));let d=r.querySelectorAll(".is-builder");Array.prototype.forEach.call(d,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),Ls.removeClass(t,"builder-active");Ls.elementChildren(t).forEach((t=>{Ls.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));Ls.elementChildren(r).forEach((t=>{Ls.elementChildren(t).forEach((t=>{t.style.cursor=""}))}));let c=r.querySelectorAll(".sortable-chosen");Ls.removeClasses(c,"sortable-chosen"),c=r.querySelectorAll(".sortable-ghost"),Ls.removeClasses(c,"sortable-ghost"),c=r.querySelectorAll(".elm-active"),Ls.removeClasses(c,"elm-active"),c=r.querySelectorAll(".elm-inspected"),Ls.removeClasses(c,"elm-inspected"),c=r.querySelectorAll(".cell-active"),Ls.removeClasses(c,"cell-active"),c=r.querySelectorAll(".row-active"),Ls.removeClasses(c,"row-active"),c=r.querySelectorAll(".row-outline"),Ls.removeClasses(c,"row-outline"),c=r.querySelectorAll(".is-builder"),Ls.removeClasses(c,"is-builder"),c=r.querySelectorAll(".row-outline"),Ls.removeClasses(c,"row-outline"),c=r.querySelectorAll("[data-click]"),Ls.removeAttributes(c,"data-click"),c=r.querySelectorAll("[contenteditable]"),Ls.removeAttributes(c,"contenteditable"),c=r.querySelectorAll("[draggridoutline]"),Ls.removeAttributes(c,"draggridoutline"),c=r.querySelectorAll("[between-blocks-left]"),Ls.removeAttributes(c,"between-blocks-left"),c=r.querySelectorAll("[between-blocks-center]"),Ls.removeAttributes(c,"between-blocks-center"),c=r.querySelectorAll("[hideelementhighlight]"),Ls.removeAttributes(c,"hideelementhighlight"),c=r.querySelectorAll("[data-module-active]"),Ls.removeAttributes(c,"data-module-active"),c=r.querySelectorAll("[draggable]"),Ls.removeAttributes(c,"draggable"),c=r.querySelectorAll("[data-animated]"),Ls.removeAttributes(c,"data-animated"),c=r.querySelectorAll("[data-saveforundo]"),Ls.removeAttributes(c,"data-saveforundo"),c=r.querySelectorAll("[hidesnippetaddtool]"),Ls.removeAttributes(c,"hidesnippetaddtool"),c=r.querySelectorAll("[gray]"),Ls.removeAttributes(c,"gray"),c=r.querySelectorAll("[rowoutline]"),Ls.removeAttributes(c,"rowoutline"),c=r.querySelectorAll("[grayoutline]"),Ls.removeAttributes(c,"grayoutline"),c=r.querySelectorAll("[hideoutline]"),Ls.removeAttributes(c,"hideoutline"),c=r.querySelectorAll("[leftrowtool]"),Ls.removeAttributes(c,"leftrowtool"),c=r.querySelectorAll("[minimal]"),Ls.removeAttributes(c,"minimal"),c=r.querySelectorAll("[clean]"),Ls.removeAttributes(c,"clean"),c=r.querySelectorAll("[grideditor]"),Ls.removeAttributes(c,"grideditor"),c=r.querySelectorAll("[gridoutline]"),Ls.removeAttributes(c,"gridoutline"),Ls.removeElements(r.querySelectorAll(".is-row-tool")),Ls.removeElements(r.querySelectorAll(".is-rowadd-tool")),Ls.removeElements(r.querySelectorAll(".ovl")),Ls.removeElements(r.querySelectorAll(".row-add-initial")),c=r.querySelectorAll(".aos-init"),Ls.removeClasses(c,"aos-init"),c=r.querySelectorAll(".aos-animate"),Ls.removeClasses(c,"aos-animate"),c=r.querySelectorAll(".skrollable"),Ls.removeClasses(c,"skrollable"),c=r.querySelectorAll(".skrollable-after"),Ls.removeClasses(c,"skrollable-after"),c=r.querySelectorAll(".skrollable-before"),Ls.removeClasses(c,"skrollable-before"),c=r.querySelectorAll(".skrollable-between"),Ls.removeClasses(c,"skrollable-between"),c=r.querySelectorAll(".is-inview"),Ls.removeClasses(c,"is-inview");let u=r.querySelectorAll('[class=""]');Array.prototype.forEach.call(u,(t=>{t.removeAttribute("class")}));let p=r.querySelectorAll('[style=""]');Array.prototype.forEach.call(p,(t=>{t.removeAttribute("style")})),Ls.removeEmptyStyle(r),c=r.querySelectorAll("[data-keep]"),Ls.removeAttributes(c,"data-keep");let h=r.querySelectorAll("a");if(Array.prototype.forEach.call(h,(t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),a="",i){let t=r.querySelectorAll(".is-dummy");Ls.removeElements(t),t=r.querySelectorAll(".is-animated"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"animated"),Ls.removeClass(t,"pulse"),Ls.removeClass(t,"bounceIn"),Ls.removeClass(t,"fadeIn"),Ls.removeClass(t,"fadeOut"),Ls.removeClass(t,"fadeInDown"),Ls.removeClass(t,"fadeInLeft"),Ls.removeClass(t,"fadeInRight"),Ls.removeClass(t,"fadeInUp"),Ls.removeClass(t,"flipInX"),Ls.removeClass(t,"flipInY"),Ls.removeClass(t,"slideInUp"),Ls.removeClass(t,"slideInDown"),Ls.removeClass(t,"slideInLeft"),Ls.removeClass(t,"slideInRight"),Ls.removeClass(t,"zoomIn"),t.style.animationDelay=""})),t=r.querySelectorAll(".is-appeared"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"is-appeared")})),t=r.querySelectorAll(".box-active"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"box-active")})),t=r.querySelectorAll(".section-active"),Array.prototype.forEach.call(t,(t=>{Ls.removeClass(t,"section-active")})),t=r.querySelectorAll(".is-section-tool"),Ls.removeElements(t),t=r.querySelectorAll(".is-box-tool"),Ls.removeElements(t);var g="",f="",m="";Ls.elementChildren(r).forEach((t=>{let e=t;if(Ls.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),o=n.outerHTML;a+=o,-1===i.indexOf("is-static")?g+=o+"\n\n":f+=o+"\n\n"}else o=(n=e.cloneNode(!0)).outerHTML,a+=o,m+=o})),""!==f&&(f="\x3c!---FOOTER---\x3e\n"+f),""!==m&&(m="\x3c!---OTHERS---\x3e\n"+m);let e=document.querySelector("[data-contentbox]"),i=!1;e&&(i=e.settings.disableStaticSection),i||(a=g+f+m)}else a=r.innerHTML.trim(),a=a.replace(/<font/g,"<span").replace(/<\/font/g,"</span");return s=o.querySelector("#tmp_content"),s&&o.removeChild(s),s=o.querySelector("#tmp_buildercontent"),s&&o.removeChild(s),(0,Uo.html)(a)}}class Ms{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,o=this.builder.doc.getElementsByTagName("link");for(i=0;i<o.length;i++)n=o[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&o[i].parentNode.removeChild(o[i]);let s=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(s,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let i=this.builder.doc.querySelector(this.builder.opts.page);var e=document.createRange();i.innerHTML="",i.appendChild(e.createContextualFragment(t)),this.cleaning(i)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new oi(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new oi(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
|
14
14
|
/*!
|
15
15
|
Ionicons
|
16
16
|
License: MIT
|