@themarioga/grid-editor 8.6.0 → 8.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.esm.js +27 -3
- package/dist/grideditor.js +27 -3
- package/dist/grideditor.min.js +2 -2
- package/dist/grideditor.min.js.map +3 -3
- package/dist/plugins/grideditor.autosave.esm.js +15 -0
- package/dist/plugins/grideditor.autosave.js +15 -0
- package/dist/plugins/grideditor.autosave.min.js +1 -1
- package/dist/plugins/grideditor.autosave.min.js.map +2 -2
- package/docs/plugins.md +32 -0
- package/package.json +1 -2
- package/src/js/grideditor.js +38 -2
- package/src/js/plugins/grideditor.autosave.js +13 -0
package/dist/grideditor.esm.js
CHANGED
|
@@ -652,6 +652,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
652
652
|
var refitToolbar = function() {
|
|
653
653
|
};
|
|
654
654
|
var addButtons = [];
|
|
655
|
+
var shownToolbar = {};
|
|
655
656
|
var toolbarGroup = null;
|
|
656
657
|
var warnedHere = {};
|
|
657
658
|
var sortables = [];
|
|
@@ -1196,8 +1197,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1196
1197
|
addButtons.push({ button, home: addContainerGroup, group: toolbarGroupOf(definition.group) || "content" });
|
|
1197
1198
|
});
|
|
1198
1199
|
var endItems = [];
|
|
1200
|
+
shownToolbar = {};
|
|
1199
1201
|
Object.keys(FEATURES).forEach(function(name) {
|
|
1200
|
-
|
|
1202
|
+
shownToolbar[name] = toolbarOf(FEATURES[name]);
|
|
1203
|
+
shownToolbar[name].forEach(function(item, index) {
|
|
1201
1204
|
var button = featureButton(name, item, index);
|
|
1202
1205
|
if (item.align === "end") {
|
|
1203
1206
|
endItems.push(button);
|
|
@@ -1333,6 +1336,22 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1333
1336
|
return !closest(entry.button, ".ge-toolbar-stash");
|
|
1334
1337
|
});
|
|
1335
1338
|
}
|
|
1339
|
+
function toolbarOf(feature) {
|
|
1340
|
+
var items = typeof feature.toolbar === "function" ? feature.toolbar() : feature.toolbar;
|
|
1341
|
+
return Array.isArray(items) ? items : [];
|
|
1342
|
+
}
|
|
1343
|
+
function refreshToolbar() {
|
|
1344
|
+
if (!mainControls || destroyed) {
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
var previewing = !!one(mainControls, ".gm-preview.active");
|
|
1348
|
+
removeMainControls();
|
|
1349
|
+
createMainControls();
|
|
1350
|
+
if (previewing) {
|
|
1351
|
+
addClass(one(mainControls, ".gm-preview"), "active btn-danger");
|
|
1352
|
+
}
|
|
1353
|
+
onScroll();
|
|
1354
|
+
}
|
|
1336
1355
|
function removeMainControls() {
|
|
1337
1356
|
if (toolbarLifetime) {
|
|
1338
1357
|
toolbarLifetime.abort();
|
|
@@ -1559,7 +1578,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1559
1578
|
return { region, before };
|
|
1560
1579
|
}
|
|
1561
1580
|
function insertFeatureFromToolbar(button, where, source) {
|
|
1562
|
-
var item =
|
|
1581
|
+
var item = (shownToolbar[button.getAttribute("data-ge-feature")] || [])[parseInt(button.getAttribute("data-ge-item"), 10)];
|
|
1582
|
+
if (!item) {
|
|
1583
|
+
return null;
|
|
1584
|
+
}
|
|
1563
1585
|
var made = item.create();
|
|
1564
1586
|
if (!made) {
|
|
1565
1587
|
return null;
|
|
@@ -2221,6 +2243,8 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2221
2243
|
// A node's drawer: its first child, or for a content area the
|
|
2222
2244
|
// one beside it in its text block
|
|
2223
2245
|
drawerOf,
|
|
2246
|
+
// The toolbar built again, from the plugins' toolbars as they are now
|
|
2247
|
+
refreshToolbar,
|
|
2224
2248
|
toolbarItems: function(name) {
|
|
2225
2249
|
return mainControls ? all(mainControls, '[data-ge-toolbar="feature"][data-ge-feature="' + name + '"]') : [];
|
|
2226
2250
|
}
|
|
@@ -4685,7 +4709,7 @@ GridEditor.t = translate;
|
|
|
4685
4709
|
GridEditor._plainHtml = plainHtml;
|
|
4686
4710
|
GridEditor.Sortable = null;
|
|
4687
4711
|
GridEditor.bootstrap = null;
|
|
4688
|
-
GridEditor.version = false ? "dev" : "8.
|
|
4712
|
+
GridEditor.version = false ? "dev" : "8.7.1";
|
|
4689
4713
|
GridEditor.locales = {
|
|
4690
4714
|
en: {
|
|
4691
4715
|
"tool.move": "Move",
|
package/dist/grideditor.js
CHANGED
|
@@ -653,6 +653,7 @@
|
|
|
653
653
|
var refitToolbar = function() {
|
|
654
654
|
};
|
|
655
655
|
var addButtons = [];
|
|
656
|
+
var shownToolbar = {};
|
|
656
657
|
var toolbarGroup = null;
|
|
657
658
|
var warnedHere = {};
|
|
658
659
|
var sortables = [];
|
|
@@ -1197,8 +1198,10 @@
|
|
|
1197
1198
|
addButtons.push({ button, home: addContainerGroup, group: toolbarGroupOf(definition.group) || "content" });
|
|
1198
1199
|
});
|
|
1199
1200
|
var endItems = [];
|
|
1201
|
+
shownToolbar = {};
|
|
1200
1202
|
Object.keys(FEATURES).forEach(function(name) {
|
|
1201
|
-
|
|
1203
|
+
shownToolbar[name] = toolbarOf(FEATURES[name]);
|
|
1204
|
+
shownToolbar[name].forEach(function(item, index) {
|
|
1202
1205
|
var button = featureButton(name, item, index);
|
|
1203
1206
|
if (item.align === "end") {
|
|
1204
1207
|
endItems.push(button);
|
|
@@ -1334,6 +1337,22 @@
|
|
|
1334
1337
|
return !closest(entry.button, ".ge-toolbar-stash");
|
|
1335
1338
|
});
|
|
1336
1339
|
}
|
|
1340
|
+
function toolbarOf(feature) {
|
|
1341
|
+
var items = typeof feature.toolbar === "function" ? feature.toolbar() : feature.toolbar;
|
|
1342
|
+
return Array.isArray(items) ? items : [];
|
|
1343
|
+
}
|
|
1344
|
+
function refreshToolbar() {
|
|
1345
|
+
if (!mainControls || destroyed) {
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
var previewing = !!one(mainControls, ".gm-preview.active");
|
|
1349
|
+
removeMainControls();
|
|
1350
|
+
createMainControls();
|
|
1351
|
+
if (previewing) {
|
|
1352
|
+
addClass(one(mainControls, ".gm-preview"), "active btn-danger");
|
|
1353
|
+
}
|
|
1354
|
+
onScroll();
|
|
1355
|
+
}
|
|
1337
1356
|
function removeMainControls() {
|
|
1338
1357
|
if (toolbarLifetime) {
|
|
1339
1358
|
toolbarLifetime.abort();
|
|
@@ -1560,7 +1579,10 @@
|
|
|
1560
1579
|
return { region, before };
|
|
1561
1580
|
}
|
|
1562
1581
|
function insertFeatureFromToolbar(button, where, source) {
|
|
1563
|
-
var item =
|
|
1582
|
+
var item = (shownToolbar[button.getAttribute("data-ge-feature")] || [])[parseInt(button.getAttribute("data-ge-item"), 10)];
|
|
1583
|
+
if (!item) {
|
|
1584
|
+
return null;
|
|
1585
|
+
}
|
|
1564
1586
|
var made = item.create();
|
|
1565
1587
|
if (!made) {
|
|
1566
1588
|
return null;
|
|
@@ -2222,6 +2244,8 @@
|
|
|
2222
2244
|
// A node's drawer: its first child, or for a content area the
|
|
2223
2245
|
// one beside it in its text block
|
|
2224
2246
|
drawerOf,
|
|
2247
|
+
// The toolbar built again, from the plugins' toolbars as they are now
|
|
2248
|
+
refreshToolbar,
|
|
2225
2249
|
toolbarItems: function(name) {
|
|
2226
2250
|
return mainControls ? all(mainControls, '[data-ge-toolbar="feature"][data-ge-feature="' + name + '"]') : [];
|
|
2227
2251
|
}
|
|
@@ -4686,7 +4710,7 @@
|
|
|
4686
4710
|
GridEditor._plainHtml = plainHtml;
|
|
4687
4711
|
GridEditor.Sortable = null;
|
|
4688
4712
|
GridEditor.bootstrap = null;
|
|
4689
|
-
GridEditor.version = false ? "dev" : "8.
|
|
4713
|
+
GridEditor.version = false ? "dev" : "8.7.1";
|
|
4690
4714
|
GridEditor.locales = {
|
|
4691
4715
|
en: {
|
|
4692
4716
|
"tool.move": "Move",
|
package/dist/grideditor.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(()=>{function x(i,u){return i?Array.prototype.slice.call(i.querySelectorAll(u)):[]}function S(i,u){return i?i.querySelector(u):null}function xe(i,u){if(!i)return[];var p=x(i,u);return i.nodeType===1&&i.matches(u)&&p.unshift(i),p}function V(i,u){return i?Array.prototype.filter.call(i.children,function(p){return!u||p.matches(u)}):[]}function L(i,u){return V(i,u)[0]||null}function J(i,u,p){var s=i&&i.nodeType===1?i.closest(u):null;return s&&p&&s!==p&&!p.contains(s)?null:s}function _e(i,u){return!!i&&i.nodeType===1&&i.matches(u)}function ze(i){return!!i&&document.documentElement.contains(i)}function ro(i,u){for(var p=[],s=i.nextElementSibling;s;s=s.nextElementSibling)(!u||s.matches(u))&&p.push(s);return p}function oo(i,u){for(var p=[],s=i.parentElement;s&&s!==u;s=s.parentElement)p.push(s);return p}function ma(i){var u=document.createElement("template");return u.innerHTML=i,Array.prototype.slice.call(u.content.childNodes)}function G(i){for(var u=ma(i.trim()),p=0;p<u.length;p++)if(u[p].nodeType===1)return u[p];return null}function v(i,u,p){var s=document.createElement(i);return Object.keys(u||{}).forEach(function(f){var k=u[f];k!=null&&k!==!1&&s.setAttribute(f,k)}),p!=null&&(s.textContent=p),s}function it(i,u){return i.innerHTML=u==null?"":String(u),i}function E(i,u){return Ke(u).forEach(function(p){i.classList.add(p)}),i}function T(i,u){return Ke(u).forEach(function(p){i.classList.remove(p)}),i}function z(i,u,p){return Ke(u).forEach(function(s){p===void 0?i.classList.toggle(s):i.classList.toggle(s,!!p)}),i}function y(i,u){return!!i&&i.nodeType===1&&i.classList.contains(u)}function Ke(i){return String(i||"").split(/\s+/).filter(Boolean)}function at(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function lt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function Lt(i,u){return Object.keys(u).forEach(function(p){var s=u[p];s==null?i.removeAttribute(p):i.setAttribute(p,s)}),i}function ke(i,u){return Object.keys(u).forEach(function(p){var s=u[p];typeof s=="number"&&!ga[p]&&(s=s+"px"),i.style.setProperty(p,s==null?"":String(s))}),i}var ga={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},ot={};function pa(i){var u=i.nodeName;if(!ot[u]){var p=document.body.appendChild(document.createElement(u));ot[u]=getComputedStyle(p).display,p.remove(),ot[u]==="none"&&(ot[u]="block")}return ot[u]}function Pe(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=pa(i)),i}function ge(i){return i.style.display="none",i}function Ln(i,u){return u===void 0&&(u=!Mt(i)),u?Pe(i):ge(i)}function Mt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function st(i){return i.getBoundingClientRect().width}function zt(i){return i.getBoundingClientRect().height}function io(i){var u=getComputedStyle(i);return i.clientHeight-parseFloat(u.paddingTop)-parseFloat(u.paddingBottom)}function Pt(i){var u=i.getBoundingClientRect();return{top:u.top+window.pageYOffset,left:u.left+window.pageXOffset}}function jt(i,u){return u.parentNode.insertBefore(i,u.nextSibling),i}function Rt(i){for(var u=i.parentNode;i.firstChild;)u.insertBefore(i.firstChild,i);i.remove()}function ao(i,u){return i.parentNode.insertBefore(u,i),u.appendChild(i),u}function Ve(i,u,p,s,f){var k=function(b){var j=J(b.target,p,i);if(j&&i.contains(j))return s.call(j,b)};return Ke(u).forEach(function(b){i.addEventListener(b,k,f)}),k}function ie(i,u,p,s){return Ke(u).forEach(function(f){i.addEventListener(f,p,s)}),p}function Mn(i,u,p,s){Ke(u).forEach(function(f){i.removeEventListener(f,p,s)})}var va=400;function lo(i,u,p,s){p=p===void 0?va:p;var f=function(){ge(i),s&&s()};if(!Mt(i)||!i.animate||p<=0){window.setTimeout(f,0);return}var k=i.animate(u(getComputedStyle(i)),{duration:p,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,f())};k.onfinish=j,k.oncancel=j}function ut(i,u,p){typeof u=="function"&&(p=u,u=void 0),i.style.overflow="hidden",lo(i,function(s){return[{height:s.height,paddingTop:s.paddingTop,paddingBottom:s.paddingBottom,marginTop:s.marginTop,marginBottom:s.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},u,function(){i.style.removeProperty("overflow"),p&&p()})}function so(i,u,p,s){i.style.overflow="hidden",lo(i,function(f){var k={opacity:f.opacity,height:f.height},b={opacity:0,height:"0px"};return s&&(k.width=f.width,b.width="0px"),[k,b]},u,function(){i.style.removeProperty("overflow"),p&&p()})}var uo={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{}},ba=["appendTo","prependTo","insertAfter","insertBefore"],w=[{key:"xs",infix:"",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",infix:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",infix:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",infix:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",infix:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",infix:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],$="all",wa="view.all",zn=[$].concat(w.map(function(i){return i.key})),F=12,co=11,Pn=["equal","auto"],Ge=["1","2","3","4","5","6","auto"];function jn(i,u){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+u}function q(i){return typeof i=="number"}function je(i,u){return u==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+u}function Q(i){for(var u=0;u<w.length;u++)if(w[u].key===i)return w[u];return null}function fo(i){if(i===$)return[w[0]];var u=Q(i);return u?[u]:[]}function dt(i){var u=Q(i);return u?u.labelKey:wa}var Re={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1,types:[]},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},mo={},ya=0,Dt=new WeakMap;function Dn(i,u,p){var s=_.locales,f=s[i.locale]||{},k=i.locale_strings||{},b=k[u];return b===void 0&&(b=f[u]),b===void 0&&(b=s.en[u]),b===void 0&&(Ea("locale:"+u,'no string for "'+u+'" in any locale, showing the key'),b=u),b.replace(/\{(\w+)\}/g,function(j,ae){return p&&p[ae]!==void 0?p[ae]:j})}function Ca(i,u){var p=_.locales;return(i.locale_strings||{})[u]!==void 0||(p[i.locale]||{})[u]!==void 0||p.en[u]!==void 0}function U(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Ea(i,u){mo[i]||(mo[i]=!0,U(u))}function xa(i,u){return Dn({locale:"en"},i,u)}function _a(i){if(typeof i=="string"){var u=document.querySelector(i);if(!u)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return u}if(i&&i.nodeType===1)return i;throw new TypeError("grid-editor: the target is an element or a selector, not "+(i===null?"null":typeof i))}function pe(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function go(){return _.Sortable||window.Sortable||null}function ct(){var i=_.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function Rn(i){var u=document.implementation.createHTMLDocument("").body;u.innerHTML=i;var p=[];return x(u,"*").forEach(function(s){var f=!1;Array.prototype.slice.call(s.attributes).forEach(function(j){j.name.indexOf("data-ge-")===0&&(s.removeAttribute(j.name),f=!0)});var k=(s.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=k.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==k.length&&(f=!0),b.length?s.setAttribute("class",b.join(" ")):s.removeAttribute("class"),f&&s.tagName==="DIV"&&!s.attributes.length&&p.push(s)}),p.forEach(function(s){Rt(s)}),u.innerHTML}function _(i,u){var p=_a(i),s=Dt.get(p);if(s)return po.has(p)||(po.add(p),U(xa("warning.already_editing"))),s;if(!(this instanceof _))return new _(p,u);ka(this,p,u||{})}var po=new WeakSet;_.create=function(i,u){return new _(i,u)};_.get=function(i){var u=pe(i);return u&&Dt.get(u)||null};function ka(i,u,p){var s=Object.assign({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",toolbar_overflow:"menu",drawer_overflow:"menu",toolbar_groups:!1,active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Re.elements,custom_filter:"",valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12,"equal","auto"],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:Re.add_column,layout_modes:zn.slice(),default_view:$,resize:Re.resize,indent:Re.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Re.drag},p);Object.keys(Re).forEach(function(e){s[e]=Object.assign({},Re[e],s[e])});var f,k,b,j,ae,De,Z,M=s.default_view,N=null,te=null,ve=!1,Ne=null,H=null,ft=null,Nt=function(){},It=function(){},le=[],Ft=null,Nn={},mt=[],vo=++ya,Ht=!1,In=new WeakMap,Ut=new WeakMap,gt=new WeakMap,Fn=new WeakMap,Wt=new WeakSet,Bt=new AbortController;f=E(u,"ge-canvas");function X(e,t){Nn[e]||(Nn[e]=!0,U(t))}function m(e,t){return Dn(s,e,t)}function ho(e){s.locale=e,i.settings=_n(),Un(),Pr(),Dr(),Xn(),Gn(),or()}var qe=0,Kt=[];function ne(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:f,breakpoint:Tn(),source:"api"},n||{})}function R(e,t){var n=[e],r=e.replace(/^(before|after)-add-.+$/,"$1-add");r!==e&&n.push(r);var o=!1;return n.forEach(function(a){var l=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});f.dispatchEvent(l)||(o=!0)}),n.forEach(function(a){var l=s.callbacks[a.replace(/-/g,"_")];typeof l=="function"&&l(t)===!1&&(o=!0)}),!o}function Y(e){qe++;try{return e()}finally{if(qe--,qe===0)for(;Kt.length;)Kt.shift()()}}function Vt(e){if(qe===0){e();return}Kt.push(e)}function re(e,t,n,r){var o=bo(e);return Y(function(){var a=ne(e,t,r);return R("before-add-"+o,a)?(n(),ue(),R("after-add-"+o,a),t):null})}function bo(e){return _.containers[e]?"container":e}function wo(e,t){if(!s.confirm_delete){t();return}Hn(e,{danger:!0},function(n){n&&t()})}function Hn(e,t,n){t=t||{};var r=ct();if(!r){n(window.confirm(e));return}var o=yo(),a=!1,l=S(o,".ge-confirm-ok");Ae&&Ae(null);var d=function(c){Ae===d&&(Ae=null,n(c))};Ae=d,S(o,".modal-title").textContent=t.title||m("confirm.title"),S(o,".ge-confirm-cancel").textContent=t.cancel||m("confirm.cancel"),l.textContent=t.ok||m("confirm.ok"),z(l,"btn-danger",!!t.danger),z(l,"btn-primary",!t.danger),S(o,".ge-confirm-message").textContent=e,l.onclick=function(){a=!0,r.getInstance(o).hide()},he.hidden=function(){d(a)},he.shown=function(){l.focus()},r.getOrCreateInstance(o).show()}var he={hidden:null,shown:null},Ae=null;function yo(){if(N)return N;N=G('<div class="modal fade ge-confirm" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="modal-title"></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><p class="ge-confirm-message"></p></div><div class="modal-footer"><button type="button" class="btn btn-secondary ge-confirm-cancel" data-bs-dismiss="modal"></button><button type="button" class="btn btn-danger ge-confirm-ok"></button></div></div></div></div>'),document.body.appendChild(N),S(N,".modal-title").textContent=m("confirm.title"),S(N,".btn-close").setAttribute("aria-label",m("confirm.cancel")),S(N,".ge-confirm-cancel").textContent=m("confirm.cancel"),S(N,".ge-confirm-ok").textContent=m("confirm.ok"),Wn(N);var e=N;return N.addEventListener("hidden.bs.modal",function(){e===N&&he.hidden&&he.hidden()}),N.addEventListener("shown.bs.modal",function(){e===N&&he.shown&&he.shown()}),N}function Un(){N&&(he.hidden=null,he.shown=null,Gt(N),N=null,Ae&&Ae(null))}function Gt(e){var t=ct(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!qt.get(e)&&!y(e,"show")){o();return}e.addEventListener("hidden.bs.modal",o,{once:!0}),e.addEventListener("shown.bs.modal",function(){n.hide()},{once:!0}),n.hide()}var qt=new WeakMap;function Wn(e){ie(e,"show.bs.modal hide.bs.modal",function(){qt.set(e,!0)}),ie(e,"shown.bs.modal hidden.bs.modal",function(){qt.set(e,!1)})}function Oe(e,t,n,r){Y(function(){var o=ne(e,t,{source:"tool"});R("before-delete",o)&&wo(n,function(){Y(function(){r(function(){t.remove(),Y(function(){ue(),R("after-delete",o)})})})})})}function Xt(e,t,n){if(n=n||M,n!==$){var r=Q(n),o=kt({size:t,offset:xt(e,r)||0});return o.refused||Ue(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=w.some(function(g){return kt({size:t,offset:xt(e,g)||0}).refused});if(a)return null;var l=w[0],d=[],c=[];return w.slice(1).forEach(function(g){var h=Ue(e,g);h!==null&&(d.push({tier:g,size:null}),c.push({breakpoint:g.key,value:h}))}),Ue(e,l)!==t&&d.unshift({tier:l,size:t}),d.length?{writes:d,cleared:c,size:t}:null}function Yt(e,t){t.writes.forEach(function(n){_t(e,n.tier,n.size)}),We(e)}function Jt(e,t){return t&&(e.cleared=t),e}function $t(e,t,n,r){r=r||M;var o=Qe(e),a=Xt(e,t,r);return a?Y(function(){var l=ne("column",e,Jt({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return R("before-resize",l)?(Yt(e,a),de(e),R("after-resize",l),!0):(de(e),!1)}):!1}function Bn(e,t,n){var r=M===$,o=r?w[0]:Q(M),a=et(e);t=Math.min(Math.max(t,0),co);var l=r?w.slice(1).filter(function(d){return Et(e,d)!==null}):[];return(Et(e,o)||0)===t&&!l.length?!1:Y(function(){var d=ne("column",e,Jt({source:n,from:a,to:t},r?l.map(function(c){return{breakpoint:c.key,value:Et(e,c)}}):null));return R("before-indent",d)?(wn(e,o,t),l.forEach(function(c){wn(e,c,0)}),(r?w:[o]).forEach(function(c){var g=bn(e,c);if(q(g)){var h=kt({size:g,offset:t,leading:"offset"});h.size!==g&&_t(e,c,h.size)}}),de(e),R("after-indent",d),!0):!1})}function Qt(e){var t=e.parentElement;return{parent:t,index:V(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function se(e){var t=null;return Object.keys(O).forEach(function(n){var r=O[n];!t&&r.kindOf&&(t=r.kindOf(e))}),t||(e.getAttribute("data-ge-container")?e.getAttribute("data-ge-container"):y(e,"ge-tab")?"tab":y(e,"ge-accordion-item")?"accordion-item":y(e,"row")?"row":y(e,"column")?"column":y(e,"ge-element")?"element":(y(e,"ge-text-block")&&(e=L(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(s.source_textarea){var Xe=pe(s.source_textarea).value,Kn=v("div");Kn.innerHTML=Xe,Xe.length>0&&!Kn.querySelector(".row")&&(Xe='<div class="row"><div class="col-lg-12">'+Xe+"</div></div>"),it(u,Xe)}if(u.children.length&&!u.querySelector("div.row")){var Co=V(u),Vn=G('<div class="row"><div class="col-lg-12"></div></div>');u.appendChild(Vn),Co.forEach(function(e){Vn.firstChild.appendChild(e)})}function Eo(){Z=v("textarea",{class:"ge-html-output"}),f.parentNode.insertBefore(Z,f),Gn(),ki();var e={signal:Bt.signal};if(window.addEventListener("scroll",Io,e),Ve(f,"click",".ge-content",Fo,e),Ve(f,"click",".ge-popup-trigger, [data-ge-popup-target]",function(n){y(f,"ge-editing")&&n.preventDefault()},e),s.active_target){var t=null;f.addEventListener("pointerdown",function(n){t={x:n.clientX,y:n.clientY}},e),f.addEventListener("click",function(n){var r=t;if(t=null,!!y(f,"ge-editing")&&!(r&&Math.abs(n.clientX-r.x)+Math.abs(n.clientY-r.y)>s.drag.threshold)){var o=J(n.target,ir());if(o&&o===H&&(n.target===o||n.target===L(o,".ge-tools-drawer"))){Te(null);return}Te(o&&o!==f&&f.contains(o)?o:null)}},e),document.addEventListener("keydown",function(n){if(!(n.key!=="Escape"||!H||B||fe)){var r=document.activeElement;r&&(_e(r,"input, textarea, select")||r.isContentEditable)||Te(null)}},e)}}function xo(e){!_e(e,".ge-content")||!f.contains(e)||(oe("onContentReady",e),$e(e))}function Gn(){k=v("div",{class:"ge-mainControls"}),Z.parentNode.insertBefore(k,Z),b=k.appendChild(v("div",{class:"ge-wrapper ge-top"}));var e=s.toolbar_overflow!=="wrap",t=b;e&&(E(b,"ge-toolbar-menu"),t=b.appendChild(v("div",{class:"ge-toolbar-start"}))),le=[],j=t.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ae=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),s.new_row_layouts.forEach(function(c){var g=!Array.isArray(c),h=v("a",{class:"btn btn-sm btn-light",title:g?m("row.add_row_cols",{columns:c.columns,counts:Do(c.row_cols)}):m("row.add",{layout:c.join("-")}),"data-ge-toolbar":"row","data-ge-layout":g?JSON.stringify(c):c.join(",")});h.addEventListener("click",function(){if(H){rn(h,"tool");return}var P=Ye(c),St=re("row",P,function(){f.appendChild(P)},{parent:f,source:"tool"});St&&P.scrollIntoView&&P.scrollIntoView({behavior:"smooth"})}),j.appendChild(h),le.push({button:h,home:j,group:"rows"}),h.appendChild(G('<i class="bi bi-plus"></i>'));var C=g?No(c):c,A='<div class="row ge-row-icon">';C.forEach(function(P){A+='<div class="column '+je(w[0],P)+'"></div>'}),A+="</div>",h.appendChild(G(A))}),t.appendChild(ae),Object.keys(I).forEach(function(c){var g=I[c],h=Yn(v("a",{class:"btn btn-sm btn-light ge-add-container"}),m(g.labelKey),g.iconClass);Lt(h,{"data-ge-toolbar":"container","data-ge-container-type":c}),h.addEventListener("click",function(){if(H){rn(h,"tool");return}var C=Be(),A=C.appendChild(Ee(F)),P=A.appendChild(g.create({}));re(c,P,function(){f.appendChild(C)},{parent:f,source:"tool"})}),ae.appendChild(h),le.push({button:h,home:ae,group:qn(g.group)||"content"})});var n=[];Object.keys(O).forEach(function(c){(O[c].toolbar||[]).forEach(function(g,h){var C=So(c,g,h);g.align==="end"?n.push(C):(ae.appendChild(C),le.push({button:C,home:ae,group:qn(g.group)||c}))})}),De=G('<div class="dropdown pull-right ge-layout-mode"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown"></button><div class="dropdown-menu" role="menu"></div></div>'),Ve(De,"click","a",function(){eo(this.getAttribute("data-ge-view"))}),b.appendChild(De),s.layout_modes.forEach(function(c){S(De,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":c,title:m(dt(c))},m(dt(c))))}),S(De,"button").textContent=m(dt(M));var r=b.appendChild(v("div",{class:"btn-group pull-right"}));if(s.edit_source){var o=G('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');o.setAttribute("title",m("tool.edit_source")),z(o,"active btn-danger",ve),o.addEventListener("click",function(){ve?nn():Wo(),z(o,"active btn-danger",ve)}),r.appendChild(o)}var a=G('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),l=function(){y(a,"active")||E(f,"ge-editing")};if(a.setAttribute("title",m("tool.preview")),a.addEventListener("mouseenter",function(){T(f,"ge-editing")}),a.addEventListener("click",function(){z(a,"active btn-danger"),l()}),a.addEventListener("mouseleave",l),r.appendChild(a),n.length){var d=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));n.forEach(function(c){d.appendChild(c)})}s.toolbar_groups&&ko(t),e&&To(t),Mo()}var _o=[{name:"rows",labelKey:"group.rows"},{name:"content",labelKey:"group.content"},{name:"elements",labelKey:"group.elements"}];function qn(e){return typeof e=="string"&&e.trim()!==""?e:null}function ko(e){var t=_o.map(function(a){return a.name});if(le.forEach(function(a){t.indexOf(a.group)<0&&t.push(a.group)}),t=t.filter(function(a){return le.some(function(l){return l.group===a})}),t.length<2)return;var n=v("div",{class:"ge-toolbar-groups btn-group",role:"tablist","aria-label":m("group.select")});e.insertBefore(n,e.firstChild);var r=k.appendChild(v("div",{class:"ge-toolbar-stash",hidden:"hidden"}));t.forEach(function(a){var l=n.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary",role:"tab","data-ge-group":a},Ao(a)));l.addEventListener("click",function(){o(a)})}),o(t.indexOf(Ft)>=0?Ft:t[0]);function o(a){Ft=a,le.forEach(function(l){(l.group===a?l.home:r).appendChild(l.button)}),V(n).forEach(function(l){var d=l.getAttribute("data-ge-group")===a;z(l,"active",d),l.setAttribute("aria-selected",d?"true":"false")}),It()}}function Ao(e){var t="group."+e;if(Ca(s,t))return m(t);var n=le.filter(function(r){return r.group===e})[0];return n.button.getAttribute("title")||e}function Oo(){return le.filter(function(e){return!J(e.button,".ge-toolbar-stash")})}function Xn(){ft&&ft.abort(),ft=null,Nt=function(){},It=function(){},k.remove()}function To(e){var t=G('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-light"><i class="bi bi-three-dots"></i></button><div class="ge-toolbar-overflow"><div class="ge-addRowGroup btn-group"></div><div class="ge-addContainerGroup btn-group"></div></div></div>');e.parentNode.insertBefore(t,e.nextSibling);var n=S(t,"button"),r=S(t,".ge-toolbar-overflow"),o=x(r,".btn-group");function a(A){return A===j?o[0]:o[1]}n.setAttribute("title",m("tool.more")),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false");var l=ft=new AbortController,d={signal:l.signal};if(n.addEventListener("click",function(){h(!y(t,"ge-open"))}),r.addEventListener("click",function(A){J(A.target,"[data-ge-toolbar]")&&h(!1)}),document.addEventListener("pointerdown",function(A){t.contains(A.target)||h(!1)},d),document.addEventListener("keydown",function(A){A.key==="Escape"&&h(!1)},d),Nt=function(){h(!1)},It=C,C(),window.ResizeObserver){var c=!1,g=new window.ResizeObserver(function(){c||(c=!0,window.requestAnimationFrame(function(){c=!1,l.signal.aborted||C()}))});g.observe(b),g.observe(e),l.signal.addEventListener("abort",function(){g.disconnect()})}function h(A){A=A&&y(t,"ge-needed"),z(t,"ge-open",A),n.setAttribute("aria-expanded",A?"true":"false")}function C(){var A=Oo();if(A.forEach(function(no){no.home.appendChild(no.button)}),T(t,"ge-needed"),e.scrollWidth<=e.clientWidth){h(!1);return}E(t,"ge-needed");for(var P=A.length-1;P>=0&&e.scrollWidth>e.clientWidth;P--){var St=a(A[P].home);St.insertBefore(A[P].button,St.firstChild)}}}function Yn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(G('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function So(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||m(t.labelKey),a=t.align==="end"?"btn-primary":"btn-light",l=Yn(v("a",{class:"btn btn-sm "+a+" ge-add-container ge-add-feature"}),o,r);return E(l,t.className||""),Lt(l,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),l.addEventListener("click",function(){if(H){rn(l,t.source||"tool");return}var d=t.create();if(d){var c=t.inColumn?Zt(d):d,g=re(t.kind,d,function(){f.appendChild(c)},{parent:f,source:t.source||"tool"});g&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}}),l}function Lo(){return s.toolbar_drag==="auto"?s.drag_handle==="drawer":!!s.toolbar_drag}function Mo(){var e=x(k,"[data-ge-toolbar]");e.forEach(function(t){T(t,"ge-palette-button"),t.removeEventListener("pointerdown",Jn)}),Lo()&&e.forEach(function(t){E(t,"ge-palette-button"),t.addEventListener("pointerdown",Jn)})}function Jn(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(c){return Math.abs(c.pageX-n)+Math.abs(c.pageY-r)>s.drag.threshold}function l(c){if(!o){if(!a(c))return;o=E(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),Nt(),E(f,"ge-dropping")}ke(o,{left:c.pageX-14,top:c.pageY-14}),Po(c.pageX,c.pageY)}function d(c){if(document.removeEventListener("pointermove",l),Mn(document,"pointerup pointercancel",d),!!o){o.remove(),T(f,"ge-dropping"),en();var g=function(C){C.target!==t&&!t.contains(C.target)||(C.preventDefault(),C.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var h=$n(c.pageX,c.pageY);h&&Qn(t,h)}}document.addEventListener("pointermove",l),ie(document,"pointerup pointercancel",d)}function $n(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=J(o,[".column",".ge-canvas"].concat(At("regions")).join(", "));if(!a||a!==f&&!f.contains(a))return null;var l=null;return V(a,Cn()).forEach(function(d){if(!l){var c=d.getBoundingClientRect();r<c.top+c.height/2&&(l=d)}}),{region:a,before:l}}function zo(e,t,n){var r=O[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],o=r.create();if(!o)return null;var a=o;if(r.inColumn)_e(t.region,".column")||(a=Zt(o));else if(!En(t.region,o)){var l=t.region===f?[]:oo(t.region,f).reverse().concat([t.region]),d=l[0]||null;t={region:f,before:d?d.nextElementSibling:null}}return re(r.kind,o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:r.source||n||"dragdrop"})}function Zt(e){var t=Be();return t.appendChild(Ee(F)).appendChild(e),t}function Po(e,t){var n=$n(e,t);if(!n)return en();Ne||(Ne=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Ne,n.before):n.region.appendChild(Ne)}function en(){Ne&&Ne.remove()}function Qn(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return zo(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),a=r?I[o].create({}):Ro(e.getAttribute("data-ge-layout")),l=a;return r&&!_e(t.region,".column")&&(l=Zt(a)),re(r?o:"row",a,function(){t.before?t.before.parentNode.insertBefore(l,t.before):t.region.appendChild(l)},{parent:t.region,source:n||"dragdrop"})}function jo(){for(var e=[],t=1;t<=F;t++)e.push(String(t));return{name:"col",values:e.concat(Pn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return je(Q(n),tn(r))},choices:function(){return s.valid_col_sizes.map(String)},label:function(n){return n==="equal"?m("utility.col_equal"):n==="auto"?m("utility.col_auto"):n},write:function(n,r,o,a){return $t(n,r===null?null:tn(r),a,o)},blank:function(n,r){var o=r===$?null:Ct(n,Q(r));return o?m("utility.col_from_row",{count:Hr(o.value)}):null}}}function tn(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function Ro(e){return/^\s*\{/.test(e||"")?Ye(JSON.parse(e)):Ye((e||"").split(",").filter(function(t){return t!==""}).map(tn))}function Ye(e){var t=Be();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(Ee(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=Q(r);a&&Ge.indexOf(String(o))!==-1&&E(t,jn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(Ee(null));return t}function Do(e){return w.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function No(e){var t=1;return Object.keys(e.row_cols||{}).forEach(function(n){var r=e.row_cols[n];r!=="auto"&&(t=Math.max(t,parseInt(r,10)||1))}),Array.apply(null,Array(Math.min(t,e.columns||t))).map(function(){return"equal"})}function Io(){var e=window.pageYOffset;e>Pt(k).top&&e<Pt(f).top+io(f)?y(b,"ge-top")&&(ke(b,{left:Pt(b).left,width:st(b)}),T(b,"ge-top"),E(b,"ge-fixed")):y(b,"ge-fixed")&&(ke(b,{left:"",width:""}),T(b,"ge-fixed"),E(b,"ge-top"))}function Fo(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!ce()&&Mt(e)){var t=rr();t.length&&(t.length===1?Zn(e,t[0]):Ho(e,t))}}function Zn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):Y(function(){var n=ne("plain",e,{source:"tool",from:"plain",to:t.type});if(!R("before-convert",n))return!1;E(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(T(r,"ge-plain-block"),V(r,".ge-tools-drawer").forEach(function(o){o.remove()})),R("after-convert",n),t.edit(e),!0})}function Ho(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&er(L(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:m("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){Zn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function er(e,t,n,r){if(ce(),!!e){var o=J(e,".ge-tools-drawer");o&&E(o,"ge-picker-open"),te=e.appendChild(E(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var l=Lt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});l.setAttribute("title",a.title||a.label),l.textContent=a.label,l.addEventListener("click",function(d){d.preventDefault(),d.stopPropagation(),ce(),a.choose()}),te.appendChild(l)}),tr(r||e)}}function tr(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){te&&!te.matches(":hover")&&ce()},400)},{once:!0})}function nr(){var e={},t=[];return Object.keys(O).forEach(function(n){var r=O[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&X("text-type:"+o.type,'the "'+n+'" plugin declares the text type "'+o.type+'", which the "'+e[o.type]+'" plugin already declares: ignored');return}e[o.type]=n,t.push(o)})}),t}function rr(){return nr().filter(function(e){return e.offered!==!1})}function Uo(e){return nr().some(function(t){return t.type===e})}function or(){Se(),ue()}function Wo(){Se(),Te(null),Z.style.height=.8*document.documentElement.clientHeight+"px",Z.value=f.innerHTML,Pe(Z),ge(f),ve=!0,oe("onSourceOpen",Z)}function nn(){oe("onSourceClose",Z),ve=!1,it(f,Z.value),Pe(f),ue(),ge(Z)}function ir(){return[".column"].concat(At("regions")).join(", ")}function Bo(e){return!!e&&e!==f&&f.contains(e)&&_e(e,ir())}function Te(e){if(e!==H){var t=H;t&&T(t,"ge-active-target"),H=e,e&&y(f,"ge-editing")&&E(e,"ge-active-target"),R("target-change",{canvas:f,target:e,from:t})}}function rn(e,t){var n=Qn(e,{region:H,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function ue(){B&&!ze(B.node)&&Ce(),fe&&fe.home&&!ze(fe.home)&&me(),kn(!0),E(f,"ge-editing"),z(f,"ge-drag-drawer",s.drag_handle==="drawer"),Ri();var e=oa();ia(e),la(e),sa(),Ci(),Ei(),ci(),oe("onInit"),Wi(),Gi(),Zr(M),$e(f),H&&!f.contains(H)?Te(null):H&&E(H,"ge-active-target")}function Se(){Ce(),T(f,"ge-editing ge-drag-drawer ge-dropping"),H&&T(H,"ge-active-target"),oe("onBeforeDeinit"),ce(),en(),me(),ar(f),ht.clear(),Qr(f),oe("onDeinit"),vt(f),lr(f),fi(),ea(),Yi(),kn(!1,f)}function ar(e){x(e,".ge-tools-drawer").forEach(function(t){t.remove()})}function lr(e){x(e,"[data-ge-row-cols]").forEach(function(t){t.removeAttribute("data-ge-row-cols")})}function Ko(){var e=[];return[I,O,W].forEach(function(t){Object.keys(t).forEach(function(n){var r=t[n],o=r.unmark||r.onDeinit||r.onBeforeDeinit;o&&!r.cleanMarkup&&e.push(n)})}),e}function Vo(){for(var e=f.cloneNode(!0),t=new Map,n=new Map,r=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),a=r.currentNode,l=o.currentNode;a&&l;)t.set(l,a),n.set(a,l),a=r.nextNode(),l=o.nextNode();return{root:e,liveOf:function(d){return t.get(d)||null},copyOf:function(d){return n.get(d)||null}}}function sr(){if(ve)return Je();var e=Ko();if(e.length)return e.forEach(function(o){X("snapshot:"+o,'the "'+o+'" plugin has no cleanMarkup, so the canvas leaves editing to be read: open texts and settings panels close')}),Je();var t=Vo(),n=t.root;[n].concat(x(n,".ge-active-target, .ge-settings-target")).forEach(function(o){T(o,"ge-active-target ge-settings-target"),at(o)}),x(n,".ge-drop-marker").forEach(function(o){o.remove()}),ar(n),Qr(n);var r=null;return[I,O,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a];r||!l.cleanMarkup||l.cleanMarkup(n,t.liveOf)===!1&&(r=a)})}),r?(X("snapshot-refused:"+r,'the "'+r+'" plugin cannot take its marking off a copy right now, so the canvas leaves editing to be read'),Je()):(vt(n),lr(n),x(n,"[data-ge-container]").forEach(Cr),mt.forEach(function(o){var a=t.copyOf(o.el);a&&x(a,"[draggable]").forEach(function(l){l.removeAttribute("draggable")})}),Gr(n),kn(!1,n),We(n),n.innerHTML)}function Je(e){if(e&&e.keepEditing)return sr();Se(),We(f);var t=f.innerHTML;return ue(),t}function Go(e){Se(),We(e);var t=e.outerHTML;return ue(),t}function qo(e){return Rn(Je(e))}function Xo(e){ve&&(nn(),k&&x(k,".gm-edit-mode").forEach(function(t){T(t,"active btn-danger")})),Se(),it(f,e),ue()}function Yo(){oe("onDestroy"),ve&&nn(),Se(),H=null,Un(),Pr(),Dr(),Xn(),Z.remove(),Bt.abort(),Dt.delete(f),Ht=!0}function Jo(){var e=$o();an("grid",{},jo()),s.row_cols!==!1&&an("grid",{},Fi());var t=function(r){return!s.plugins||s.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(_.containers).forEach(function(r){t(r)&&(I[r]=_.containers[r](e))}),Object.keys(_.features).forEach(function(r){var o=_.features[r];n(r,o)&&(O[r]=o(e))}),Object.keys(_.utilities).forEach(function(r){t(r)&&(W[r]=_.utilities[r](e),(W[r].families||[]).forEach(function(o){an(r,W[r],o)}))}),Object.keys(O).forEach(function(r){var o=O[r].methods||{};Object.keys(o).forEach(function(a){Le[a]=o[a]})}),(s.plugins||[]).forEach(function(r){I[r]||O[r]||W[r]||X("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function oe(e,t){[I,O,W].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function $o(){return{canvas:f,settings:s,t:m,warn:U,containerId:ui,defaultRegion:di,createTool:D,createMoveTool:Me,addSettingsTool:nt,deleteNode:Oe,place:Tt,createPaneControls:gi,makeLabelEditable:pi,labelIn:vi,unwrapLabels:hi,suspendToggles:Er,resumeToggles:xr,emit:R,payloadFor:ne,operate:Y,kindOf:se,view:Tn,viewTiers:function(){return fo(M).map(function(e){return e.key})},breakpoints:w.map(function(e){return e.key}),getUtility:pr,setUtility:un,utilityField:si,bareStyle:ti,hostStyle:vr,setHostStyle:ai,openDialog:Rr,closeDialog:me,rowFromLayout:Ye,nodeHtml:Go,snapshotHtml:sr,setHtml:Xo,confirm:Hn,textReady:xo,attachPicker:kr,openPicker:er,closePicker:ce,detailsOf:Mr,drawerOf:Qo,toolbarItems:function(e){return k?x(k,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function Qo(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?L(t,".ge-tools-drawer"):null}return L(e,".ge-tools-drawer")}var be={},Zo=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ie="data-ge-preview",on=!1;function an(e,t,n){var r=n.name||n.prefix;if(be[r]){U('the "'+e+'" plugin declares the utility "'+r+'", which the "'+be[r].plugin+'" plugin already declared: ignored');return}be[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function pt(e,t){return be[e]?be[e].family:(X("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function ur(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!I[t]&&e.appliesTo.indexOf("container")!==-1}function dr(e){return Object.keys(be).map(function(t){return be[t].family}).filter(function(t){return ur(t,e)})}function ln(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function we(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(ln(t,n,t.values[o]))!==-1)return t.values[o];return null}function cr(e,t,n){for(var r=w.indexOf(n)-1;r>=0;r--){var o=we(e,t,w[r]);if(o!==null)return{tier:w[r],value:o}}return null}function fr(e,t,n){var r=we(e,t,n);if(r!==null)return r;var o=cr(e,t,n);return o?o.value:null}function sn(e,t){return w.map(function(n){return{tier:n,value:we(e,t,n)}}).filter(function(n){return n.value!==null})}function mr(e,t,n,r){t.values.forEach(function(o){T(e,ln(t,n,o))}),r!==null&&E(e,ln(t,n,r)),at(e)}function gr(e,t,n){return n===$?we(e,t,w[0]):fr(e,t,Q(n))}function ei(e,t,n,r){if(n!==$){var o=Q(n);return we(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],l=[];return sn(e,t).forEach(function(d){d.tier!==w[0]&&(a.push({tier:d.tier,value:null}),l.push({breakpoint:d.tier.key,value:d.value}))}),we(e,t,w[0])!==r&&a.unshift({tier:w[0],value:r}),a.length?{writes:a,cleared:l}:null}function pr(e,t,n){e=pe(e);var r=pt(t,"getUtility");if(!r||!e)return null;var o=n===void 0?M:On(n);return o===null?(U("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):gr(e,r,o)}function un(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=pe(e);var o=pt(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?M:On(r.view);if(a===null)return U("setUtility("+JSON.stringify(r.view)+"): no such layout mode"),!1;if(n=n==null||n===""?null:String(n),n!==null&&o.values.indexOf(n)===-1)return U("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var l=se(e);if(!ur(o,l))return U('setUtility: "'+t+'" does not apply to a '+l),!1;if(o.write)return o.write(e,n,a,r.source||"api");var d=ei(e,o,a,n);return d?Y(function(){var c=ne(l,e,{family:t,breakpoint:a,tiers:d.writes.map(function(g){return g.tier.key}),from:gr(e,o,a),to:n,cleared:d.cleared,source:r.source||"api"});return R("before-utility",c)?(d.writes.forEach(function(g){mr(e,o,g.tier,g.value)}),de(e),R("after-utility",c),!0):(de(e),!1)}):!1}function ti(e,t,n){var r=pt(t,"bareStyle");if(e=pe(e),!r||!e)return null;var o=e.getAttribute("class");w.forEach(function(l){mr(e,r,l,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function de(e){var t=Mr(e);if(t){var n=S(t,".ge-classes");n&&(n.value=gn(e).join(" ")),V(t,".ge-utilities").forEach(function(r){dn(r)})}br(e),$e(e)}function ni(e){return xe(e,Zo)}function $e(e){vt(e),M!==$&&ri(e,Q(M)),Ii(e),oe("onRefresh",e)}function ri(e,t){ni(e).forEach(function(n){var r=se(n),o={};dr(r).forEach(function(a){!a.preview||!sn(n,a).length||Object.assign(o,a.preview(fr(n,a,t),n,r))}),r==="column"&&Object.assign(o,Ni(n,t)),Object.keys(W).forEach(function(a){var l=W[a];l.preview&&Object.assign(o,l.preview(n,r,t.key))}),Object.keys(o).length&&oi(n,o)})}function oi(e,t){var n=e.style,r={};Object.keys(t).forEach(function(o){r[o]=[n.getPropertyValue(o),n.getPropertyPriority(o)],n.setProperty(o,String(t[o]),"important")}),e.setAttribute(Ie,JSON.stringify(r))}function vt(e){xe(e,"["+Ie+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ie))||{}}catch(o){}Object.keys(r).forEach(function(o){var a=r[o];a&&a[0]?n.setProperty(o,a[0],a[1]):n.removeProperty(o)}),t.removeAttribute(Ie),lt(t)})}function ii(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Ie))||{}}catch(r){}return Object.keys(n).forEach(function(r){var o=n[r];o&&o[0]?t.style.setProperty(r,o[0],o[1]):t.style.removeProperty(r)}),t.style}function vr(e,t){var n=ii(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function ai(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=vr(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var a=e.hasAttribute(Ie);return a&&vt(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),lt(e),a&&$e(e),!0}function li(e){var t=se(e),n=dr(t).filter(function(l){return l.panel!==!1}).map(function(l){return hr(e,l)});if(Object.keys(W).forEach(function(l){var d=W[l],c=d.panel?d.panel(e,t):null;c&&n.push(c)}),!n.length)return null;var r=z(v("div",{class:"ge-utilities"}),"ge-open",on);Fn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){on=!y(r,"ge-open"),zr().forEach(function(l){x(l,".ge-utilities").forEach(function(d){z(d,"ge-open",on)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(l){a.appendChild(l)}),dn(r),r}function hr(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?m(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){un(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function si(e,t){var n=pt(t,"utilityField");if(!n)return null;var r=hr(e,n);return cn(r,e),ht.set(r,e),r}var ht=new Map;function br(e){ht.forEach(function(t,n){if(!n.isConnected){ht.delete(n);return}e&&t!==e||J(n,".ge-utilities")||cn(n,t)})}function dn(e){var t=Fn.get(e);V(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(dt(M))})}),x(e,".ge-utility").forEach(function(n){cn(n,t)})}function cn(e,t){var n=be[e.getAttribute("data-ge-family")].family,r=L(e,"select"),o=n.choices?n.choices(t,se(t)):n.values,a,l,d="";if(r.innerHTML="",M===$){a=we(t,n,w[0]),l=m("utility.default");var c=sn(t,n).filter(function(P){return P.tier!==w[0]});c.length&&(d=m("utility.varies",{breakpoints:c.map(function(P){return P.tier.key}).join(", ")}))}else{var g=Q(M),h=cr(t,n,g);a=we(t,n,g),l=h?m("utility.inherit",{value:wr(n,h.value),breakpoint:h.tier.key}):m("utility.default");var C=n.blank?n.blank(t,M):null;C&&a===null&&(l=C)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},l)),o.forEach(function(P){r.appendChild(v("option",{value:P},wr(n,P)))}),r.value=a===null?"":a;var A=L(e,".ge-utility-note");A.textContent=d,Ln(A,d!=="")}function wr(e,t){return e.label?e.label(t):t}var I={},O={},W={},Le={},yr=0;function ui(e){return yr++,"ge-"+e+"-"+yr+"-"+Math.random().toString(36).slice(2,6)}function di(){var e=Be();return e.appendChild(Ee(F)),e}function Fe(e){return e?e.getAttribute("data-ge-container"):null}function ci(){x(f,"[data-ge-container]").forEach(function(e){var t=Fe(e),n=I[t];if(!n){X("container:"+t,'unknown container type "'+t+'"');return}E(e,"ge-container ge-container-"+t),n.mark(e),L(e,".ge-tools-drawer")||mi(e,t,n)})}function fi(){x(f,"[data-ge-container]").forEach(function(e){var t=I[Fe(e)];t&&t.unmark(e),Cr(e)})}function Cr(e){T(e,"ge-container ge-container-"+Fe(e)),at(e)}function He(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function bt(e,t){(t||[]).forEach(function(n){D(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function mi(e,t,n){var r=He(e,"ge-tools-drawer ge-container-drawer");Me(r),nt(r,e,s.container_classes),bt(r,s.container_tools),n.tools&&n.tools(r,e),D(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){Oe(t,e,m("confirm.delete_container"),function(o){ut(e,o)})}),n.addPane&&D(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});re(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function gi(e,t,n,r,o){var a=He(e,"ge-tools-drawer ge-pane-drawer");return Me(a),nt(a,e,s.pane_classes),bt(a,n),D(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){Oe(t,e,r,function(l){o(l)})}),a}function Er(e){e&&xe(e,"[data-bs-toggle], [data-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-bs-"+n);r!==null&&(t.setAttribute("data-ge-bs-"+n,r),t.removeAttribute("data-bs-"+n))})})}function xr(e){e&&xe(e,"[data-ge-bs-toggle], [data-ge-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-ge-bs-"+n);r!==null&&(t.setAttribute("data-bs-"+n,r),t.removeAttribute("data-ge-bs-"+n))})})}function pi(e){if(!Wt.has(e)){var t=J(e,"[data-bs-toggle], [data-ge-bs-toggle]");Wt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),Er(t),e.setAttribute("contenteditable","true"),e.focus(),window.getSelection().selectAllChildren(e)}),e.addEventListener("keydown",function(n){e.getAttribute("contenteditable")==="true"&&n.key==="Enter"&&(n.preventDefault(),e.blur())}),e.addEventListener("blur",function(){e.removeAttribute("contenteditable"),xr(t)})}}function vi(e){var t=L(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function hi(e){x(e,".ge-pane-label").forEach(function(t){Wt.delete(t),Rt(t)})}function _r(e,t){var n=Ee(t);return re("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function bi(e,t){!s.add_column.picker||!e||kr(e,function(){wi(e,t)})}function kr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ie(e,"mouseenter mousedown",function(){n||te||(n=window.setTimeout(function(){n=null,t()},s.add_column.delay))}),ie(e,"mouseleave mouseup",r)}function wi(e,t){ce();var n=yn(t,ye()),r=J(e,".ge-tools-drawer");r&&E(r,"ge-picker-open"),te=e.appendChild(v("div",{class:"ge-size-picker"})),s.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:yi(o)},q(o)?o:je(w[0],o));z(a,"ge-size-tight",q(o)&&o>n),z(a,"ge-size-flex",!q(o)),a.addEventListener("click",function(l){l.preventDefault(),l.stopPropagation(),ce(),_r(t,o)}),te.appendChild(a)}),tr(e)}function yi(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function ce(){if(!te)return!1;var e=J(te,".ge-tools-drawer");return e&&T(e,"ge-picker-open"),te.remove(),te=null,!0}function Ci(){x(f,".row").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Me(t),nt(t,e,s.row_classes),bt(t,s.row_tools),D(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){Oe("row",e,m("confirm.delete_row"),function(n){ut(e,n)})}),D(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){ce()||_r(e,rt(e,ye())?null:s.add_column.size)}),bi(L(t,".ge-add-column"),e)}})}function Ei(){x(f,".column").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Me(t),s.resize.tools!==!1&&(D(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){$t(e,n.shiftKey?tt(s.valid_col_sizes):wt(s.valid_col_sizes.filter(q),Ze(e),-1),"tool")}),D(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){$t(e,n.shiftKey?xi(e):wt(s.valid_col_sizes.filter(q),Ze(e),1),"tool")})),s.indent.tools!==!1&&(D(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){Bn(e,n.shiftKey?tt(s.valid_col_offsets):wt(s.valid_col_offsets,et(e),-1),"tool")}),D(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){Bn(e,n.shiftKey?_i(e):wt(s.valid_col_offsets,et(e),1),"tool")})),nt(t,e,s.col_classes),bt(t,s.col_tools),D(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){Oe("column",e,m("confirm.delete_column"),function(n){so(e,400,n,!0)})}),D(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Be();re("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function ye(){return M===$?w[w.length-1]:Q(M)}function Qe(e){var t=ye();if(Ct(e,t))return null;var n=bn(e,t);return n===null?F:n}function Ze(e){var t=Qe(e);if(q(t))return t;var n=Math.round(st(e)/Ar(e.parentElement)*F);return Math.min(Math.max(n,1),F)}function Ar(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function et(e){return xt(e,ye())||0}function wt(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,a){return Math.abs(a-t)<Math.abs(o-t)?a:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function tt(e){return e.filter(q).reduce(function(t,n){return Math.min(t,n)},F)}function fn(e){return e.filter(q).reduce(function(t,n){return Math.max(t,n)},0)}function xi(e){var t=yn(e.parentElement,ye(),e)-et(e);return Math.min(fn(s.valid_col_sizes),Math.max(t,1))}function _i(e){var t=yn(e.parentElement,ye(),e)-Ze(e);return Math.min(fn(s.valid_col_offsets),Math.max(t,0))}function Me(e){return s.drag_handle==="drawer"?null:D(e,m("tool.move"),"ge-move","bi bi-arrows-move")}var mn=".ge-tools-drawer:not(.ge-text-drawer):not(.ge-pane-drawer):not(.ge-code-inline)";function ki(){if(s.drawer_overflow==="wrap"||!window.ResizeObserver||!window.MutationObserver)return;var e=new Set,t=null;function n(l){e.add(l),t===null&&(t=window.requestAnimationFrame(r))}function r(){t=null;var l=Array.from(e);e.clear(),l.forEach(function(d){if(!d.isConnected){o.unobserve(d);return}Ai(d)})}var o=new window.ResizeObserver(function(l){l.forEach(function(d){n(d.target)})}),a=new window.MutationObserver(function(l){l.forEach(function(d){var c=d.target;if(d.type==="attributes"){var g=c.parentNode;g&&g.nodeType===1&&g.matches(mn)&&n(g);return}if(c.nodeType===1&&c.matches(mn)){n(c);return}d.addedNodes.forEach(function(h){h.nodeType===1&&xe(h,mn).forEach(function(C){E(C,"ge-drawer-fit"),o.observe(C),n(C)})})})});a.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),Bt.signal.addEventListener("abort",function(){a.disconnect(),o.disconnect(),t!==null&&window.cancelAnimationFrame(t)})}function Ai(e){var t=V(e,"a").filter(function(o){return!y(o,"ge-drawer-more")}),n=y(e,"ge-drawer-expanded");if(T(e,"ge-drawer-overflow ge-drawer-expanded"),t.forEach(function(o){T(o,"ge-tool-overflow")}),!!Or(e,t)){E(e,"ge-drawer-overflow"),L(e,".ge-drawer-more")||D(e,m("tool.more"),"ge-drawer-more","bi bi-three-dots",function(){z(e,"ge-drawer-expanded")});for(var r=t.length-1;r>=0&&Or(e,t);r--)E(t[r],"ge-tool-overflow");z(e,"ge-drawer-expanded",n)}}function Or(e,t){var n=window.getComputedStyle(e),r=e.getBoundingClientRect().right-parseFloat(n.borderRightWidth)-parseFloat(n.paddingRight);return t.some(function(o){var a=o.getClientRects();return a.length>0&&a[0].right>r+.5})}function D(e,t,n,r,o){var a=v("a",{title:t,class:n});return a.appendChild(v("i",{class:r})),e.appendChild(a),typeof o=="function"&&a.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(l){ie(a,l,o[l])}),a}function gn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!Oi(t)})}function Oi(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:w.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Ti(e,t){gn(e).forEach(function(n){T(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&E(e,n)}),at(e)}function nt(e,t,n){var r=Si(t,n||[]);In.set(t,r),D(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){Mi(t,r,this)});var o=se(t);return Object.keys(W).forEach(function(a){W[a].drawerTools&&W[a].drawerTools(e,t,o)}),Object.keys(O).forEach(function(a){O[a].drawerTools&&O[a].drawerTools(e,t,o)}),e.appendChild(r)}function Si(e,t){var n=v("div",{class:"ge-details"});n.appendChild(Tr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var h=v("label",{class:"ge-field"});return h.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(h)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});a.value=e.getAttribute("id")||"",o(m("panel.id")).appendChild(a),a.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var l=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});l.value=gn(e).join(" "),o(m("panel.classes")).appendChild(l),l.addEventListener("change",function(){Ti(e,this.value),de(e)});var d=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var h=y(e,g.cssClass),C=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:m("tool.toggle_class",{label:g.label}),"aria-pressed":h?"true":"false"});C.innerHTML=g.label,z(C,"active",h),C.addEventListener("click",function(){z(C,"active"),C.setAttribute("aria-pressed",y(C,"active")?"true":"false"),z(e,g.cssClass,y(C,"active")),de(e)}),d.appendChild(C)}),Li(e).forEach(function(g){n.appendChild(g)});var c=li(e);return c&&n.appendChild(c),n}function Tr(e){return v("h6",{class:"ge-section-title"},e)}function Li(e){var t=se(e),n=Lr(),r=[];return[I,O,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a],d=l.panelSection?l.panelSection(e,t):null;if(!(!d||!d.body)){var c=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")c.appendChild(Tr(m(d.labelKey))),c.appendChild(d.body);else{var g=m(d.labelKey),h=c.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},g));ge(d.body),c.appendChild(d.body),h.addEventListener("click",function(){Rr(d.titleKey?m(d.titleKey,{kind:Nr(e)}):g,d.body,h)})}r.push(c)}})}),r}var Sr=["offcanvas","popover","modal","inline"],K={},B=null,yt=new WeakMap;function Lr(){return Sr.indexOf(s.settings_panel)!==-1?s.settings_panel:(X("settings_panel",'settings_panel "'+s.settings_panel+'" is not one of '+Sr.join(", ")+": using offcanvas"),"offcanvas")}function Mr(e){return e&&In.get(e)||null}function zr(){return B&&B.mode!=="inline"?[f,B.details]:[f]}function Mi(e,t,n){var r=Lr();if(r==="inline"){Ln(t);return}var o=B&&B.details===t;Ce(),o||zi(r,e,t,n)}function zi(e,t,n,r){var o=Pi(e),a=new AbortController;B={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},S(o,".ge-settings-title").textContent=m("panel.title",{kind:Nr(t)}),S(o,".ge-settings-body").appendChild(n),Pe(n),E(t,"ge-settings-target");var l={signal:a.signal};if(document.addEventListener("keydown",function(c){c.key==="Escape"&&!fe&&Ce()},l),e==="offcanvas"){var d=window.innerWidth<576;z(o,"offcanvas-end",!d),z(o,"offcanvas-bottom",d),T(o,"hiding"),o.getBoundingClientRect(),E(o,"show")}else e==="popover"?(pn(o,r),ie(window,"scroll resize",function(){pn(o,r)},l),window.ResizeObserver&&(B.observer=new window.ResizeObserver(function(){pn(o,r)}),B.observer.observe(n)),ie(document,"mousedown touchstart",function(c){!fe&&!o.contains(c.target)&&!r.contains(c.target)&&Ce()},l)):vn(o,function(){B&&B.mode==="modal"&&Ce()})}function Ce(){me();var e=B;if(e){B=null;var t=K[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(T(t,"show"),E(t,"hiding"),window.setTimeout(function(){T(t,"hiding")},300)):e.mode==="popover"?ge(t):hn(t),T(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),lt(e.details),e.home&&ze(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.details,e.next):e.home.appendChild(e.details):e.details.remove()}}function Pi(e){if(K[e])return K[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":m("panel.close")})},n;return e==="offcanvas"?(n=G('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-offcanvas" tabindex="-1" role="dialog"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),S(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=G('<div class="popover bs-popover-bottom ge-settings-panel ge-settings-popover" role="dialog"><div class="popover-arrow"></div><div class="popover-header"><span class="ge-settings-title"></span></div><div class="popover-body ge-settings-body"></div></div>'),S(n,".popover-header").appendChild(t()),ge(n)):(n=G('<div class="modal fade ge-settings-panel ge-settings-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-settings-title"></h5></div><div class="modal-body ge-settings-body"></div><div class="modal-footer"></div></div></div></div>'),S(n,".modal-header").appendChild(t()),S(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),Ve(n,"click",".ge-settings-close",function(r){r.preventDefault(),Ce()}),K[e]=document.body.appendChild(n),n}function Pr(){Ce(),Object.keys(K).forEach(function(e){e==="modal"?Gt(K[e]):K[e].remove()}),Object.keys(K).forEach(function(e){jr(K[e])}),K={}}function pn(e,t){if(ze(t)){Pe(e);var n=t.getBoundingClientRect(),r=8,o=L(e,".popover-body");o.style.removeProperty("max-height");var a=st(e),l=zt(e),d=window.innerHeight-n.bottom-2*r,c=n.top-2*r,g=l<=d||d>=c,h=g?d:c;l>h&&(ke(o,{"max-height":Math.max(120,h-(l-zt(o)))}),l=zt(e));var C=g?n.bottom+r:n.top-r-l,A=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));z(e,"bs-popover-bottom",g),z(e,"bs-popover-top",!g),ke(e,{top:C+window.pageYOffset,left:A+window.pageXOffset}),ke(L(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-A-8,a-24))})}}function vn(e,t){var n=ct(),r=yt.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},yt.set(e,r)),r.dismissed=t,!n){r.backdrop||(r.backdrop=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),r.backdrop.addEventListener("click",function(){r.dismissed()}),document.body.appendChild(r.backdrop)),E(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var o=n.getOrCreateInstance(e);r.watched||(r.watched=!0,Wn(e),e.addEventListener("hide.bs.modal",function(){r.wanted==="open"&&(r.wanted="closed",r.busy=!0)}),e.addEventListener("shown.bs.modal",function(){r.busy=!1,r.wanted==="closed"&&hn(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?vn(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function hn(e){var t=ct(),n=yt.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),T(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function jr(e){var t=yt.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var ee=null,fe=null;function ji(){return ee||(ee=G('<div class="modal fade ge-dialog" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-dialog-title"></h5></div><div class="modal-body ge-dialog-body"></div><div class="modal-footer"></div></div></div></div>'),S(ee,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),S(ee,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),Ve(ee,"click",".ge-dialog-close",function(e){e.preventDefault(),me()}),document.body.appendChild(ee))}function Rr(e,t,n){me();var r=ji(),o=new AbortController;fe={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},S(r,".ge-dialog-title").textContent=e,S(r,".ge-dialog-body").appendChild(t),Pe(t),ct()||document.addEventListener("keydown",function(a){a.key==="Escape"&&me()},{signal:o.signal}),Object.keys(K).forEach(function(a){E(K[a],"ge-under-dialog")}),vn(r,function(){me()})}function me(){var e=fe;e&&(fe=null,e.listening.abort(),hn(ee),Object.keys(K).forEach(function(t){T(K[t],"ge-under-dialog")}),ge(e.body),e.home&&ze(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.body,e.next):e.home.appendChild(e.body):e.body.remove(),e.opener&&ze(e.opener)&&e.opener.focus&&e.opener.focus())}function Dr(){me(),ee&&(jr(ee),Gt(ee),ee=null)}function Nr(e){var t=se(e);if(I[t]&&I[t].labelKey)return m(I[t].labelKey);switch(t){case"row":return m("panel.kind_row");case"column":return m("panel.kind_column");case"text":return m("panel.kind_text");case"element":return m("panel.kind_element");case"section":return m("panel.kind_section");case"tab":return m("panel.kind_tab");case"accordion-item":return m("panel.kind_accordion_item");default:return t}}function Ri(){x(f,'.column, div[class*="col-"], div.col').forEach(function(e){E(e,"column"),!(Hi(e).length||Ir(e.parentElement))&&_t(e,w[0],F)})}function Ir(e){return y(e,"row")&&w.some(function(t){return Ge.some(function(n){return y(e,jn(t,n))})})}function rt(e,t){if(!y(e,"row"))return null;for(var n=w.indexOf(t);n>=0;n--)for(var r=0;r<Ge.length;r++)if(y(e,jn(w[n],Ge[r])))return{tier:n,value:Ge[r]};return null}function Fr(e,t){for(var n=w.indexOf(t);n>=0;n--){var r=Ue(e,w[n]);if(r!==null)return{tier:n,size:r}}return null}function Ct(e,t){var n=rt(e.parentElement,t);if(!n)return null;var r=Fr(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function Di(e){return e.value==="auto"?0:F/parseInt(e.value,10)}function Ni(e,t){var n=Ct(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:Ir(e.parentElement)&&!Fr(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function Ii(e){xe(e,".row").forEach(function(t){var n=s.row_cols===!1?null:M===$?rt(t,w[0])||null:rt(t,Q(M));n?t.setAttribute("data-ge-row-cols",Hr(n.value)):t.removeAttribute("data-ge-row-cols")})}function Hr(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function Fi(){return{name:"row-cols",prefix:"row-cols",values:Ge,appliesTo:["row"],labelKey:"utility.row_cols"}}function Ue(e,t){var n=Wr(e,t.colPrefix);return n!==null?n:y(e,je(t,"auto"))?"auto":y(e,je(t,"equal"))?"equal":null}function Et(e,t){return Wr(e,t.offsetPrefix)}function bn(e,t){return Ur(e,t,Ue)}function xt(e,t){return Ur(e,t,Et)}function Ur(e,t,n){for(var r=w.indexOf(t);r>=0;r--){var o=n(e,w[r]);if(o!==null)return o}return null}function Wr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function Br(e,t,n){var r=(e.getAttribute("class")||"").split(/\s+/).filter(function(o){return o!==""&&!new RegExp("^"+t+"\\d+$").test(o)});n!==null&&r.push(t+n),e.setAttribute("class",r.join(" "))}function _t(e,t,n){Br(e,t.colPrefix,null),Pn.forEach(function(r){T(e,je(t,r))}),n!=null&&E(e,je(t,n))}function wn(e,t,n){Br(e,t.offsetPrefix,n||null)}function Hi(e){return w.filter(function(t){return Ue(e,t)!==null})}function yn(e,t,n){var r=0;return V(e,".column").forEach(function(o){if(!(n&&o===n)){var a=Ct(o,t),l=a?Di(a):bn(o,t);r+=(q(l)?l:0)+(xt(o,t)||0)}}),F-r}function kt(e){var t=e.size===null||e.size===void 0?null:e.size,n=e.offset===null||e.offset===void 0?0:e.offset;return n=Math.min(Math.max(n,0),co),t===null||!q(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),F),t+n<=F?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:F-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function We(e){xe(e,".column").forEach(function(t){ke(t,{width:"",height:"",left:"",top:""}),lt(t)})}function Kr(e){return"ge-"+e+"-"+vo}function Cn(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(At("blocks")).join(", ")}function At(e){return Object.keys(O).map(function(t){return O[t][e]||null}).filter(function(t){return t!==null})}function En(e,t){var n=!0;return Object.keys(O).forEach(function(r){var o=O[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function Ui(){return s.drag_handle==="drawer"?".ge-tools-drawer > a:not(.ge-text-info):not(.ge-element-info), .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option"}function Ot(e,t){var n=go();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=s.drag_handle==="drawer",o=Ui(),a=0;e.forEach(function(l){var d=t.group?{name:Kr(t.group)}:{name:Kr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(d.put=function(c,g,h){return g.options.group.name===d.name&&t.accepts(c.el,h)}),mt.push(n.create(l,Object.assign({group:d,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(c,g){return J(c.target,o,l)?!0:!g||g.parentNode!==l},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:s.drag.animation,delay:s.drag.delay||s.drag.touch_delay,delayOnTouchOnly:!s.drag.delay,touchStartThreshold:s.drag.threshold,scroll:s.drag.scroll,onStart:Bi,onEnd:Vi},t.options||{})))})}}function Wi(){if(!go()){X("sortable_missing",m("error.sortable_missing"));return}Ot(x(f,".row"),{draggable:".column",group:"column"}),Ot([f].concat(x(f,".column")),{draggable:Cn(),group:"block",accepts:En});var e=At("regions");e.length&&Ot(x(f,e.join(", ")),{draggable:">"+Cn(),group:"block",accepts:En}),oe("onSortable",Ot)}function Bi(e){var t=e.item,n=Qt(t),r=Vr(t),o={from:n,canceled:!1};Ut.set(t,o),Y(function(){var a=R("before-move",ne(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function Vr(e){var t=y(e,"ge-text-block")&&L(e,".ge-content")||e;return{kind:se(t),node:t}}function Ki(e,t){var n=V(t.parent).filter(function(r){return r!==e&&!y(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function Vi(e){var t=e.item,n=Ut.get(t),r=n?n.from:Qt(t);if(Ut.delete(t),n&&n.canceled){Ki(t,r);return}var o=Qt(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=J(t,"[data-ge-container]"),l=I[Fe(a)];l&&l.afterPaneMove&&l.afterPaneMove(a,t,r);var d=Vr(t);Y(function(){R("after-move",ne(d.kind,d.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function Gi(){s.resize.enabled&&x(f,".column").forEach(function(e){if(!L(e,".ge-resize-handle")){var t=L(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),qi().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",Xi),e.appendChild(r)})}})}function qi(){return String(s.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function Xi(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=st(n);if(e.preventDefault(),!Ji(n))return;E(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function l(g){var h=g.pageX-o;return Math.max(1,a+(r?-h:h))}function d(g){n.style.width=l(g)+"px",$i(n,l(g))}function c(g){t.removeEventListener("pointermove",d),Mn(t,"pointerup pointercancel",c),T(n,"ge-resizing"),Qi(n,l(g))}t.addEventListener("pointermove",d),ie(t,"pointerup pointercancel",c)}function Yi(){Gr(f)}function Gr(e){x(e,".ge-resize-handle").forEach(function(t){t.remove()}),x(e,".ge-resize-size").forEach(function(t){t.remove()}),We(e)}function qr(e,t){var n=Math.round(t/Ar(e.parentElement)*F),r=Xr(e),o=r?Qe(r):null,a=gt.get(e),l=a?a.units:Ze(e),d=r&&q(o)?l+o-tt(s.valid_col_sizes):F-et(e);return Math.min(Math.max(n,tt(s.valid_col_sizes)),Math.max(d,tt(s.valid_col_sizes)),fn(s.valid_col_sizes))}function Xr(e){return s.resize.balance!=="next"?null:ro(e,".column")[0]||null}function xn(e,t){var n=L(e,".ge-tools-drawer"),r=n?L(n,".ge-resize-size"):null;r&&(r.textContent=t)}function Yr(e){return(M===$?w[0].colPrefix:ye().colPrefix)+e}function Ji(e){var t=Qe(e),n=Y(function(){return R("before-resize",ne("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ze(e)};return gt.set(e,r),xn(e,Yr(r.units)),!0}function $i(e,t){xn(e,Yr(qr(e,t)))}function Qi(e,t){var n=gt.get(e),r=qr(e,t);if(gt.delete(e),xn(e,""),We(e),!!n&&r!==n.units){var o=Xt(e,r);o&&Y(function(){Yt(e,o),Zi(e,r-n.units),de(e),R("after-resize",ne("column",e,Jt({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function Zi(e,t){var n=Xr(e);if(!(!n||!t)){var r=Qe(n);if(q(r)){var o=Xt(n,r-t);o&&(Yt(n,o),de(n))}}}function ea(){mt.forEach(function(e){e.destroy()}),mt=[]}function Be(){return v("div",{class:"row"})}function Tt(e,t,n){var r=null;if(ba.forEach(function(d){r===null&&n&&n[d]!==void 0&&(r=d)}),r===null)return e;var o=pe(n[r]);if(!o)return U(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,l=function(){return re(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):jt(e,o)},{parent:a,source:n.source||"api"})};return qe>0?(Vt(l),e):l()}function ta(e,t){var n=Be();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(U("createRow: the layout is an array of column sizes, as in [8, 4], or { row_cols, columns }. Making an empty row instead."),e=[]),e&&!Array.isArray(e)&&(n=Ye(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(Ee(r))}),Tt(n,"row",t)}function na(e,t){t=t||{};var n=pe(t.appendTo||t.prependTo||null);e===void 0&&n&&rt(n,ye())?e=null:!q(e)&&Pn.indexOf(e)===-1&&(U("createColumn: no column size given, using "+F),e=F);var r=Ee(e,t.offset);return t.content!==void 0&&r.appendChild(ca(t.content)),Tt(r,"column",t)}function ra(e,t){t=t||{};var n=I[e];return n?Tt(n.create(t),e,t):(U('createContainer: no such container type "'+e+'"'),null)}function Jr(e,t,n){e=pe(e),n=n||{};var r=I[Fe(e)];if(!r||Fe(e)!==t)return U("this is not a "+t+" container"),null;var o=r.addPane(e,n);return re(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function _n(){var e={};return Object.keys(s).forEach(function(t){var n=s[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function Ee(e,t){var n=v("div",{class:"column"}),r=fo(M)[0],o=kt({size:e,offset:t||0,leading:"offset"});return _t(n,r,o.size===null?e:o.size),wn(n,r,o.offset),n}function kn(e,t){if(!(!s.custom_filter||!s.custom_filter.length)){var n=typeof s.custom_filter=="string"||typeof s.custom_filter=="function"?[s.custom_filter]:s.custom_filter;Array.prototype.forEach.call(n,function(r){typeof r=="string"&&(r=window[r]),r(t||f,e)})}}function oa(){var e=[".row","[data-ge-container]"];return Object.keys(O).forEach(function(t){var n=O[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function ia(e){x(f,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!V(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=y(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(c){c.nodeType===1&&c.matches(e)?(o.push({text:a},{block:c}),a=[]):a.push(c)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var l=!1,d=r;o.forEach(function(c){var g;if(c.block)g=c.block;else if(aa(c.text))l?(g=An(n),c.text.forEach(function(h){g.appendChild(h)})):(c.text.forEach(function(h){t.appendChild(h)}),g=r,l=!0);else return;g!==d&&jt(g,d),d=g}),l||r.remove()}})}function aa(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function la(e){x(f,".column").forEach(function(t){var n=[];V(t).forEach(function(r){_e(r,".ge-tools-drawer, .ge-resize-handle")||(_e(r,".ge-content, .ge-text-block")||r.matches(e)?n=$r(n):n.push(r))}),$r(n)})}function $r(e){if(e.length){var t=jt(An(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function An(e){var t=v("div",{class:"ge-content"});return e&&(E(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function sa(){x(f,".column > .ge-content").forEach(function(e){ao(e,v("div",{class:"ge-text-block"}))}),x(f,".ge-text-block").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=L(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?Uo(n)||da(e,n):ua(e)}})}function Qr(e){x(e,".ge-text-block").forEach(function(t){Rt(t)})}function ua(e){var t=L(e,".ge-content"),n=He(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");E(e,"ge-plain-block"),Me(n),Object.keys(O).forEach(function(r){O[r].plainTools&&O[r].plainTools(n,t)}),D(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){Oe("plain",t,m("confirm.delete_plain"),function(r){ut(e,function(){e.remove(),r()})})})}function da(e,t){var n=L(e,".ge-content"),r=He(e,"ge-tools-drawer ge-text-drawer");Me(r),D(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),D(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){Oe("text",n,m("confirm.delete_text"),function(o){ut(e,function(){e.remove(),o()})})})}function ca(e){var t=rr(),n=An(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):it(n,e),n}function Zr(e){M=e,zn.forEach(function(t){z(f,"ge-layout-"+t,t===e)}),S(De,"button").textContent=m(dt(e))}function On(e){return zn.indexOf(e)===-1?null:e}function eo(e){var t=On(e);if(t===null){U("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=M;Zr(t),t!==n&&(zr().forEach(function(r){x(r,".ge-utilities").forEach(function(o){dn(o)})}),br(null),$e(f),oe("onViewChange",t),R("view-change",{canvas:f,breakpoint:t,from:n,to:t}))}function Tn(){return M}function to(e,t,n){return function(){return Le[e]?Le[e].apply(null,arguments):(X("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function fa(e){if(!s.active_target){X("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Te(null);return}var t=pe(e);if(!Bo(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Te(t)}var Sn={getHtml:Je,getPlainHtml:qo,init:function(){Vt(ue)},reset:function(){Vt(or)},deinit:Se,destroy:Yo,changeView:eo,getView:Tn,createRow:ta,createColumn:na,createText:function(e,t){return Le.createText?Le.createText(e,t):(X("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:to("createElement","elements","elements"),createSection:to("createSection","sections","sections"),createContainer:ra,addTab:function(e,t){return Jr(e,"tabs",t)},addAccordionItem:function(e,t){return Jr(e,"accordion",t)},setLocale:ho,getUtility:pr,setUtility:un,getActiveTarget:function(){return s.active_target?H:null},setActiveTarget:fa};Object.keys(Sn).forEach(function(e){var t=!!(uo[e]&&uo[e].value);i[e]=function(){if(Ht)return X("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?f.innerHTML:e==="getPlainHtml"?Rn(f.innerHTML):t?null:i;var n=Sn[e].apply(i,arguments);return t?n:i}}),i.canvas=f,i.settings=_n(),Dt.set(f,i),Jo(),i.settings=_n(),Object.keys(Le).forEach(function(e){Object.prototype.hasOwnProperty.call(Sn,e)||e in i||(i[e]=function(){return Ht?(X("destroyed:"+e,m("warning.destroyed",{method:e})),null):Le[e].apply(null,arguments)})}),Eo(),ue(),_._created.forEach(function(e){e(i)})}_._created=[];_.containers={};_.features={};_.utilities={};_.texts={};_.t=Dn;_._plainHtml=Rn;_.Sortable=null;_.bootstrap=null;_.version="8.6.0";_.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.delete_text":"Remove text","tool.delete_plain":"Remove content","tool.convert_type":"Edit as {editor} text","text.no_editor":'No text editor "{type}" is loaded: this text can be moved and deleted, not edited',"tool.add_column":`Add column
|
|
1
|
+
(()=>{function _(i,u){return i?Array.prototype.slice.call(i.querySelectorAll(u)):[]}function O(i,u){return i?i.querySelector(u):null}function xe(i,u){if(!i)return[];var p=_(i,u);return i.nodeType===1&&i.matches(u)&&p.unshift(i),p}function V(i,u){return i?Array.prototype.filter.call(i.children,function(p){return!u||p.matches(u)}):[]}function L(i,u){return V(i,u)[0]||null}function J(i,u,p){var s=i&&i.nodeType===1?i.closest(u):null;return s&&p&&s!==p&&!p.contains(s)?null:s}function _e(i,u){return!!i&&i.nodeType===1&&i.matches(u)}function ze(i){return!!i&&document.documentElement.contains(i)}function io(i,u){for(var p=[],s=i.nextElementSibling;s;s=s.nextElementSibling)(!u||s.matches(u))&&p.push(s);return p}function ao(i,u){for(var p=[],s=i.parentElement;s&&s!==u;s=s.parentElement)p.push(s);return p}function va(i){var u=document.createElement("template");return u.innerHTML=i,Array.prototype.slice.call(u.content.childNodes)}function G(i){for(var u=va(i.trim()),p=0;p<u.length;p++)if(u[p].nodeType===1)return u[p];return null}function v(i,u,p){var s=document.createElement(i);return Object.keys(u||{}).forEach(function(f){var x=u[f];x!=null&&x!==!1&&s.setAttribute(f,x)}),p!=null&&(s.textContent=p),s}function it(i,u){return i.innerHTML=u==null?"":String(u),i}function C(i,u){return Ke(u).forEach(function(p){i.classList.add(p)}),i}function T(i,u){return Ke(u).forEach(function(p){i.classList.remove(p)}),i}function z(i,u,p){return Ke(u).forEach(function(s){p===void 0?i.classList.toggle(s):i.classList.toggle(s,!!p)}),i}function y(i,u){return!!i&&i.nodeType===1&&i.classList.contains(u)}function Ke(i){return String(i||"").split(/\s+/).filter(Boolean)}function at(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function lt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function zt(i,u){return Object.keys(u).forEach(function(p){var s=u[p];s==null?i.removeAttribute(p):i.setAttribute(p,s)}),i}function ke(i,u){return Object.keys(u).forEach(function(p){var s=u[p];typeof s=="number"&&!ha[p]&&(s=s+"px"),i.style.setProperty(p,s==null?"":String(s))}),i}var ha={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},ot={};function ba(i){var u=i.nodeName;if(!ot[u]){var p=document.body.appendChild(document.createElement(u));ot[u]=getComputedStyle(p).display,p.remove(),ot[u]==="none"&&(ot[u]="block")}return ot[u]}function Pe(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=ba(i)),i}function ge(i){return i.style.display="none",i}function Pn(i,u){return u===void 0&&(u=!Pt(i)),u?Pe(i):ge(i)}function Pt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function st(i){return i.getBoundingClientRect().width}function jt(i){return i.getBoundingClientRect().height}function lo(i){var u=getComputedStyle(i);return i.clientHeight-parseFloat(u.paddingTop)-parseFloat(u.paddingBottom)}function Rt(i){var u=i.getBoundingClientRect();return{top:u.top+window.pageYOffset,left:u.left+window.pageXOffset}}function Dt(i,u){return u.parentNode.insertBefore(i,u.nextSibling),i}function Nt(i){for(var u=i.parentNode;i.firstChild;)u.insertBefore(i.firstChild,i);i.remove()}function so(i,u){return i.parentNode.insertBefore(u,i),u.appendChild(i),u}function Ve(i,u,p,s,f){var x=function(b){var j=J(b.target,p,i);if(j&&i.contains(j))return s.call(j,b)};return Ke(u).forEach(function(b){i.addEventListener(b,x,f)}),x}function ie(i,u,p,s){return Ke(u).forEach(function(f){i.addEventListener(f,p,s)}),p}function jn(i,u,p,s){Ke(u).forEach(function(f){i.removeEventListener(f,p,s)})}var wa=400;function uo(i,u,p,s){p=p===void 0?wa:p;var f=function(){ge(i),s&&s()};if(!Pt(i)||!i.animate||p<=0){window.setTimeout(f,0);return}var x=i.animate(u(getComputedStyle(i)),{duration:p,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,f())};x.onfinish=j,x.oncancel=j}function ut(i,u,p){typeof u=="function"&&(p=u,u=void 0),i.style.overflow="hidden",uo(i,function(s){return[{height:s.height,paddingTop:s.paddingTop,paddingBottom:s.paddingBottom,marginTop:s.marginTop,marginBottom:s.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},u,function(){i.style.removeProperty("overflow"),p&&p()})}function co(i,u,p,s){i.style.overflow="hidden",uo(i,function(f){var x={opacity:f.opacity,height:f.height},b={opacity:0,height:"0px"};return s&&(x.width=f.width,b.width="0px"),[x,b]},u,function(){i.style.removeProperty("overflow"),p&&p()})}var fo={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{}},Ca=["appendTo","prependTo","insertAfter","insertBefore"],w=[{key:"xs",infix:"",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",infix:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",infix:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",infix:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",infix:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",infix:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],$="all",Ea="view.all",Rn=[$].concat(w.map(function(i){return i.key})),F=12,mo=11,Dn=["equal","auto"],Ge=["1","2","3","4","5","6","auto"];function Nn(i,u){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+u}function q(i){return typeof i=="number"}function je(i,u){return u==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+u}function Q(i){for(var u=0;u<w.length;u++)if(w[u].key===i)return w[u];return null}function go(i){if(i===$)return[w[0]];var u=Q(i);return u?[u]:[]}function dt(i){var u=Q(i);return u?u.labelKey:Ea}var Re={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1,types:[]},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},po={},xa=0,It=new WeakMap;function Fn(i,u,p){var s=k.locales,f=s[i.locale]||{},x=i.locale_strings||{},b=x[u];return b===void 0&&(b=f[u]),b===void 0&&(b=s.en[u]),b===void 0&&(ka("locale:"+u,'no string for "'+u+'" in any locale, showing the key'),b=u),b.replace(/\{(\w+)\}/g,function(j,ae){return p&&p[ae]!==void 0?p[ae]:j})}function _a(i,u){var p=k.locales;return(i.locale_strings||{})[u]!==void 0||(p[i.locale]||{})[u]!==void 0||p.en[u]!==void 0}function U(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function ka(i,u){po[i]||(po[i]=!0,U(u))}function Aa(i,u){return Fn({locale:"en"},i,u)}function Oa(i){if(typeof i=="string"){var u=document.querySelector(i);if(!u)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return u}if(i&&i.nodeType===1)return i;throw new TypeError("grid-editor: the target is an element or a selector, not "+(i===null?"null":typeof i))}function pe(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function vo(){return k.Sortable||window.Sortable||null}function ct(){var i=k.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function In(i){var u=document.implementation.createHTMLDocument("").body;u.innerHTML=i;var p=[];return _(u,"*").forEach(function(s){var f=!1;Array.prototype.slice.call(s.attributes).forEach(function(j){j.name.indexOf("data-ge-")===0&&(s.removeAttribute(j.name),f=!0)});var x=(s.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=x.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==x.length&&(f=!0),b.length?s.setAttribute("class",b.join(" ")):s.removeAttribute("class"),f&&s.tagName==="DIV"&&!s.attributes.length&&p.push(s)}),p.forEach(function(s){Nt(s)}),u.innerHTML}function k(i,u){var p=Oa(i),s=It.get(p);if(s)return ho.has(p)||(ho.add(p),U(Aa("warning.already_editing"))),s;if(!(this instanceof k))return new k(p,u);Ta(this,p,u||{})}var ho=new WeakSet;k.create=function(i,u){return new k(i,u)};k.get=function(i){var u=pe(i);return u&&It.get(u)||null};function Ta(i,u,p){var s=Object.assign({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",toolbar_overflow:"menu",drawer_overflow:"menu",toolbar_groups:!1,active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Re.elements,custom_filter:"",valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12,"equal","auto"],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:Re.add_column,layout_modes:Rn.slice(),default_view:$,resize:Re.resize,indent:Re.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Re.drag},p);Object.keys(Re).forEach(function(e){s[e]=Object.assign({},Re[e],s[e])});var f,x,b,j,ae,De,Z,M=s.default_view,N=null,te=null,ve=!1,Ne=null,H=null,ft=null,Ft=function(){},Ht=function(){},le=[],mt={},Ut=null,Hn={},gt=[],bo=++xa,pt=!1,Un=new WeakMap,Wt=new WeakMap,vt=new WeakMap,Wn=new WeakMap,Bt=new WeakSet,Kt=new AbortController;f=C(u,"ge-canvas");function X(e,t){Hn[e]||(Hn[e]=!0,U(t))}function m(e,t){return Fn(s,e,t)}function wo(e){s.locale=e,i.settings=On(),Kn(),Rr(),Ir(),tn(),en(),ar()}var qe=0,Vt=[];function ne(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:f,breakpoint:Mn(),source:"api"},n||{})}function R(e,t){var n=[e],r=e.replace(/^(before|after)-add-.+$/,"$1-add");r!==e&&n.push(r);var o=!1;return n.forEach(function(a){var l=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});f.dispatchEvent(l)||(o=!0)}),n.forEach(function(a){var l=s.callbacks[a.replace(/-/g,"_")];typeof l=="function"&&l(t)===!1&&(o=!0)}),!o}function Y(e){qe++;try{return e()}finally{if(qe--,qe===0)for(;Vt.length;)Vt.shift()()}}function Gt(e){if(qe===0){e();return}Vt.push(e)}function re(e,t,n,r){var o=yo(e);return Y(function(){var a=ne(e,t,r);return R("before-add-"+o,a)?(n(),ue(),R("after-add-"+o,a),t):null})}function yo(e){return k.containers[e]?"container":e}function Co(e,t){if(!s.confirm_delete){t();return}Bn(e,{danger:!0},function(n){n&&t()})}function Bn(e,t,n){t=t||{};var r=ct();if(!r){n(window.confirm(e));return}var o=Eo(),a=!1,l=O(o,".ge-confirm-ok");Ae&&Ae(null);var d=function(c){Ae===d&&(Ae=null,n(c))};Ae=d,O(o,".modal-title").textContent=t.title||m("confirm.title"),O(o,".ge-confirm-cancel").textContent=t.cancel||m("confirm.cancel"),l.textContent=t.ok||m("confirm.ok"),z(l,"btn-danger",!!t.danger),z(l,"btn-primary",!t.danger),O(o,".ge-confirm-message").textContent=e,l.onclick=function(){a=!0,r.getInstance(o).hide()},he.hidden=function(){d(a)},he.shown=function(){l.focus()},r.getOrCreateInstance(o).show()}var he={hidden:null,shown:null},Ae=null;function Eo(){if(N)return N;N=G('<div class="modal fade ge-confirm" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="modal-title"></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><p class="ge-confirm-message"></p></div><div class="modal-footer"><button type="button" class="btn btn-secondary ge-confirm-cancel" data-bs-dismiss="modal"></button><button type="button" class="btn btn-danger ge-confirm-ok"></button></div></div></div></div>'),document.body.appendChild(N),O(N,".modal-title").textContent=m("confirm.title"),O(N,".btn-close").setAttribute("aria-label",m("confirm.cancel")),O(N,".ge-confirm-cancel").textContent=m("confirm.cancel"),O(N,".ge-confirm-ok").textContent=m("confirm.ok"),Vn(N);var e=N;return N.addEventListener("hidden.bs.modal",function(){e===N&&he.hidden&&he.hidden()}),N.addEventListener("shown.bs.modal",function(){e===N&&he.shown&&he.shown()}),N}function Kn(){N&&(he.hidden=null,he.shown=null,qt(N),N=null,Ae&&Ae(null))}function qt(e){var t=ct(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Xt.get(e)&&!y(e,"show")){o();return}e.addEventListener("hidden.bs.modal",o,{once:!0}),e.addEventListener("shown.bs.modal",function(){n.hide()},{once:!0}),n.hide()}var Xt=new WeakMap;function Vn(e){ie(e,"show.bs.modal hide.bs.modal",function(){Xt.set(e,!0)}),ie(e,"shown.bs.modal hidden.bs.modal",function(){Xt.set(e,!1)})}function Oe(e,t,n,r){Y(function(){var o=ne(e,t,{source:"tool"});R("before-delete",o)&&Co(n,function(){Y(function(){r(function(){t.remove(),Y(function(){ue(),R("after-delete",o)})})})})})}function Yt(e,t,n){if(n=n||M,n!==$){var r=Q(n),o=Ot({size:t,offset:kt(e,r)||0});return o.refused||Ue(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=w.some(function(g){return Ot({size:t,offset:kt(e,g)||0}).refused});if(a)return null;var l=w[0],d=[],c=[];return w.slice(1).forEach(function(g){var h=Ue(e,g);h!==null&&(d.push({tier:g,size:null}),c.push({breakpoint:g.key,value:h}))}),Ue(e,l)!==t&&d.unshift({tier:l,size:t}),d.length?{writes:d,cleared:c,size:t}:null}function Jt(e,t){t.writes.forEach(function(n){At(e,n.tier,n.size)}),We(e)}function $t(e,t){return t&&(e.cleared=t),e}function Qt(e,t,n,r){r=r||M;var o=Qe(e),a=Yt(e,t,r);return a?Y(function(){var l=ne("column",e,$t({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return R("before-resize",l)?(Jt(e,a),de(e),R("after-resize",l),!0):(de(e),!1)}):!1}function Gn(e,t,n){var r=M===$,o=r?w[0]:Q(M),a=et(e);t=Math.min(Math.max(t,0),mo);var l=r?w.slice(1).filter(function(d){return _t(e,d)!==null}):[];return(_t(e,o)||0)===t&&!l.length?!1:Y(function(){var d=ne("column",e,$t({source:n,from:a,to:t},r?l.map(function(c){return{breakpoint:c.key,value:_t(e,c)}}):null));return R("before-indent",d)?(En(e,o,t),l.forEach(function(c){En(e,c,0)}),(r?w:[o]).forEach(function(c){var g=Cn(e,c);if(q(g)){var h=Ot({size:g,offset:t,leading:"offset"});h.size!==g&&At(e,c,h.size)}}),de(e),R("after-indent",d),!0):!1})}function Zt(e){var t=e.parentElement;return{parent:t,index:V(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function se(e){var t=null;return Object.keys(S).forEach(function(n){var r=S[n];!t&&r.kindOf&&(t=r.kindOf(e))}),t||(e.getAttribute("data-ge-container")?e.getAttribute("data-ge-container"):y(e,"ge-tab")?"tab":y(e,"ge-accordion-item")?"accordion-item":y(e,"row")?"row":y(e,"column")?"column":y(e,"ge-element")?"element":(y(e,"ge-text-block")&&(e=L(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(s.source_textarea){var Xe=pe(s.source_textarea).value,qn=v("div");qn.innerHTML=Xe,Xe.length>0&&!qn.querySelector(".row")&&(Xe='<div class="row"><div class="col-lg-12">'+Xe+"</div></div>"),it(u,Xe)}if(u.children.length&&!u.querySelector("div.row")){var xo=V(u),Xn=G('<div class="row"><div class="col-lg-12"></div></div>');u.appendChild(Xn),xo.forEach(function(e){Xn.firstChild.appendChild(e)})}function _o(){Z=v("textarea",{class:"ge-html-output"}),f.parentNode.insertBefore(Z,f),en(),Ti();var e={signal:Kt.signal};if(window.addEventListener("scroll",er,e),Ve(f,"click",".ge-content",Wo,e),Ve(f,"click",".ge-popup-trigger, [data-ge-popup-target]",function(n){y(f,"ge-editing")&&n.preventDefault()},e),s.active_target){var t=null;f.addEventListener("pointerdown",function(n){t={x:n.clientX,y:n.clientY}},e),f.addEventListener("click",function(n){var r=t;if(t=null,!!y(f,"ge-editing")&&!(r&&Math.abs(n.clientX-r.x)+Math.abs(n.clientY-r.y)>s.drag.threshold)){var o=J(n.target,lr());if(o&&o===H&&(n.target===o||n.target===L(o,".ge-tools-drawer"))){Te(null);return}Te(o&&o!==f&&f.contains(o)?o:null)}},e),document.addEventListener("keydown",function(n){if(!(n.key!=="Escape"||!H||B||fe)){var r=document.activeElement;r&&(_e(r,"input, textarea, select")||r.isContentEditable)||Te(null)}},e)}}function ko(e){!_e(e,".ge-content")||!f.contains(e)||(oe("onContentReady",e),$e(e))}function en(){x=v("div",{class:"ge-mainControls"}),Z.parentNode.insertBefore(x,Z),b=x.appendChild(v("div",{class:"ge-wrapper ge-top"}));var e=s.toolbar_overflow!=="wrap",t=b;e&&(C(b,"ge-toolbar-menu"),t=b.appendChild(v("div",{class:"ge-toolbar-start"}))),le=[],j=t.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ae=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),s.new_row_layouts.forEach(function(c){var g=!Array.isArray(c),h=v("a",{class:"btn btn-sm btn-light",title:g?m("row.add_row_cols",{columns:c.columns,counts:Ho(c.row_cols)}):m("row.add",{layout:c.join("-")}),"data-ge-toolbar":"row","data-ge-layout":g?JSON.stringify(c):c.join(",")});h.addEventListener("click",function(){if(H){ln(h,"tool");return}var P=Ye(c),Mt=re("row",P,function(){f.appendChild(P)},{parent:f,source:"tool"});Mt&&P.scrollIntoView&&P.scrollIntoView({behavior:"smooth"})}),j.appendChild(h),le.push({button:h,home:j,group:"rows"}),h.appendChild(G('<i class="bi bi-plus"></i>'));var E=g?Uo(c):c,A='<div class="row ge-row-icon">';E.forEach(function(P){A+='<div class="column '+je(w[0],P)+'"></div>'}),A+="</div>",h.appendChild(G(A))}),t.appendChild(ae),Object.keys(I).forEach(function(c){var g=I[c],h=Jn(v("a",{class:"btn btn-sm btn-light ge-add-container"}),m(g.labelKey),g.iconClass);zt(h,{"data-ge-toolbar":"container","data-ge-container-type":c}),h.addEventListener("click",function(){if(H){ln(h,"tool");return}var E=Be(),A=E.appendChild(Ee(F)),P=A.appendChild(g.create({}));re(c,P,function(){f.appendChild(E)},{parent:f,source:"tool"})}),ae.appendChild(h),le.push({button:h,home:ae,group:Yn(g.group)||"content"})});var n=[];mt={},Object.keys(S).forEach(function(c){mt[c]=Lo(S[c]),mt[c].forEach(function(g,h){var E=Po(c,g,h);g.align==="end"?n.push(E):(ae.appendChild(E),le.push({button:E,home:ae,group:Yn(g.group)||c}))})}),De=G('<div class="dropdown pull-right ge-layout-mode"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown"></button><div class="dropdown-menu" role="menu"></div></div>'),Ve(De,"click","a",function(){no(this.getAttribute("data-ge-view"))}),b.appendChild(De),s.layout_modes.forEach(function(c){O(De,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":c,title:m(dt(c))},m(dt(c))))}),O(De,"button").textContent=m(dt(M));var r=b.appendChild(v("div",{class:"btn-group pull-right"}));if(s.edit_source){var o=G('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');o.setAttribute("title",m("tool.edit_source")),z(o,"active btn-danger",ve),o.addEventListener("click",function(){ve?an():Vo(),z(o,"active btn-danger",ve)}),r.appendChild(o)}var a=G('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),l=function(){y(a,"active")||C(f,"ge-editing")};if(a.setAttribute("title",m("tool.preview")),a.addEventListener("mouseenter",function(){T(f,"ge-editing")}),a.addEventListener("click",function(){z(a,"active btn-danger"),l()}),a.addEventListener("mouseleave",l),r.appendChild(a),n.length){var d=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));n.forEach(function(c){d.appendChild(c)})}s.toolbar_groups&&Oo(t),e&&zo(t),Ro()}var Ao=[{name:"rows",labelKey:"group.rows"},{name:"content",labelKey:"group.content"},{name:"elements",labelKey:"group.elements"}];function Yn(e){return typeof e=="string"&&e.trim()!==""?e:null}function Oo(e){var t=Ao.map(function(a){return a.name});if(le.forEach(function(a){t.indexOf(a.group)<0&&t.push(a.group)}),t=t.filter(function(a){return le.some(function(l){return l.group===a})}),t.length<2)return;var n=v("div",{class:"ge-toolbar-groups btn-group",role:"tablist","aria-label":m("group.select")});e.insertBefore(n,e.firstChild);var r=x.appendChild(v("div",{class:"ge-toolbar-stash",hidden:"hidden"}));t.forEach(function(a){var l=n.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary",role:"tab","data-ge-group":a},To(a)));l.addEventListener("click",function(){o(a)})}),o(t.indexOf(Ut)>=0?Ut:t[0]);function o(a){Ut=a,le.forEach(function(l){(l.group===a?l.home:r).appendChild(l.button)}),V(n).forEach(function(l){var d=l.getAttribute("data-ge-group")===a;z(l,"active",d),l.setAttribute("aria-selected",d?"true":"false")}),Ht()}}function To(e){var t="group."+e;if(_a(s,t))return m(t);var n=le.filter(function(r){return r.group===e})[0];return n.button.getAttribute("title")||e}function So(){return le.filter(function(e){return!J(e.button,".ge-toolbar-stash")})}function Lo(e){var t=typeof e.toolbar=="function"?e.toolbar():e.toolbar;return Array.isArray(t)?t:[]}function Mo(){if(!(!x||pt)){var e=!!O(x,".gm-preview.active");tn(),en(),e&&C(O(x,".gm-preview"),"active btn-danger"),er()}}function tn(){ft&&ft.abort(),ft=null,Ft=function(){},Ht=function(){},x.remove()}function zo(e){var t=G('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-light"><i class="bi bi-three-dots"></i></button><div class="ge-toolbar-overflow"><div class="ge-addRowGroup btn-group"></div><div class="ge-addContainerGroup btn-group"></div></div></div>');e.parentNode.insertBefore(t,e.nextSibling);var n=O(t,"button"),r=O(t,".ge-toolbar-overflow"),o=_(r,".btn-group");function a(A){return A===j?o[0]:o[1]}n.setAttribute("title",m("tool.more")),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false");var l=ft=new AbortController,d={signal:l.signal};if(n.addEventListener("click",function(){h(!y(t,"ge-open"))}),r.addEventListener("click",function(A){J(A.target,"[data-ge-toolbar]")&&h(!1)}),document.addEventListener("pointerdown",function(A){t.contains(A.target)||h(!1)},d),document.addEventListener("keydown",function(A){A.key==="Escape"&&h(!1)},d),Ft=function(){h(!1)},Ht=E,E(),window.ResizeObserver){var c=!1,g=new window.ResizeObserver(function(){c||(c=!0,window.requestAnimationFrame(function(){c=!1,l.signal.aborted||E()}))});g.observe(b),g.observe(e),l.signal.addEventListener("abort",function(){g.disconnect()})}function h(A){A=A&&y(t,"ge-needed"),z(t,"ge-open",A),n.setAttribute("aria-expanded",A?"true":"false")}function E(){var A=So();if(A.forEach(function(oo){oo.home.appendChild(oo.button)}),T(t,"ge-needed"),e.scrollWidth<=e.clientWidth){h(!1);return}C(t,"ge-needed");for(var P=A.length-1;P>=0&&e.scrollWidth>e.clientWidth;P--){var Mt=a(A[P].home);Mt.insertBefore(A[P].button,Mt.firstChild)}}}function Jn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(G('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function Po(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||m(t.labelKey),a=t.align==="end"?"btn-primary":"btn-light",l=Jn(v("a",{class:"btn btn-sm "+a+" ge-add-container ge-add-feature"}),o,r);return C(l,t.className||""),zt(l,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),l.addEventListener("click",function(){if(H){ln(l,t.source||"tool");return}var d=t.create();if(d){var c=t.inColumn?nn(d):d,g=re(t.kind,d,function(){f.appendChild(c)},{parent:f,source:t.source||"tool"});g&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}}),l}function jo(){return s.toolbar_drag==="auto"?s.drag_handle==="drawer":!!s.toolbar_drag}function Ro(){var e=_(x,"[data-ge-toolbar]");e.forEach(function(t){T(t,"ge-palette-button"),t.removeEventListener("pointerdown",$n)}),jo()&&e.forEach(function(t){C(t,"ge-palette-button"),t.addEventListener("pointerdown",$n)})}function $n(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(c){return Math.abs(c.pageX-n)+Math.abs(c.pageY-r)>s.drag.threshold}function l(c){if(!o){if(!a(c))return;o=C(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),Ft(),C(f,"ge-dropping")}ke(o,{left:c.pageX-14,top:c.pageY-14}),No(c.pageX,c.pageY)}function d(c){if(document.removeEventListener("pointermove",l),jn(document,"pointerup pointercancel",d),!!o){o.remove(),T(f,"ge-dropping"),rn();var g=function(E){E.target!==t&&!t.contains(E.target)||(E.preventDefault(),E.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var h=Qn(c.pageX,c.pageY);h&&Zn(t,h)}}document.addEventListener("pointermove",l),ie(document,"pointerup pointercancel",d)}function Qn(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=J(o,[".column",".ge-canvas"].concat(Tt("regions")).join(", "));if(!a||a!==f&&!f.contains(a))return null;var l=null;return V(a,_n()).forEach(function(d){if(!l){var c=d.getBoundingClientRect();r<c.top+c.height/2&&(l=d)}}),{region:a,before:l}}function Do(e,t,n){var r=(mt[e.getAttribute("data-ge-feature")]||[])[parseInt(e.getAttribute("data-ge-item"),10)];if(!r)return null;var o=r.create();if(!o)return null;var a=o;if(r.inColumn)_e(t.region,".column")||(a=nn(o));else if(!kn(t.region,o)){var l=t.region===f?[]:ao(t.region,f).reverse().concat([t.region]),d=l[0]||null;t={region:f,before:d?d.nextElementSibling:null}}return re(r.kind,o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:r.source||n||"dragdrop"})}function nn(e){var t=Be();return t.appendChild(Ee(F)).appendChild(e),t}function No(e,t){var n=Qn(e,t);if(!n)return rn();Ne||(Ne=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Ne,n.before):n.region.appendChild(Ne)}function rn(){Ne&&Ne.remove()}function Zn(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return Do(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),a=r?I[o].create({}):Fo(e.getAttribute("data-ge-layout")),l=a;return r&&!_e(t.region,".column")&&(l=nn(a)),re(r?o:"row",a,function(){t.before?t.before.parentNode.insertBefore(l,t.before):t.region.appendChild(l)},{parent:t.region,source:n||"dragdrop"})}function Io(){for(var e=[],t=1;t<=F;t++)e.push(String(t));return{name:"col",values:e.concat(Dn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return je(Q(n),on(r))},choices:function(){return s.valid_col_sizes.map(String)},label:function(n){return n==="equal"?m("utility.col_equal"):n==="auto"?m("utility.col_auto"):n},write:function(n,r,o,a){return Qt(n,r===null?null:on(r),a,o)},blank:function(n,r){var o=r===$?null:xt(n,Q(r));return o?m("utility.col_from_row",{count:Wr(o.value)}):null}}}function on(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function Fo(e){return/^\s*\{/.test(e||"")?Ye(JSON.parse(e)):Ye((e||"").split(",").filter(function(t){return t!==""}).map(on))}function Ye(e){var t=Be();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(Ee(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=Q(r);a&&Ge.indexOf(String(o))!==-1&&C(t,Nn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(Ee(null));return t}function Ho(e){return w.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function Uo(e){var t=1;return Object.keys(e.row_cols||{}).forEach(function(n){var r=e.row_cols[n];r!=="auto"&&(t=Math.max(t,parseInt(r,10)||1))}),Array.apply(null,Array(Math.min(t,e.columns||t))).map(function(){return"equal"})}function er(){var e=window.pageYOffset;e>Rt(x).top&&e<Rt(f).top+lo(f)?y(b,"ge-top")&&(ke(b,{left:Rt(b).left,width:st(b)}),T(b,"ge-top"),C(b,"ge-fixed")):y(b,"ge-fixed")&&(ke(b,{left:"",width:""}),T(b,"ge-fixed"),C(b,"ge-top"))}function Wo(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!ce()&&Pt(e)){var t=ir();t.length&&(t.length===1?tr(e,t[0]):Bo(e,t))}}function tr(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):Y(function(){var n=ne("plain",e,{source:"tool",from:"plain",to:t.type});if(!R("before-convert",n))return!1;C(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(T(r,"ge-plain-block"),V(r,".ge-tools-drawer").forEach(function(o){o.remove()})),R("after-convert",n),t.edit(e),!0})}function Bo(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&nr(L(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:m("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){tr(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function nr(e,t,n,r){if(ce(),!!e){var o=J(e,".ge-tools-drawer");o&&C(o,"ge-picker-open"),te=e.appendChild(C(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var l=zt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});l.setAttribute("title",a.title||a.label),l.textContent=a.label,l.addEventListener("click",function(d){d.preventDefault(),d.stopPropagation(),ce(),a.choose()}),te.appendChild(l)}),rr(r||e)}}function rr(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){te&&!te.matches(":hover")&&ce()},400)},{once:!0})}function or(){var e={},t=[];return Object.keys(S).forEach(function(n){var r=S[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&X("text-type:"+o.type,'the "'+n+'" plugin declares the text type "'+o.type+'", which the "'+e[o.type]+'" plugin already declares: ignored');return}e[o.type]=n,t.push(o)})}),t}function ir(){return or().filter(function(e){return e.offered!==!1})}function Ko(e){return or().some(function(t){return t.type===e})}function ar(){Se(),ue()}function Vo(){Se(),Te(null),Z.style.height=.8*document.documentElement.clientHeight+"px",Z.value=f.innerHTML,Pe(Z),ge(f),ve=!0,oe("onSourceOpen",Z)}function an(){oe("onSourceClose",Z),ve=!1,it(f,Z.value),Pe(f),ue(),ge(Z)}function lr(){return[".column"].concat(Tt("regions")).join(", ")}function Go(e){return!!e&&e!==f&&f.contains(e)&&_e(e,lr())}function Te(e){if(e!==H){var t=H;t&&T(t,"ge-active-target"),H=e,e&&y(f,"ge-editing")&&C(e,"ge-active-target"),R("target-change",{canvas:f,target:e,from:t})}}function ln(e,t){var n=Zn(e,{region:H,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function ue(){B&&!ze(B.node)&&Ce(),fe&&fe.home&&!ze(fe.home)&&me(),Tn(!0),C(f,"ge-editing"),z(f,"ge-drag-drawer",s.drag_handle==="drawer"),Ii();var e=la();sa(e),da(e),ca(),_i(),ki(),gi(),oe("onInit"),Vi(),Yi(),to(M),$e(f),H&&!f.contains(H)?Te(null):H&&C(H,"ge-active-target")}function Se(){Ce(),T(f,"ge-editing ge-drag-drawer ge-dropping"),H&&T(H,"ge-active-target"),oe("onBeforeDeinit"),ce(),rn(),me(),sr(f),wt.clear(),eo(f),oe("onDeinit"),bt(f),ur(f),pi(),ra(),Qi(),Tn(!1,f)}function sr(e){_(e,".ge-tools-drawer").forEach(function(t){t.remove()})}function ur(e){_(e,"[data-ge-row-cols]").forEach(function(t){t.removeAttribute("data-ge-row-cols")})}function qo(){var e=[];return[I,S,W].forEach(function(t){Object.keys(t).forEach(function(n){var r=t[n],o=r.unmark||r.onDeinit||r.onBeforeDeinit;o&&!r.cleanMarkup&&e.push(n)})}),e}function Xo(){for(var e=f.cloneNode(!0),t=new Map,n=new Map,r=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),a=r.currentNode,l=o.currentNode;a&&l;)t.set(l,a),n.set(a,l),a=r.nextNode(),l=o.nextNode();return{root:e,liveOf:function(d){return t.get(d)||null},copyOf:function(d){return n.get(d)||null}}}function dr(){if(ve)return Je();var e=qo();if(e.length)return e.forEach(function(o){X("snapshot:"+o,'the "'+o+'" plugin has no cleanMarkup, so the canvas leaves editing to be read: open texts and settings panels close')}),Je();var t=Xo(),n=t.root;[n].concat(_(n,".ge-active-target, .ge-settings-target")).forEach(function(o){T(o,"ge-active-target ge-settings-target"),at(o)}),_(n,".ge-drop-marker").forEach(function(o){o.remove()}),sr(n),eo(n);var r=null;return[I,S,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a];r||!l.cleanMarkup||l.cleanMarkup(n,t.liveOf)===!1&&(r=a)})}),r?(X("snapshot-refused:"+r,'the "'+r+'" plugin cannot take its marking off a copy right now, so the canvas leaves editing to be read'),Je()):(bt(n),ur(n),_(n,"[data-ge-container]").forEach(xr),gt.forEach(function(o){var a=t.copyOf(o.el);a&&_(a,"[draggable]").forEach(function(l){l.removeAttribute("draggable")})}),Xr(n),Tn(!1,n),We(n),n.innerHTML)}function Je(e){if(e&&e.keepEditing)return dr();Se(),We(f);var t=f.innerHTML;return ue(),t}function Yo(e){Se(),We(e);var t=e.outerHTML;return ue(),t}function Jo(e){return In(Je(e))}function $o(e){ve&&(an(),x&&_(x,".gm-edit-mode").forEach(function(t){T(t,"active btn-danger")})),Se(),it(f,e),ue()}function Qo(){oe("onDestroy"),ve&&an(),Se(),H=null,Kn(),Rr(),Ir(),tn(),Z.remove(),Kt.abort(),It.delete(f),pt=!0}function Zo(){var e=ei();un("grid",{},Io()),s.row_cols!==!1&&un("grid",{},Wi());var t=function(r){return!s.plugins||s.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(k.containers).forEach(function(r){t(r)&&(I[r]=k.containers[r](e))}),Object.keys(k.features).forEach(function(r){var o=k.features[r];n(r,o)&&(S[r]=o(e))}),Object.keys(k.utilities).forEach(function(r){t(r)&&(W[r]=k.utilities[r](e),(W[r].families||[]).forEach(function(o){un(r,W[r],o)}))}),Object.keys(S).forEach(function(r){var o=S[r].methods||{};Object.keys(o).forEach(function(a){Le[a]=o[a]})}),(s.plugins||[]).forEach(function(r){I[r]||S[r]||W[r]||X("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function oe(e,t){[I,S,W].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function ei(){return{canvas:f,settings:s,t:m,warn:U,containerId:fi,defaultRegion:mi,createTool:D,createMoveTool:Me,addSettingsTool:nt,deleteNode:Oe,place:Lt,createPaneControls:hi,makeLabelEditable:bi,labelIn:wi,unwrapLabels:yi,suspendToggles:_r,resumeToggles:kr,emit:R,payloadFor:ne,operate:Y,kindOf:se,view:Mn,viewTiers:function(){return go(M).map(function(e){return e.key})},breakpoints:w.map(function(e){return e.key}),getUtility:hr,setUtility:fn,utilityField:ci,bareStyle:oi,hostStyle:br,setHostStyle:ui,openDialog:Nr,closeDialog:me,rowFromLayout:Ye,nodeHtml:Yo,snapshotHtml:dr,setHtml:$o,confirm:Bn,textReady:ko,attachPicker:Or,openPicker:nr,closePicker:ce,detailsOf:Pr,drawerOf:ti,refreshToolbar:Mo,toolbarItems:function(e){return x?_(x,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function ti(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?L(t,".ge-tools-drawer"):null}return L(e,".ge-tools-drawer")}var be={},ni=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ie="data-ge-preview",sn=!1;function un(e,t,n){var r=n.name||n.prefix;if(be[r]){U('the "'+e+'" plugin declares the utility "'+r+'", which the "'+be[r].plugin+'" plugin already declared: ignored');return}be[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function ht(e,t){return be[e]?be[e].family:(X("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function cr(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!I[t]&&e.appliesTo.indexOf("container")!==-1}function fr(e){return Object.keys(be).map(function(t){return be[t].family}).filter(function(t){return cr(t,e)})}function dn(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function we(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(dn(t,n,t.values[o]))!==-1)return t.values[o];return null}function mr(e,t,n){for(var r=w.indexOf(n)-1;r>=0;r--){var o=we(e,t,w[r]);if(o!==null)return{tier:w[r],value:o}}return null}function gr(e,t,n){var r=we(e,t,n);if(r!==null)return r;var o=mr(e,t,n);return o?o.value:null}function cn(e,t){return w.map(function(n){return{tier:n,value:we(e,t,n)}}).filter(function(n){return n.value!==null})}function pr(e,t,n,r){t.values.forEach(function(o){T(e,dn(t,n,o))}),r!==null&&C(e,dn(t,n,r)),at(e)}function vr(e,t,n){return n===$?we(e,t,w[0]):gr(e,t,Q(n))}function ri(e,t,n,r){if(n!==$){var o=Q(n);return we(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],l=[];return cn(e,t).forEach(function(d){d.tier!==w[0]&&(a.push({tier:d.tier,value:null}),l.push({breakpoint:d.tier.key,value:d.value}))}),we(e,t,w[0])!==r&&a.unshift({tier:w[0],value:r}),a.length?{writes:a,cleared:l}:null}function hr(e,t,n){e=pe(e);var r=ht(t,"getUtility");if(!r||!e)return null;var o=n===void 0?M:Ln(n);return o===null?(U("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):vr(e,r,o)}function fn(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=pe(e);var o=ht(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?M:Ln(r.view);if(a===null)return U("setUtility("+JSON.stringify(r.view)+"): no such layout mode"),!1;if(n=n==null||n===""?null:String(n),n!==null&&o.values.indexOf(n)===-1)return U("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var l=se(e);if(!cr(o,l))return U('setUtility: "'+t+'" does not apply to a '+l),!1;if(o.write)return o.write(e,n,a,r.source||"api");var d=ri(e,o,a,n);return d?Y(function(){var c=ne(l,e,{family:t,breakpoint:a,tiers:d.writes.map(function(g){return g.tier.key}),from:vr(e,o,a),to:n,cleared:d.cleared,source:r.source||"api"});return R("before-utility",c)?(d.writes.forEach(function(g){pr(e,o,g.tier,g.value)}),de(e),R("after-utility",c),!0):(de(e),!1)}):!1}function oi(e,t,n){var r=ht(t,"bareStyle");if(e=pe(e),!r||!e)return null;var o=e.getAttribute("class");w.forEach(function(l){pr(e,r,l,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function de(e){var t=Pr(e);if(t){var n=O(t,".ge-classes");n&&(n.value=hn(e).join(" ")),V(t,".ge-utilities").forEach(function(r){mn(r)})}yr(e),$e(e)}function ii(e){return xe(e,ni)}function $e(e){bt(e),M!==$&&ai(e,Q(M)),Ui(e),oe("onRefresh",e)}function ai(e,t){ii(e).forEach(function(n){var r=se(n),o={};fr(r).forEach(function(a){!a.preview||!cn(n,a).length||Object.assign(o,a.preview(gr(n,a,t),n,r))}),r==="column"&&Object.assign(o,Hi(n,t)),Object.keys(W).forEach(function(a){var l=W[a];l.preview&&Object.assign(o,l.preview(n,r,t.key))}),Object.keys(o).length&&li(n,o)})}function li(e,t){var n=e.style,r={};Object.keys(t).forEach(function(o){r[o]=[n.getPropertyValue(o),n.getPropertyPriority(o)],n.setProperty(o,String(t[o]),"important")}),e.setAttribute(Ie,JSON.stringify(r))}function bt(e){xe(e,"["+Ie+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ie))||{}}catch(o){}Object.keys(r).forEach(function(o){var a=r[o];a&&a[0]?n.setProperty(o,a[0],a[1]):n.removeProperty(o)}),t.removeAttribute(Ie),lt(t)})}function si(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Ie))||{}}catch(r){}return Object.keys(n).forEach(function(r){var o=n[r];o&&o[0]?t.style.setProperty(r,o[0],o[1]):t.style.removeProperty(r)}),t.style}function br(e,t){var n=si(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function ui(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=br(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var a=e.hasAttribute(Ie);return a&&bt(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),lt(e),a&&$e(e),!0}function di(e){var t=se(e),n=fr(t).filter(function(l){return l.panel!==!1}).map(function(l){return wr(e,l)});if(Object.keys(W).forEach(function(l){var d=W[l],c=d.panel?d.panel(e,t):null;c&&n.push(c)}),!n.length)return null;var r=z(v("div",{class:"ge-utilities"}),"ge-open",sn);Wn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){sn=!y(r,"ge-open"),jr().forEach(function(l){_(l,".ge-utilities").forEach(function(d){z(d,"ge-open",sn)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(l){a.appendChild(l)}),mn(r),r}function wr(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?m(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){fn(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function ci(e,t){var n=ht(t,"utilityField");if(!n)return null;var r=wr(e,n);return gn(r,e),wt.set(r,e),r}var wt=new Map;function yr(e){wt.forEach(function(t,n){if(!n.isConnected){wt.delete(n);return}e&&t!==e||J(n,".ge-utilities")||gn(n,t)})}function mn(e){var t=Wn.get(e);V(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(dt(M))})}),_(e,".ge-utility").forEach(function(n){gn(n,t)})}function gn(e,t){var n=be[e.getAttribute("data-ge-family")].family,r=L(e,"select"),o=n.choices?n.choices(t,se(t)):n.values,a,l,d="";if(r.innerHTML="",M===$){a=we(t,n,w[0]),l=m("utility.default");var c=cn(t,n).filter(function(P){return P.tier!==w[0]});c.length&&(d=m("utility.varies",{breakpoints:c.map(function(P){return P.tier.key}).join(", ")}))}else{var g=Q(M),h=mr(t,n,g);a=we(t,n,g),l=h?m("utility.inherit",{value:Cr(n,h.value),breakpoint:h.tier.key}):m("utility.default");var E=n.blank?n.blank(t,M):null;E&&a===null&&(l=E)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},l)),o.forEach(function(P){r.appendChild(v("option",{value:P},Cr(n,P)))}),r.value=a===null?"":a;var A=L(e,".ge-utility-note");A.textContent=d,Pn(A,d!=="")}function Cr(e,t){return e.label?e.label(t):t}var I={},S={},W={},Le={},Er=0;function fi(e){return Er++,"ge-"+e+"-"+Er+"-"+Math.random().toString(36).slice(2,6)}function mi(){var e=Be();return e.appendChild(Ee(F)),e}function Fe(e){return e?e.getAttribute("data-ge-container"):null}function gi(){_(f,"[data-ge-container]").forEach(function(e){var t=Fe(e),n=I[t];if(!n){X("container:"+t,'unknown container type "'+t+'"');return}C(e,"ge-container ge-container-"+t),n.mark(e),L(e,".ge-tools-drawer")||vi(e,t,n)})}function pi(){_(f,"[data-ge-container]").forEach(function(e){var t=I[Fe(e)];t&&t.unmark(e),xr(e)})}function xr(e){T(e,"ge-container ge-container-"+Fe(e)),at(e)}function He(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function yt(e,t){(t||[]).forEach(function(n){D(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function vi(e,t,n){var r=He(e,"ge-tools-drawer ge-container-drawer");Me(r),nt(r,e,s.container_classes),yt(r,s.container_tools),n.tools&&n.tools(r,e),D(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){Oe(t,e,m("confirm.delete_container"),function(o){ut(e,o)})}),n.addPane&&D(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});re(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function hi(e,t,n,r,o){var a=He(e,"ge-tools-drawer ge-pane-drawer");return Me(a),nt(a,e,s.pane_classes),yt(a,n),D(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){Oe(t,e,r,function(l){o(l)})}),a}function _r(e){e&&xe(e,"[data-bs-toggle], [data-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-bs-"+n);r!==null&&(t.setAttribute("data-ge-bs-"+n,r),t.removeAttribute("data-bs-"+n))})})}function kr(e){e&&xe(e,"[data-ge-bs-toggle], [data-ge-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-ge-bs-"+n);r!==null&&(t.setAttribute("data-bs-"+n,r),t.removeAttribute("data-ge-bs-"+n))})})}function bi(e){if(!Bt.has(e)){var t=J(e,"[data-bs-toggle], [data-ge-bs-toggle]");Bt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),_r(t),e.setAttribute("contenteditable","true"),e.focus(),window.getSelection().selectAllChildren(e)}),e.addEventListener("keydown",function(n){e.getAttribute("contenteditable")==="true"&&n.key==="Enter"&&(n.preventDefault(),e.blur())}),e.addEventListener("blur",function(){e.removeAttribute("contenteditable"),kr(t)})}}function wi(e){var t=L(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function yi(e){_(e,".ge-pane-label").forEach(function(t){Bt.delete(t),Nt(t)})}function Ar(e,t){var n=Ee(t);return re("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Ci(e,t){!s.add_column.picker||!e||Or(e,function(){Ei(e,t)})}function Or(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ie(e,"mouseenter mousedown",function(){n||te||(n=window.setTimeout(function(){n=null,t()},s.add_column.delay))}),ie(e,"mouseleave mouseup",r)}function Ei(e,t){ce();var n=xn(t,ye()),r=J(e,".ge-tools-drawer");r&&C(r,"ge-picker-open"),te=e.appendChild(v("div",{class:"ge-size-picker"})),s.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:xi(o)},q(o)?o:je(w[0],o));z(a,"ge-size-tight",q(o)&&o>n),z(a,"ge-size-flex",!q(o)),a.addEventListener("click",function(l){l.preventDefault(),l.stopPropagation(),ce(),Ar(t,o)}),te.appendChild(a)}),rr(e)}function xi(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function ce(){if(!te)return!1;var e=J(te,".ge-tools-drawer");return e&&T(e,"ge-picker-open"),te.remove(),te=null,!0}function _i(){_(f,".row").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Me(t),nt(t,e,s.row_classes),yt(t,s.row_tools),D(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){Oe("row",e,m("confirm.delete_row"),function(n){ut(e,n)})}),D(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){ce()||Ar(e,rt(e,ye())?null:s.add_column.size)}),Ci(L(t,".ge-add-column"),e)}})}function ki(){_(f,".column").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Me(t),s.resize.tools!==!1&&(D(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){Qt(e,n.shiftKey?tt(s.valid_col_sizes):Ct(s.valid_col_sizes.filter(q),Ze(e),-1),"tool")}),D(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){Qt(e,n.shiftKey?Ai(e):Ct(s.valid_col_sizes.filter(q),Ze(e),1),"tool")})),s.indent.tools!==!1&&(D(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){Gn(e,n.shiftKey?tt(s.valid_col_offsets):Ct(s.valid_col_offsets,et(e),-1),"tool")}),D(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){Gn(e,n.shiftKey?Oi(e):Ct(s.valid_col_offsets,et(e),1),"tool")})),nt(t,e,s.col_classes),yt(t,s.col_tools),D(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){Oe("column",e,m("confirm.delete_column"),function(n){co(e,400,n,!0)})}),D(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Be();re("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function ye(){return M===$?w[w.length-1]:Q(M)}function Qe(e){var t=ye();if(xt(e,t))return null;var n=Cn(e,t);return n===null?F:n}function Ze(e){var t=Qe(e);if(q(t))return t;var n=Math.round(st(e)/Tr(e.parentElement)*F);return Math.min(Math.max(n,1),F)}function Tr(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function et(e){return kt(e,ye())||0}function Ct(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,a){return Math.abs(a-t)<Math.abs(o-t)?a:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function tt(e){return e.filter(q).reduce(function(t,n){return Math.min(t,n)},F)}function pn(e){return e.filter(q).reduce(function(t,n){return Math.max(t,n)},0)}function Ai(e){var t=xn(e.parentElement,ye(),e)-et(e);return Math.min(pn(s.valid_col_sizes),Math.max(t,1))}function Oi(e){var t=xn(e.parentElement,ye(),e)-Ze(e);return Math.min(pn(s.valid_col_offsets),Math.max(t,0))}function Me(e){return s.drag_handle==="drawer"?null:D(e,m("tool.move"),"ge-move","bi bi-arrows-move")}var vn=".ge-tools-drawer:not(.ge-text-drawer):not(.ge-pane-drawer):not(.ge-code-inline)";function Ti(){if(s.drawer_overflow==="wrap"||!window.ResizeObserver||!window.MutationObserver)return;var e=new Set,t=null;function n(l){e.add(l),t===null&&(t=window.requestAnimationFrame(r))}function r(){t=null;var l=Array.from(e);e.clear(),l.forEach(function(d){if(!d.isConnected){o.unobserve(d);return}Si(d)})}var o=new window.ResizeObserver(function(l){l.forEach(function(d){n(d.target)})}),a=new window.MutationObserver(function(l){l.forEach(function(d){var c=d.target;if(d.type==="attributes"){var g=c.parentNode;g&&g.nodeType===1&&g.matches(vn)&&n(g);return}if(c.nodeType===1&&c.matches(vn)){n(c);return}d.addedNodes.forEach(function(h){h.nodeType===1&&xe(h,vn).forEach(function(E){C(E,"ge-drawer-fit"),o.observe(E),n(E)})})})});a.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),Kt.signal.addEventListener("abort",function(){a.disconnect(),o.disconnect(),t!==null&&window.cancelAnimationFrame(t)})}function Si(e){var t=V(e,"a").filter(function(o){return!y(o,"ge-drawer-more")}),n=y(e,"ge-drawer-expanded");if(T(e,"ge-drawer-overflow ge-drawer-expanded"),t.forEach(function(o){T(o,"ge-tool-overflow")}),!!Sr(e,t)){C(e,"ge-drawer-overflow"),L(e,".ge-drawer-more")||D(e,m("tool.more"),"ge-drawer-more","bi bi-three-dots",function(){z(e,"ge-drawer-expanded")});for(var r=t.length-1;r>=0&&Sr(e,t);r--)C(t[r],"ge-tool-overflow");z(e,"ge-drawer-expanded",n)}}function Sr(e,t){var n=window.getComputedStyle(e),r=e.getBoundingClientRect().right-parseFloat(n.borderRightWidth)-parseFloat(n.paddingRight);return t.some(function(o){var a=o.getClientRects();return a.length>0&&a[0].right>r+.5})}function D(e,t,n,r,o){var a=v("a",{title:t,class:n});return a.appendChild(v("i",{class:r})),e.appendChild(a),typeof o=="function"&&a.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(l){ie(a,l,o[l])}),a}function hn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!Li(t)})}function Li(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:w.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Mi(e,t){hn(e).forEach(function(n){T(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&C(e,n)}),at(e)}function nt(e,t,n){var r=zi(t,n||[]);Un.set(t,r),D(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){ji(t,r,this)});var o=se(t);return Object.keys(W).forEach(function(a){W[a].drawerTools&&W[a].drawerTools(e,t,o)}),Object.keys(S).forEach(function(a){S[a].drawerTools&&S[a].drawerTools(e,t,o)}),e.appendChild(r)}function zi(e,t){var n=v("div",{class:"ge-details"});n.appendChild(Lr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var h=v("label",{class:"ge-field"});return h.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(h)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});a.value=e.getAttribute("id")||"",o(m("panel.id")).appendChild(a),a.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var l=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});l.value=hn(e).join(" "),o(m("panel.classes")).appendChild(l),l.addEventListener("change",function(){Mi(e,this.value),de(e)});var d=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var h=y(e,g.cssClass),E=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:m("tool.toggle_class",{label:g.label}),"aria-pressed":h?"true":"false"});E.innerHTML=g.label,z(E,"active",h),E.addEventListener("click",function(){z(E,"active"),E.setAttribute("aria-pressed",y(E,"active")?"true":"false"),z(e,g.cssClass,y(E,"active")),de(e)}),d.appendChild(E)}),Pi(e).forEach(function(g){n.appendChild(g)});var c=di(e);return c&&n.appendChild(c),n}function Lr(e){return v("h6",{class:"ge-section-title"},e)}function Pi(e){var t=se(e),n=zr(),r=[];return[I,S,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a],d=l.panelSection?l.panelSection(e,t):null;if(!(!d||!d.body)){var c=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")c.appendChild(Lr(m(d.labelKey))),c.appendChild(d.body);else{var g=m(d.labelKey),h=c.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},g));ge(d.body),c.appendChild(d.body),h.addEventListener("click",function(){Nr(d.titleKey?m(d.titleKey,{kind:Fr(e)}):g,d.body,h)})}r.push(c)}})}),r}var Mr=["offcanvas","popover","modal","inline"],K={},B=null,Et=new WeakMap;function zr(){return Mr.indexOf(s.settings_panel)!==-1?s.settings_panel:(X("settings_panel",'settings_panel "'+s.settings_panel+'" is not one of '+Mr.join(", ")+": using offcanvas"),"offcanvas")}function Pr(e){return e&&Un.get(e)||null}function jr(){return B&&B.mode!=="inline"?[f,B.details]:[f]}function ji(e,t,n){var r=zr();if(r==="inline"){Pn(t);return}var o=B&&B.details===t;Ce(),o||Ri(r,e,t,n)}function Ri(e,t,n,r){var o=Di(e),a=new AbortController;B={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},O(o,".ge-settings-title").textContent=m("panel.title",{kind:Fr(t)}),O(o,".ge-settings-body").appendChild(n),Pe(n),C(t,"ge-settings-target");var l={signal:a.signal};if(document.addEventListener("keydown",function(c){c.key==="Escape"&&!fe&&Ce()},l),e==="offcanvas"){var d=window.innerWidth<576;z(o,"offcanvas-end",!d),z(o,"offcanvas-bottom",d),T(o,"hiding"),o.getBoundingClientRect(),C(o,"show")}else e==="popover"?(bn(o,r),ie(window,"scroll resize",function(){bn(o,r)},l),window.ResizeObserver&&(B.observer=new window.ResizeObserver(function(){bn(o,r)}),B.observer.observe(n)),ie(document,"mousedown touchstart",function(c){!fe&&!o.contains(c.target)&&!r.contains(c.target)&&Ce()},l)):wn(o,function(){B&&B.mode==="modal"&&Ce()})}function Ce(){me();var e=B;if(e){B=null;var t=K[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(T(t,"show"),C(t,"hiding"),window.setTimeout(function(){T(t,"hiding")},300)):e.mode==="popover"?ge(t):yn(t),T(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),lt(e.details),e.home&&ze(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.details,e.next):e.home.appendChild(e.details):e.details.remove()}}function Di(e){if(K[e])return K[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":m("panel.close")})},n;return e==="offcanvas"?(n=G('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-offcanvas" tabindex="-1" role="dialog"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),O(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=G('<div class="popover bs-popover-bottom ge-settings-panel ge-settings-popover" role="dialog"><div class="popover-arrow"></div><div class="popover-header"><span class="ge-settings-title"></span></div><div class="popover-body ge-settings-body"></div></div>'),O(n,".popover-header").appendChild(t()),ge(n)):(n=G('<div class="modal fade ge-settings-panel ge-settings-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-settings-title"></h5></div><div class="modal-body ge-settings-body"></div><div class="modal-footer"></div></div></div></div>'),O(n,".modal-header").appendChild(t()),O(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),Ve(n,"click",".ge-settings-close",function(r){r.preventDefault(),Ce()}),K[e]=document.body.appendChild(n),n}function Rr(){Ce(),Object.keys(K).forEach(function(e){e==="modal"?qt(K[e]):K[e].remove()}),Object.keys(K).forEach(function(e){Dr(K[e])}),K={}}function bn(e,t){if(ze(t)){Pe(e);var n=t.getBoundingClientRect(),r=8,o=L(e,".popover-body");o.style.removeProperty("max-height");var a=st(e),l=jt(e),d=window.innerHeight-n.bottom-2*r,c=n.top-2*r,g=l<=d||d>=c,h=g?d:c;l>h&&(ke(o,{"max-height":Math.max(120,h-(l-jt(o)))}),l=jt(e));var E=g?n.bottom+r:n.top-r-l,A=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));z(e,"bs-popover-bottom",g),z(e,"bs-popover-top",!g),ke(e,{top:E+window.pageYOffset,left:A+window.pageXOffset}),ke(L(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-A-8,a-24))})}}function wn(e,t){var n=ct(),r=Et.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},Et.set(e,r)),r.dismissed=t,!n){r.backdrop||(r.backdrop=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),r.backdrop.addEventListener("click",function(){r.dismissed()}),document.body.appendChild(r.backdrop)),C(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var o=n.getOrCreateInstance(e);r.watched||(r.watched=!0,Vn(e),e.addEventListener("hide.bs.modal",function(){r.wanted==="open"&&(r.wanted="closed",r.busy=!0)}),e.addEventListener("shown.bs.modal",function(){r.busy=!1,r.wanted==="closed"&&yn(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?wn(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function yn(e){var t=ct(),n=Et.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),T(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function Dr(e){var t=Et.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var ee=null,fe=null;function Ni(){return ee||(ee=G('<div class="modal fade ge-dialog" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-dialog-title"></h5></div><div class="modal-body ge-dialog-body"></div><div class="modal-footer"></div></div></div></div>'),O(ee,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),O(ee,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),Ve(ee,"click",".ge-dialog-close",function(e){e.preventDefault(),me()}),document.body.appendChild(ee))}function Nr(e,t,n){me();var r=Ni(),o=new AbortController;fe={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},O(r,".ge-dialog-title").textContent=e,O(r,".ge-dialog-body").appendChild(t),Pe(t),ct()||document.addEventListener("keydown",function(a){a.key==="Escape"&&me()},{signal:o.signal}),Object.keys(K).forEach(function(a){C(K[a],"ge-under-dialog")}),wn(r,function(){me()})}function me(){var e=fe;e&&(fe=null,e.listening.abort(),yn(ee),Object.keys(K).forEach(function(t){T(K[t],"ge-under-dialog")}),ge(e.body),e.home&&ze(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.body,e.next):e.home.appendChild(e.body):e.body.remove(),e.opener&&ze(e.opener)&&e.opener.focus&&e.opener.focus())}function Ir(){me(),ee&&(Dr(ee),qt(ee),ee=null)}function Fr(e){var t=se(e);if(I[t]&&I[t].labelKey)return m(I[t].labelKey);switch(t){case"row":return m("panel.kind_row");case"column":return m("panel.kind_column");case"text":return m("panel.kind_text");case"element":return m("panel.kind_element");case"section":return m("panel.kind_section");case"tab":return m("panel.kind_tab");case"accordion-item":return m("panel.kind_accordion_item");default:return t}}function Ii(){_(f,'.column, div[class*="col-"], div.col').forEach(function(e){C(e,"column"),!(Bi(e).length||Hr(e.parentElement))&&At(e,w[0],F)})}function Hr(e){return y(e,"row")&&w.some(function(t){return Ge.some(function(n){return y(e,Nn(t,n))})})}function rt(e,t){if(!y(e,"row"))return null;for(var n=w.indexOf(t);n>=0;n--)for(var r=0;r<Ge.length;r++)if(y(e,Nn(w[n],Ge[r])))return{tier:n,value:Ge[r]};return null}function Ur(e,t){for(var n=w.indexOf(t);n>=0;n--){var r=Ue(e,w[n]);if(r!==null)return{tier:n,size:r}}return null}function xt(e,t){var n=rt(e.parentElement,t);if(!n)return null;var r=Ur(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function Fi(e){return e.value==="auto"?0:F/parseInt(e.value,10)}function Hi(e,t){var n=xt(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:Hr(e.parentElement)&&!Ur(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function Ui(e){xe(e,".row").forEach(function(t){var n=s.row_cols===!1?null:M===$?rt(t,w[0])||null:rt(t,Q(M));n?t.setAttribute("data-ge-row-cols",Wr(n.value)):t.removeAttribute("data-ge-row-cols")})}function Wr(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function Wi(){return{name:"row-cols",prefix:"row-cols",values:Ge,appliesTo:["row"],labelKey:"utility.row_cols"}}function Ue(e,t){var n=Kr(e,t.colPrefix);return n!==null?n:y(e,je(t,"auto"))?"auto":y(e,je(t,"equal"))?"equal":null}function _t(e,t){return Kr(e,t.offsetPrefix)}function Cn(e,t){return Br(e,t,Ue)}function kt(e,t){return Br(e,t,_t)}function Br(e,t,n){for(var r=w.indexOf(t);r>=0;r--){var o=n(e,w[r]);if(o!==null)return o}return null}function Kr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function Vr(e,t,n){var r=(e.getAttribute("class")||"").split(/\s+/).filter(function(o){return o!==""&&!new RegExp("^"+t+"\\d+$").test(o)});n!==null&&r.push(t+n),e.setAttribute("class",r.join(" "))}function At(e,t,n){Vr(e,t.colPrefix,null),Dn.forEach(function(r){T(e,je(t,r))}),n!=null&&C(e,je(t,n))}function En(e,t,n){Vr(e,t.offsetPrefix,n||null)}function Bi(e){return w.filter(function(t){return Ue(e,t)!==null})}function xn(e,t,n){var r=0;return V(e,".column").forEach(function(o){if(!(n&&o===n)){var a=xt(o,t),l=a?Fi(a):Cn(o,t);r+=(q(l)?l:0)+(kt(o,t)||0)}}),F-r}function Ot(e){var t=e.size===null||e.size===void 0?null:e.size,n=e.offset===null||e.offset===void 0?0:e.offset;return n=Math.min(Math.max(n,0),mo),t===null||!q(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),F),t+n<=F?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:F-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function We(e){xe(e,".column").forEach(function(t){ke(t,{width:"",height:"",left:"",top:""}),lt(t)})}function Gr(e){return"ge-"+e+"-"+bo}function _n(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(Tt("blocks")).join(", ")}function Tt(e){return Object.keys(S).map(function(t){return S[t][e]||null}).filter(function(t){return t!==null})}function kn(e,t){var n=!0;return Object.keys(S).forEach(function(r){var o=S[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function Ki(){return s.drag_handle==="drawer"?".ge-tools-drawer > a:not(.ge-text-info):not(.ge-element-info), .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option"}function St(e,t){var n=vo();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=s.drag_handle==="drawer",o=Ki(),a=0;e.forEach(function(l){var d=t.group?{name:Gr(t.group)}:{name:Gr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(d.put=function(c,g,h){return g.options.group.name===d.name&&t.accepts(c.el,h)}),gt.push(n.create(l,Object.assign({group:d,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(c,g){return J(c.target,o,l)?!0:!g||g.parentNode!==l},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:s.drag.animation,delay:s.drag.delay||s.drag.touch_delay,delayOnTouchOnly:!s.drag.delay,touchStartThreshold:s.drag.threshold,scroll:s.drag.scroll,onStart:Gi,onEnd:Xi},t.options||{})))})}}function Vi(){if(!vo()){X("sortable_missing",m("error.sortable_missing"));return}St(_(f,".row"),{draggable:".column",group:"column"}),St([f].concat(_(f,".column")),{draggable:_n(),group:"block",accepts:kn});var e=Tt("regions");e.length&&St(_(f,e.join(", ")),{draggable:">"+_n(),group:"block",accepts:kn}),oe("onSortable",St)}function Gi(e){var t=e.item,n=Zt(t),r=qr(t),o={from:n,canceled:!1};Wt.set(t,o),Y(function(){var a=R("before-move",ne(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function qr(e){var t=y(e,"ge-text-block")&&L(e,".ge-content")||e;return{kind:se(t),node:t}}function qi(e,t){var n=V(t.parent).filter(function(r){return r!==e&&!y(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function Xi(e){var t=e.item,n=Wt.get(t),r=n?n.from:Zt(t);if(Wt.delete(t),n&&n.canceled){qi(t,r);return}var o=Zt(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=J(t,"[data-ge-container]"),l=I[Fe(a)];l&&l.afterPaneMove&&l.afterPaneMove(a,t,r);var d=qr(t);Y(function(){R("after-move",ne(d.kind,d.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function Yi(){s.resize.enabled&&_(f,".column").forEach(function(e){if(!L(e,".ge-resize-handle")){var t=L(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),Ji().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",$i),e.appendChild(r)})}})}function Ji(){return String(s.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function $i(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=st(n);if(e.preventDefault(),!Zi(n))return;C(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function l(g){var h=g.pageX-o;return Math.max(1,a+(r?-h:h))}function d(g){n.style.width=l(g)+"px",ea(n,l(g))}function c(g){t.removeEventListener("pointermove",d),jn(t,"pointerup pointercancel",c),T(n,"ge-resizing"),ta(n,l(g))}t.addEventListener("pointermove",d),ie(t,"pointerup pointercancel",c)}function Qi(){Xr(f)}function Xr(e){_(e,".ge-resize-handle").forEach(function(t){t.remove()}),_(e,".ge-resize-size").forEach(function(t){t.remove()}),We(e)}function Yr(e,t){var n=Math.round(t/Tr(e.parentElement)*F),r=Jr(e),o=r?Qe(r):null,a=vt.get(e),l=a?a.units:Ze(e),d=r&&q(o)?l+o-tt(s.valid_col_sizes):F-et(e);return Math.min(Math.max(n,tt(s.valid_col_sizes)),Math.max(d,tt(s.valid_col_sizes)),pn(s.valid_col_sizes))}function Jr(e){return s.resize.balance!=="next"?null:io(e,".column")[0]||null}function An(e,t){var n=L(e,".ge-tools-drawer"),r=n?L(n,".ge-resize-size"):null;r&&(r.textContent=t)}function $r(e){return(M===$?w[0].colPrefix:ye().colPrefix)+e}function Zi(e){var t=Qe(e),n=Y(function(){return R("before-resize",ne("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ze(e)};return vt.set(e,r),An(e,$r(r.units)),!0}function ea(e,t){An(e,$r(Yr(e,t)))}function ta(e,t){var n=vt.get(e),r=Yr(e,t);if(vt.delete(e),An(e,""),We(e),!!n&&r!==n.units){var o=Yt(e,r);o&&Y(function(){Jt(e,o),na(e,r-n.units),de(e),R("after-resize",ne("column",e,$t({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function na(e,t){var n=Jr(e);if(!(!n||!t)){var r=Qe(n);if(q(r)){var o=Yt(n,r-t);o&&(Jt(n,o),de(n))}}}function ra(){gt.forEach(function(e){e.destroy()}),gt=[]}function Be(){return v("div",{class:"row"})}function Lt(e,t,n){var r=null;if(Ca.forEach(function(d){r===null&&n&&n[d]!==void 0&&(r=d)}),r===null)return e;var o=pe(n[r]);if(!o)return U(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,l=function(){return re(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):Dt(e,o)},{parent:a,source:n.source||"api"})};return qe>0?(Gt(l),e):l()}function oa(e,t){var n=Be();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(U("createRow: the layout is an array of column sizes, as in [8, 4], or { row_cols, columns }. Making an empty row instead."),e=[]),e&&!Array.isArray(e)&&(n=Ye(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(Ee(r))}),Lt(n,"row",t)}function ia(e,t){t=t||{};var n=pe(t.appendTo||t.prependTo||null);e===void 0&&n&&rt(n,ye())?e=null:!q(e)&&Dn.indexOf(e)===-1&&(U("createColumn: no column size given, using "+F),e=F);var r=Ee(e,t.offset);return t.content!==void 0&&r.appendChild(ga(t.content)),Lt(r,"column",t)}function aa(e,t){t=t||{};var n=I[e];return n?Lt(n.create(t),e,t):(U('createContainer: no such container type "'+e+'"'),null)}function Qr(e,t,n){e=pe(e),n=n||{};var r=I[Fe(e)];if(!r||Fe(e)!==t)return U("this is not a "+t+" container"),null;var o=r.addPane(e,n);return re(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function On(){var e={};return Object.keys(s).forEach(function(t){var n=s[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function Ee(e,t){var n=v("div",{class:"column"}),r=go(M)[0],o=Ot({size:e,offset:t||0,leading:"offset"});return At(n,r,o.size===null?e:o.size),En(n,r,o.offset),n}function Tn(e,t){if(!(!s.custom_filter||!s.custom_filter.length)){var n=typeof s.custom_filter=="string"||typeof s.custom_filter=="function"?[s.custom_filter]:s.custom_filter;Array.prototype.forEach.call(n,function(r){typeof r=="string"&&(r=window[r]),r(t||f,e)})}}function la(){var e=[".row","[data-ge-container]"];return Object.keys(S).forEach(function(t){var n=S[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function sa(e){_(f,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!V(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=y(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(c){c.nodeType===1&&c.matches(e)?(o.push({text:a},{block:c}),a=[]):a.push(c)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var l=!1,d=r;o.forEach(function(c){var g;if(c.block)g=c.block;else if(ua(c.text))l?(g=Sn(n),c.text.forEach(function(h){g.appendChild(h)})):(c.text.forEach(function(h){t.appendChild(h)}),g=r,l=!0);else return;g!==d&&Dt(g,d),d=g}),l||r.remove()}})}function ua(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function da(e){_(f,".column").forEach(function(t){var n=[];V(t).forEach(function(r){_e(r,".ge-tools-drawer, .ge-resize-handle")||(_e(r,".ge-content, .ge-text-block")||r.matches(e)?n=Zr(n):n.push(r))}),Zr(n)})}function Zr(e){if(e.length){var t=Dt(Sn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function Sn(e){var t=v("div",{class:"ge-content"});return e&&(C(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function ca(){_(f,".column > .ge-content").forEach(function(e){so(e,v("div",{class:"ge-text-block"}))}),_(f,".ge-text-block").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=L(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?Ko(n)||ma(e,n):fa(e)}})}function eo(e){_(e,".ge-text-block").forEach(function(t){Nt(t)})}function fa(e){var t=L(e,".ge-content"),n=He(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");C(e,"ge-plain-block"),Me(n),Object.keys(S).forEach(function(r){S[r].plainTools&&S[r].plainTools(n,t)}),D(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){Oe("plain",t,m("confirm.delete_plain"),function(r){ut(e,function(){e.remove(),r()})})})}function ma(e,t){var n=L(e,".ge-content"),r=He(e,"ge-tools-drawer ge-text-drawer");Me(r),D(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),D(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){Oe("text",n,m("confirm.delete_text"),function(o){ut(e,function(){e.remove(),o()})})})}function ga(e){var t=ir(),n=Sn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):it(n,e),n}function to(e){M=e,Rn.forEach(function(t){z(f,"ge-layout-"+t,t===e)}),O(De,"button").textContent=m(dt(e))}function Ln(e){return Rn.indexOf(e)===-1?null:e}function no(e){var t=Ln(e);if(t===null){U("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=M;to(t),t!==n&&(jr().forEach(function(r){_(r,".ge-utilities").forEach(function(o){mn(o)})}),yr(null),$e(f),oe("onViewChange",t),R("view-change",{canvas:f,breakpoint:t,from:n,to:t}))}function Mn(){return M}function ro(e,t,n){return function(){return Le[e]?Le[e].apply(null,arguments):(X("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function pa(e){if(!s.active_target){X("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Te(null);return}var t=pe(e);if(!Go(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Te(t)}var zn={getHtml:Je,getPlainHtml:Jo,init:function(){Gt(ue)},reset:function(){Gt(ar)},deinit:Se,destroy:Qo,changeView:no,getView:Mn,createRow:oa,createColumn:ia,createText:function(e,t){return Le.createText?Le.createText(e,t):(X("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:ro("createElement","elements","elements"),createSection:ro("createSection","sections","sections"),createContainer:aa,addTab:function(e,t){return Qr(e,"tabs",t)},addAccordionItem:function(e,t){return Qr(e,"accordion",t)},setLocale:wo,getUtility:hr,setUtility:fn,getActiveTarget:function(){return s.active_target?H:null},setActiveTarget:pa};Object.keys(zn).forEach(function(e){var t=!!(fo[e]&&fo[e].value);i[e]=function(){if(pt)return X("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?f.innerHTML:e==="getPlainHtml"?In(f.innerHTML):t?null:i;var n=zn[e].apply(i,arguments);return t?n:i}}),i.canvas=f,i.settings=On(),It.set(f,i),Zo(),i.settings=On(),Object.keys(Le).forEach(function(e){Object.prototype.hasOwnProperty.call(zn,e)||e in i||(i[e]=function(){return pt?(X("destroyed:"+e,m("warning.destroyed",{method:e})),null):Le[e].apply(null,arguments)})}),_o(),ue(),k._created.forEach(function(e){e(i)})}k._created=[];k.containers={};k.features={};k.utilities={};k.texts={};k.t=Fn;k._plainHtml=In;k.Sortable=null;k.bootstrap=null;k.version="8.7.1";k.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.delete_text":"Remove text","tool.delete_plain":"Remove content","tool.convert_type":"Edit as {editor} text","text.no_editor":'No text editor "{type}" is loaded: this text can be moved and deleted, not edited',"tool.add_column":`Add column
|
|
2
2
|
(hold to choose the width)`,"tool.column_size":"{size} of 12","tool.column_equal":"Equal: shares what the row has left","tool.column_auto":"Auto: as wide as its content","tool.delete_row":"Remove row","tool.delete_column":"Remove col","tool.delete_container":"Remove container","tool.delete_pane":"Remove pane","tool.rename":"Double click to rename","tool.column_narrower":`Make column narrower
|
|
3
3
|
(hold shift for min)`,"tool.column_wider":`Make column wider
|
|
4
4
|
(hold shift for max)`,"tool.indent_decrease":`Decrease indent
|
|
5
5
|
(hold shift for none)`,"tool.indent_increase":`Increase indent
|
|
6
|
-
(hold shift for max)`,"tool.edit_source":"Edit Source Code","tool.preview":"Preview","tool.more":"More","group.rows":"Rows","group.content":"Content","group.elements":"Elements","group.select":"Add","panel.title":"{kind} settings","panel.close":"Close","panel.done":"Done","panel.id":"Id","panel.classes":"Classes","panel.section_general":"Id and classes","panel.kind_row":"Row","panel.kind_column":"Column","panel.kind_element":"Element","panel.kind_section":"Section","panel.kind_tab":"Tab","panel.kind_accordion_item":"Accordion item","tool.id_placeholder":"id","tool.id_title":"Set a unique identifier","tool.classes_placeholder":"classes","tool.classes_title":"Css classes, separated by spaces","tool.toggle_class":'Toggle "{label}" styling',"row.add":"Add row {layout}","row.add_row_cols":"Add a row of {columns} columns, {counts} per row","confirm.title":"Confirm","confirm.ok":"Delete","confirm.cancel":"Cancel","confirm.delete_row":"Delete row?","confirm.delete_column":"Delete column?","confirm.delete_text":"Delete this text?","confirm.delete_plain":"Delete this content?","confirm.delete_container":"Delete this container and everything in it?","view.all":"All sizes","view.xs":"Phone","view.sm":"Tablet","view.md":"Small desktop","view.lg":"Desktop","view.xl":"Large desktop","view.xxl":"Widescreen","utility.section":"Responsive: {view}","utility.col_width":"Width","utility.col_equal":"Equal","utility.col_auto":"Auto","utility.col_from_row":"From the row: {count}","utility.row_cols":"Columns per row","badge.row_cols":"{count} per row","badge.row_cols_auto":"As wide as their content","utility.default":"Default","utility.inherit":"Inherit: {value} (from {breakpoint})","utility.varies":"Changes at {breakpoints}; choosing here replaces that","error.sortable_missing":"SortableJS not available! Make sure you loaded the Sortable js file; dragging is off without it.","warning.already_editing":"This element already has an editor: that one is handed back, with the options it was made with.","warning.destroyed":"{method}() was called on an editor that has been destroyed, and does nothing.","warning.duplicate_build":"grideditor.js was loaded twice: the first GridEditor is kept.","warning.adapter_no_jquery":"grideditor.jquery.js needs jQuery 4, and there is no jQuery on the page: the jQuery API is not there.","error.tinymce_missing":"tinyMCE not available! Make sure you loaded the tinyMCE js file.","error.ckeditor_missing":"CKEditor 5 not available! Make sure you loaded its ckeditor5.umd.js file.","error.summernote_missing":"Summernote not available! Make sure you loaded jQuery and the Summernote js file."}};window.GridEditor?window.console&&window.console.warn&&window.console.warn("grid-editor: "+
|
|
6
|
+
(hold shift for max)`,"tool.edit_source":"Edit Source Code","tool.preview":"Preview","tool.more":"More","group.rows":"Rows","group.content":"Content","group.elements":"Elements","group.select":"Add","panel.title":"{kind} settings","panel.close":"Close","panel.done":"Done","panel.id":"Id","panel.classes":"Classes","panel.section_general":"Id and classes","panel.kind_row":"Row","panel.kind_column":"Column","panel.kind_element":"Element","panel.kind_section":"Section","panel.kind_tab":"Tab","panel.kind_accordion_item":"Accordion item","tool.id_placeholder":"id","tool.id_title":"Set a unique identifier","tool.classes_placeholder":"classes","tool.classes_title":"Css classes, separated by spaces","tool.toggle_class":'Toggle "{label}" styling',"row.add":"Add row {layout}","row.add_row_cols":"Add a row of {columns} columns, {counts} per row","confirm.title":"Confirm","confirm.ok":"Delete","confirm.cancel":"Cancel","confirm.delete_row":"Delete row?","confirm.delete_column":"Delete column?","confirm.delete_text":"Delete this text?","confirm.delete_plain":"Delete this content?","confirm.delete_container":"Delete this container and everything in it?","view.all":"All sizes","view.xs":"Phone","view.sm":"Tablet","view.md":"Small desktop","view.lg":"Desktop","view.xl":"Large desktop","view.xxl":"Widescreen","utility.section":"Responsive: {view}","utility.col_width":"Width","utility.col_equal":"Equal","utility.col_auto":"Auto","utility.col_from_row":"From the row: {count}","utility.row_cols":"Columns per row","badge.row_cols":"{count} per row","badge.row_cols_auto":"As wide as their content","utility.default":"Default","utility.inherit":"Inherit: {value} (from {breakpoint})","utility.varies":"Changes at {breakpoints}; choosing here replaces that","error.sortable_missing":"SortableJS not available! Make sure you loaded the Sortable js file; dragging is off without it.","warning.already_editing":"This element already has an editor: that one is handed back, with the options it was made with.","warning.destroyed":"{method}() was called on an editor that has been destroyed, and does nothing.","warning.duplicate_build":"grideditor.js was loaded twice: the first GridEditor is kept.","warning.adapter_no_jquery":"grideditor.jquery.js needs jQuery 4, and there is no jQuery on the page: the jQuery API is not there.","error.tinymce_missing":"tinyMCE not available! Make sure you loaded the tinyMCE js file.","error.ckeditor_missing":"CKEditor 5 not available! Make sure you loaded its ckeditor5.umd.js file.","error.summernote_missing":"Summernote not available! Make sure you loaded jQuery and the Summernote js file."}};window.GridEditor?window.console&&window.console.warn&&window.console.warn("grid-editor: "+k.t({locale:"en"},"warning.duplicate_build")):window.GridEditor=k;})();
|