%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/1857783/root/var/www/cwg/wp-content/plugins/wp-grid-builder/admin/assets/js/
Upload File :
Create Path :
Current File : //proc/1857783/root/var/www/cwg/wp-content/plugins/wp-grid-builder/admin/assets/js/builder.js

/*!
* WP Grid Builder Plugin
*
* @package   WP Grid Builder
* @author    Loïc Blascos
* @link      https://www.wpgridbuilder.com
* @copyright 2019-2021 Loïc Blascos
*
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.DOMPurify=t()}(this,function(){"use strict";var ue=["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"],he=["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"],me=["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence"],ge=["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"],fe=["#text"],be=["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"],ye=["accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"],ve=["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"],we=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"];function _e(e,t){for(var n=t.length;n--;)"string"==typeof t[n]&&(t[n]=t[n].toLowerCase()),e[t[n]]=!0;return e}function Se(e){var t={},n=void 0;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}var xe=/\{\{[\s\S]*|[\s\S]*\}\}/gm,ke=/<%[\s\S]*|[\s\S]*%>/gm,Ee=/^data-[\-\w.\u00B7-\uFFFF]/,Ce=/^aria-[\-\w]+$/,Te=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Le=/^(?:\w+script|data):/i,Pe=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Oe(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Ae=function(){return"undefined"==typeof window?null:window};return function t(e){function c(e){return t(e)}var a=0<arguments.length&&void 0!==e?e:Ae();if(c.version="1.0.3",c.removed=[],!a||!a.document||9!==a.document.nodeType)return c.isSupported=!1,c;var l=a.document,o=!1,r=!1,d=a.document,p=a.DocumentFragment,n=a.HTMLTemplateElement,u=a.Node,i=a.NodeFilter,e=a.NamedNodeMap,s=void 0===e?a.NamedNodeMap||a.MozNamedAttrMap:e,h=a.Text,m=a.Comment,g=a.DOMParser,e=a.XMLHttpRequest,f=void 0===e?a.XMLHttpRequest:e,e=a.encodeURI,b=void 0===e?a.encodeURI:e;"function"!=typeof n||(n=d.createElement("template")).content&&n.content.ownerDocument&&(d=n.content.ownerDocument);var y=d.implementation,v=d.createNodeIterator,w=d.getElementsByTagName,_=d.createDocumentFragment,S=l.importNode,x={};c.isSupported=y&&void 0!==y.createHTMLDocument&&9!==d.documentMode;function k(e){"object"!==(void 0===e?"undefined":Ne(e))&&(e={}),q="ALLOWED_TAGS"in e?_e({},e.ALLOWED_TAGS):R,D="ALLOWED_ATTR"in e?_e({},e.ALLOWED_ATTR):F,B="FORBID_TAGS"in e?_e({},e.FORBID_TAGS):{},j="FORBID_ATTR"in e?_e({},e.FORBID_ATTR):{},L="USE_PROFILES"in e&&e.USE_PROFILES,H=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,U=e.SAFE_FOR_JQUERY||!1,Y=e.SAFE_FOR_TEMPLATES||!1,V=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Z=e.RETURN_DOM_FRAGMENT||!1,K=e.RETURN_DOM_IMPORT||!1,$=e.FORCE_BODY||!1,Q=!1!==e.SANITIZE_DOM,ee=!1!==e.KEEP_CONTENT,I=e.ALLOWED_URI_REGEXP||I,Y&&(W=!1),Z&&(J=!0),L&&(q=_e({},[].concat(Oe(fe))),D=[],!0===L.html&&(_e(q,ue),_e(D,be)),!0===L.svg&&(_e(q,he),_e(D,ye),_e(D,we)),!0===L.svgFilters&&(_e(q,me),_e(D,ye),_e(D,we)),!0===L.mathMl&&(_e(q,ge),_e(D,ve),_e(D,we))),e.ADD_TAGS&&_e(q=q===R?Se(q):q,e.ADD_TAGS),e.ADD_ATTR&&_e(D=D===F?Se(D):D,e.ADD_ATTR),e.ADD_URI_SAFE_ATTR&&_e(ie,e.ADD_URI_SAFE_ATTR),ee&&(q["#text"]=!0),Object&&"freeze"in Object&&Object.freeze(e),oe=e}function E(t){c.removed.push({element:t});try{t.parentNode.removeChild(t)}catch(e){t.outerHTML=""}}function C(e,t){try{c.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){c.removed.push({attribute:null,from:t})}t.removeAttribute(e)}function T(e){var t=void 0,n=void 0;if($&&(e="<remove></remove>"+e),r){try{e=b(e)}catch(e){}var i=new f;i.responseType="document",i.open("GET","data:text/html;charset=utf-8,"+e,!1),i.send(null),t=i.response}if(o)try{t=(new g).parseFromString(e,"text/html")}catch(e){}return t&&t.documentElement||((n=(t=y.createHTMLDocument("")).body).parentNode.removeChild(n.parentNode.firstElementChild),n.outerHTML=e),w.call(t,V?"html":"body")[0]}var L,P=xe,N=ke,O=Ee,A=Ce,M=Le,z=Pe,I=Te,q=null,R=_e({},[].concat(Oe(ue),Oe(he),Oe(me),Oe(ge),Oe(fe))),D=null,F=_e({},[].concat(Oe(be),Oe(ye),Oe(ve),Oe(we))),B=null,j=null,H=!0,W=!0,G=!1,U=!1,Y=!1,V=!1,X=!1,$=!1,J=!1,Z=!1,K=!1,Q=!0,ee=!0,te=_e({},["audio","head","math","script","style","template","svg","video"]),ne=_e({},["audio","video","img","source","image"]),ie=_e({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),oe=null,re=d.createElement("form");c.isSupported&&function(){var e=T('<svg><g onload="this.parentNode.remove()"></g></svg>');e.querySelector("svg")||(r=!0);try{(e=T('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">')).querySelector("svg img")&&(o=!0)}catch(e){}}();function se(e){return v.call(e.ownerDocument||e,e,i.SHOW_ELEMENT|i.SHOW_COMMENT|i.SHOW_TEXT,function(){return i.FILTER_ACCEPT},!1)}function ae(e){return"object"===(void 0===u?"undefined":Ne(u))?e instanceof u:e&&"object"===(void 0===e?"undefined":Ne(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName}function le(e,t,n){x[e]&&x[e].forEach(function(e){e.call(c,t,n,oe)})}function ce(e){var t=void 0;if(le("beforeSanitizeElements",e,null),!((n=e)instanceof h||n instanceof m||"string"==typeof n.nodeName&&"string"==typeof n.textContent&&"function"==typeof n.removeChild&&n.attributes instanceof s&&"function"==typeof n.removeAttribute&&"function"==typeof n.setAttribute))return E(e),1;var n=e.nodeName.toLowerCase();if(le("uponSanitizeElement",e,{tagName:n,allowedTags:q}),q[n]&&!B[n])return!U||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(c.removed.push({element:e.cloneNode()}),e.innerHTML=e.textContent.replace(/</g,"&lt;")),Y&&3===e.nodeType&&(t=(t=(t=e.textContent).replace(P," ")).replace(N," "),e.textContent!==t&&(c.removed.push({element:e.cloneNode()}),e.textContent=t)),le("afterSanitizeElements",e,null),0;if(ee&&!te[n]&&"function"==typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(e){}return E(e),1}function de(e){var t,n,i=void 0,o=void 0,r=void 0,s=void 0,a=void 0;if(le("beforeSanitizeAttributes",e,null),s=e.attributes){for(var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D},a=s.length;a--;){if(o=(i=s[a]).name,r=i.value.trim(),t=o.toLowerCase(),l.attrName=t,l.attrValue=r,l.keepAttr=!0,le("uponSanitizeAttribute",e,l),r=l.attrValue,"name"===t&&"IMG"===e.nodeName&&s.id)n=s.id,s=Array.prototype.slice.apply(s),C("id",e),C(o,e),s.indexOf(n)>a&&e.setAttribute("id",n.value);else{if("INPUT"===e.nodeName&&"type"===t&&"file"===r&&(D[t]||!j[t]))continue;"id"===o&&e.setAttribute(o,""),C(o,e)}if(l.keepAttr&&(!Q||"id"!==t&&"name"!==t||!(r in d||r in re))){if(Y&&(r=(r=r.replace(P," ")).replace(N," ")),!(W&&O.test(t)||H&&A.test(t))){if(!D[t]||j[t])continue;if(!ie[t]&&!I.test(r.replace(z,""))&&("src"!==t&&"xlink:href"!==t||0!==r.indexOf("data:")||!ne[e.nodeName.toLowerCase()])&&(!G||M.test(r.replace(z,"")))&&r)continue}try{e.setAttribute(o,r),c.removed.pop()}catch(e){}}}le("afterSanitizeAttributes",e,null)}}function pe(e){var t,n=se(e);for(le("beforeSanitizeShadowDOM",e,null);t=n.nextNode();)le("uponSanitizeShadowNode",t,null),ce(t)||(t.content instanceof p&&pe(t.content),de(t));le("afterSanitizeShadowDOM",e,null)}return c.sanitize=function(e,t){var n,i=void 0,o=void 0,r=void 0;if("string"!=typeof(e=e||"\x3c!--\x3e")&&!ae(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!c.isSupported){if("object"===Ne(a.toStaticHTML)||"function"==typeof a.toStaticHTML){if("string"==typeof e)return a.toStaticHTML(e);if(ae(e))return a.toStaticHTML(e.outerHTML)}return e}if(X||k(t),c.removed=[],e instanceof u)1===(t=(i=T("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===t.nodeName?i=t:i.appendChild(t);else{if(!J&&!V&&-1===e.indexOf("<"))return e;if(!(i=T(e)))return J?null:""}$&&E(i.firstChild);for(var s=se(i);n=s.nextNode();)3===n.nodeType&&n===o||ce(n)||(n.content instanceof p&&pe(n.content),de(n),o=n);if(J){if(Z)for(r=_.call(i.ownerDocument);i.firstChild;)r.appendChild(i.firstChild);else r=i;return r=K?S.call(l,r,!0):r}return V?i.outerHTML:i.innerHTML},c.setConfig=function(e){k(e),X=!0},c.clearConfig=function(){oe=null,X=!1},c.addHook=function(e,t){"function"==typeof t&&(x[e]=x[e]||[],x[e].push(t))},c.removeHook=function(e){x[e]&&x[e].pop()},c.removeHooks=function(e){x[e]&&(x[e]=[])},c.removeAllHooks=function(){x={}},c}()}),function(){var o;!function(){"use strict";function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}(),y=window,o=0,y.requestAnimationFrame=y.requestAnimationFrame||y.webkitRequestAnimationFrame,y.requestAnimationFrame||(y.requestAnimationFrame=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-o)),e=setTimeout(e,n);return o=t+n,e}),y.cancelAnimationFrame||(y.cancelAnimationFrame=function(e){clearTimeout(e)});var p={},t=window.console,n=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],n=0;n<t.length;n++){var i=t[n]+"MatchesSelector";if(e[i])return i}}();function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(e=e,!(null!=(t=t)&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}p.error=function(e){void 0!==t&&t.error(e)},p.docReady=function(e){var t=document.readyState;"complete"===t||"interactive"===t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},p.isIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),n=e.indexOf("Trident/");if(0<t)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(0<n){n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}return!1},p.matchesSelector=function(e,t){return e[n](t)},p.getParent=function(e,t){for(;e&&e!=document.body;){if(e.classList&&p.matchesSelector(e,t))return e;e=e.parentNode}},p.extend=function(e,t){if("object"!=typeof e)this.error("Args to extend must be an object");else for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);return e},p.merge=function(e,t){var n,i={};for(n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);for(n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);return i},p.modulo=function(e,t){return(e+t%e)%e},p.clone=function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],n=0,i=e.length;n<i;n++)t[n]=p.clone(e[n]);return t}if("object"!=typeof e)return e;for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=p.clone(e[o]));return t},p.removeChildren=function(e){if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},p.detectPointers=function(){return navigator.pointerEnabled?{down:["pointerdown"],move:["pointermove"],up:["pointerup","pointercancel"]}:navigator.msPointerEnabled?{down:["MSPointerDown"],move:["MSPointerMove"],up:["MSPointerUp","MSPointerCancel"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","mouseleave","touchend","touchcancel"]}},p.Transitionend=function(){var e,t=document.createElement("div"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(n.hasOwnProperty(e)&&void 0!==t.style[e])return t=null,n[e]},p.handleEvent=function(t,n,e,i,o){t.eventListeners||(t.eventListeners={}),t.eventListeners[i]||(t.eventListeners[i]=t[i].bind(t)),o=(o=void 0===o||!!o)?"addEventListener":"removeEventListener",e.forEach(function(e){n[o](e,t.eventListeners[i],"touchstart"===e&&{passive:!1})})},p.dispatchEvent=function(e,t,n){n=new CustomEvent(t,{detail:n});e.dispatchEvent(n)},p.dispatchHTMLEvent=function(e,t){var n;document.createEvent?((n=document.createEvent("HTMLEvents")).initEvent(t,!0,!0),e.dispatchEvent(n)):((n=document.createEventObject()).eventType=t,e.fireEvent("on"+n.eventType,n))},p.throttle=function(n,i){function o(){c=Date.now(),l=null,a=n.apply(r,s),l||(r=s=null)}var r,s,a,l=null,c=0;return function(){var e=Date.now(),t=i-(e-c);return r=this,s=arguments,t<=0||i<t?(l&&(clearTimeout(l),l=null),c=e,a=n.apply(r,s),l||(r=s=null)):l=l||setTimeout(o,t),a}};function e(){}var d,u=function(){function e(){a(this,e),this.listeners=new Map}var t,n,i;return t=e,(n=[{key:"canListen",value:function(e,t){return!("function"!=typeof t||!e)||(!("object"!==s(t)||!t[e])||(console.error('Invalid listener for event name: "'.concat(e,'"')),!1))}},{key:"exists",value:function(e,t){if(this.listeners.has(e))return this.listeners.get(e).find(function(e){return e.listener===t})}},{key:"on",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return this.canListen(e,t)?(this.listeners.has(e)||this.listeners.set(e,[]),this.exists(e,t)||this.listeners.get(e).push({listener:t,once:n}),this):this}},{key:"once",value:function(e,t){return this.on(e,t,!0)}},{key:"off",value:function(e,t){var n=this.listeners.get(e)||[],i=n.findIndex(function(e){return e.listener===t});return-1<i&&n.splice(i,1),n.length<1&&this.listeners.delete(e),this}},{key:"offAll",value:function(){return this.listeners.clear(),this}},{key:"emit",value:function(n){for(var i=this,e=arguments.length,o=new Array(1<e?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return r(this.listeners.get(n)||[]).forEach(function(e){var t;e.once&&i.off(n,e.listener),"object"===s(e.listener)?(t=e.listener[n]).apply.apply(t,[e.listener].concat(o)):(e=e.listener).apply.apply(e,[i].concat(o))}),this}}])&&c(t.prototype,n),i&&c(t,i),e}(),h=/\\?(.?)/gi;e.prototype.getFormat=function(e){return d=new Date,e.replace(h,f)};function m(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function g(){}var f=function(e,t){return b[e]?b[e]():t},b={d:function(){return m(b.j(),2)},D:function(){return wpgb_date_L10n.dayNamesShort[b.w()]},j:function(){return d.getDate()},l:function(){return wpgb_date_L10n.dayNames[b.w()]},N:function(){return b.w()||7},S:function(){var e=b.j(),t=e%10;return["st","nd","rd"][(t=t<=3&&1===parseInt(e%100/10,10)?0:t)-1]||"th"},w:function(){return d.getDay()},z:function(){var e=new Date(b.Y(),b.n()-1,b.j()),t=new Date(b.Y(),0,1);return Math.round((e-t)/864e5)},W:function(){var e=new Date(b.Y(),b.n()-1,b.j()-b.N()+3),t=new Date(e.getFullYear(),0,4);return m(1+Math.round((e-t)/864e5/7),2)},F:function(){return wpgb_date_L10n.monthNames[b.n()-1]},m:function(){return m(b.n(),2)},M:function(){return wpgb_date_L10n.monthNamesShort[b.n()-1]},n:function(){return d.getMonth()+1},t:function(){return new Date(b.Y(),b.n(),0).getDate()},L:function(){var e=b.Y();return e%4==0&e%100!=0|e%400==0},o:function(){var e=b.n(),t=b.W();return b.Y()+(12===e&&t<9?1:1===e&&9<t?-1:0)},Y:function(){return d.getFullYear()},y:function(){return b.Y().toString().slice(-2)},a:function(){return 11<d.getHours()?"pm":"am"},A:function(){return b.a().toUpperCase()},B:function(){var e=3600*d.getUTCHours(),t=60*d.getUTCMinutes(),n=d.getUTCSeconds();return m(Math.floor((e+t+n+3600)/86.4)%1e3,3)},g:function(){return b.G()%12||12},G:function(){return d.getHours()},h:function(){return m(b.g(),2)},H:function(){return m(b.G(),2)},i:function(){return m(d.getMinutes(),2)},s:function(){return m(d.getSeconds(),2)},u:function(){return m(1e3*d.getMilliseconds(),6)},v:function(){return m(d.getMilliseconds(),3)},e:function(){return wpgb_date_L10n.timezone},I:function(){return new Date(b.Y(),0)-Date.UTC(b.Y(),0)!=new Date(b.Y(),6)-Date.UTC(b.Y(),6)?1:0},O:function(){var e=d.getTimezoneOffset(),t=Math.abs(e);return(0<e?"-":"+")+m(100*Math.floor(t/60)+t%60,4)},P:function(){var e=b.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return wpgb_date_L10n.timezone_abbr},Z:function(){return 60*-d.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(h,f)},r:function(){return"D, d M Y H:i:s O".replace(h,f)},U:function(){return d/1e3|0}};g.prototype.render=function(e){var i;return e.forEach(function(e,t){var n;null!==e&&(t||"string"!=typeof e?t&&"string"==typeof e?i.firstChild?(n=document.createTextNode(e),i.appendChild(n)):i.textContent=e:i&&Array.isArray(e)?(n=this.render(e))&&i.appendChild(n):i&&"object"==typeof e&&this.renderAtts(i,e):i=-1<["svg","use"].indexOf(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e))}.bind(this)),i},g.prototype.renderAtts=function(p,u){Object.keys(u).forEach(function(e){var t=u[e],n=e in p,i="readonly"===e,o="for"===e,r="type"===e,s="class"===e,a="xlink:href"===e,l="role"===e||-1<e.indexOf("data-"),c=-1<e.indexOf("aria-"),d="tabindex"===e;n||i||o||r||s||l||c||a||d?"style"===e?this.renderStyles(p,t):s?p.className=t:i||o||r||l||c||d?"data-wpgb"===e?p.wpgb=t:p.setAttribute(e,t):n?p[e]=t:a&&p.setAttributeNS("http://www.w3.org/1999/xlink",e,t):console.warn(e+" is not a valid property")}.bind(this))},g.prototype.renderStyles=function(t,n){n&&Object.keys(n).forEach(function(e){e in t.style?t.style[e]=n[e]:console.warn(e+" is not a valid style for a <"+t.tagName.toLowerCase()+">")})};var y=function(e,t){this.canvas=document.querySelector(e),this.layout=t||"horizontal",this.marker=this.canvas.nextElementSibling,this.ruler=document.querySelector(".wpgb-builder-right-panel"),this.bindEvents(),this.getBound(),this.draw()};y.prototype.bindEvents=function(){this.ruler.addEventListener("mouseenter",this.getBound.bind(this)),this.ruler.addEventListener("mousemove",this.move.bind(this)),window.addEventListener("scroll",this.getBound.bind(this),!1),window.addEventListener("resize",this.getBound.bind(this))},y.prototype.getBound=function(){this.bound=this.canvas.parentElement.getBoundingClientRect()},y.prototype.move=function(e){var t;this.position={x:e.clientX,y:e.clientY},"horizontal"===this.layout?(t=2*Math.round((this.position.x-this.bound.left)/2),this.marker.style.transform="translate("+t+"px, 0)",this.marker.setAttribute("data-position",t)):(t=2*Math.round((this.position.y-this.bound.top)/2),this.marker.style.transform="translate(0,"+t+"px)",this.marker.setAttribute("data-position",t))},y.prototype.draw=function(){this.ctx=this.canvas.getContext("2d"),this.size={width:this.canvas.width,height:this.canvas.height},this.set_HDPI(),this.draw_ruler(),this.draw_origin(),this.marker.setAttribute("data-position",0)},y.prototype.set_HDPI=function(){var e,t,n=window.devicePixelRatio||1,i=this.ctx.webkitBackingStorePixelRatio||this.ctx.mozBackingStorePixelRatio||this.ctx.msBackingStorePixelRatio||this.ctx.oBackingStorePixelRatio||this.ctx.backingStorePixelRatio||1;n!==i&&(e=this.canvas.width,t=this.canvas.height,this.canvas.width=e*(i=n/i),this.canvas.height=t*i,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.ctx.scale(i,i))},y.prototype.draw_ruler=function(){this.draw_line(0,100,20,"#96a4b4"),this.draw_line(0,20,12,"rgba(147, 154, 170, 1)"),this.draw_line(10,20,8,"rgba(147, 154, 170, 0.7)")},y.prototype.draw_origin=function(){this.ctx.beginPath(),"horizontal"===this.layout?(this.ctx.moveTo(2500,0),this.ctx.lineTo(2500,50)):(this.ctx.moveTo(0,2500),this.ctx.lineTo(50,2500)),this.ctx.strokeStyle="#f85464",this.ctx.stroke()},y.prototype.draw_line=function(e,t,n,i){var o=Math.round(this.size["horizontal"===this.layout?"width":"height"]/t);this.ctx.beginPath();for(var r=0;r<o;r++)20===t&&0===e&&r%5==0||100===t&&25===r||("horizontal"===this.layout?(this.ctx.moveTo(e+r*t,50),this.ctx.lineTo(e+r*t,50-n)):(this.ctx.moveTo(50-n,e+r*t),this.ctx.lineTo(50,e+r*t)));this.ctx.strokeStyle=i,this.ctx.stroke()};function v(){this.icons=document.querySelectorAll(".wpgb-icons-popup-wrapper span"),this.length=this.icons.length,document.querySelector(".wpgb-icons-popup input").addEventListener("input",this),document.querySelector(".wpgb-icons-popup").addEventListener("click",this),document.addEventListener("click",this.open.bind(this)),window.addEventListener("resize",this.open.bind(this))}v.prototype.handleEvent=function(e){e.preventDefault(),e.stopPropagation();var t="on"+e.type;this[t]&&this[t](e)},v.prototype.open=function(e){var t=p.getParent(e.target,".wpgb-icon-picker"),n=document.querySelector(".wpgb-icons-popup");if(t){this.picker=t,this.input=t.lastElementChild;var i=document.querySelector(".wpgb-icons-popup .wpgb-icon-selected"),o=t.parentElement.getBoundingClientRect(),e=window.innerWidth;i&&i.classList.remove("wpgb-icon-selected"),e<=1280?(e=n.parentElement.getBoundingClientRect(),n.style.top=o.top-e.top+"px",n.style.left=o.left-e.left+"px",n.style.position="absolute"):(n.style.top=o.top+"px",n.style.left=o.left+"px",n.style.position=""),n.style.width=t.parentElement.clientWidth+"px",(r=this.getScrollParent(this.picker))&&r.classList.add("wpgb-disable-scroll"),n.classList.toggle("wpgb-show"),t.classList.toggle("wpgb-open"),n.firstElementChild.focus(),this.selectIcon()}else{for(var r,s=document.querySelectorAll(".wpgb-icon-picker.wpgb-open"),a=0,l=s.length;a<l;a++)(r=this.getScrollParent(this.picker))&&r.classList.remove("wpgb-disable-scroll"),s[a].classList.remove("wpgb-open");n.classList.remove("wpgb-show")}},v.prototype.getScrollParent=function(e){for(var t=e.parentElement;t!==document.body;){var n=getComputedStyle(t,null),i=n.getPropertyValue("overflow");if(i+=n.getPropertyValue("overflow-y"),/(auto|scroll)/.test(i))return t;t=t.parentElement}},v.prototype.oninput=function(e){for(var t=e.target.value,n=0;n<this.length;n++){var i=this.icons[n],o=i.getAttribute("data-icon")||"";i.style.display=-1<o.indexOf(t)?"":"none"}},v.prototype.onclick=function(e){var t,n,i=p.getParent(e.target,".wpgb-icon-item");i&&(n=(t=this.picker.firstElementChild).firstElementChild,e=i.getAttribute("data-icon"),n&&t.removeChild(n),t.appendChild(i.firstElementChild.cloneNode(!0)),document.querySelector(".wpgb-icons-popup").classList.remove("wpgb-show"),this.picker.classList.remove("wpgb-open"),this.input.value=e,p.dispatchHTMLEvent(this.input,"change"))},v.prototype.selectIcon=function(){var e=document.querySelector('.wpgb-icons-popup [data-icon="'+this.input.value+'"]');e&&(e.parentNode.parentNode.scrollTop=0,e.parentNode.parentNode.scrollTop=e.getBoundingClientRect().top-e.parentNode.getBoundingClientRect().top,e.classList.add("wpgb-icon-selected"))};function w(e,i){var t;function o(e){t=requestAnimationFrame(e)}function r(){t&&(cancelAnimationFrame(t),t=null)}i=i||300;var s,a,l,c=function(){var e,t=l-a,n=Date.now()-s;if(d.scrollTop=(e=n,-t*(e/=i)*(e-2)+a),i<=n)return d.scrollTop=l,r();o(c)},d=function(e){for(var t=e.parentElement;t;){var n=getComputedStyle(t,null),i=n.getPropertyValue("overflow");if(i+=n.getPropertyValue("overflow-y"),/(auto|scroll)/.test(i))return t;t=t.parentElement}}(e);d&&(s=Date.now(),a=d.scrollTop,(l=e.offsetTop)!==a&&(r(),o(c)))}function _(e){e.wpgb_resizable||(this.element=e,this.element.wpgb_resizable=1,this.pointers=p.detectPointers(),this.transitionend=p.Transitionend(),this.create(),p.handleEvent(this,this.element,this.pointers.down,"pointerDown"))}_.prototype.create=function(){this.resizer=document.createElement("div");var n=document.createDocumentFragment();["n","s","e","w","ne","se","sw","nw"].forEach(function(e){var t=document.createElement("div");t.className="wpgb-resize",t.setAttribute("data-resize",e),n.appendChild(t)}.bind(this)),this.resizer.className="wpgb-resizer",this.resizer.appendChild(n),this.element.appendChild(this.resizer)},_.prototype.mapPoint=function(e){e=e.touches?e.changedTouches:[e];return e[0]||{}},_.prototype.pointerDown=function(e){var t;this.resizing||(t=this.mapPoint(e),this.pointer={x:Math.round(t.pageX),y:Math.round(t.pageY)},this.sizer={height:this.element.clientHeight,width:this.element.clientWidth,direction:e.target.getAttribute("data-resize")},this.sizer.direction&&(p.handleEvent(this,window,this.pointers.move,"pointerMove"),p.handleEvent(this,window,this.pointers.up,"pointerUp")))},_.prototype.pointerMove=function(e){e.preventDefault(),e.stopPropagation();e=this.mapPoint(e);if(this.delta={x:Math.round(e.pageX)-this.pointer.x,y:Math.round(e.pageY)-this.pointer.y},!(!this.resizing&&Math.abs(this.delta.x)<3&&Math.abs(this.delta.y)<3)){if(!this.resizing)return this.resizing=!0,this.pointer.x+=this.delta.x,this.pointer.y+=this.delta.y,void p.dispatchEvent(window,"wpgb_builder.resize_start",n);document.body.classList.add("wpgb-resizing"),this.element.classList.add("wpgb-resized");var t,n={element:this.element,height:"",width:""};-1<["n","s","ne","se","sw","nw"].indexOf(this.sizer.direction)&&(t=-1<["n","ne","nw"].indexOf(this.sizer.direction)?-1:1,n.height=Math.max(4,this.sizer.height+this.delta.y*t),this.element.style.height=n.height+"px"),-1<["e","w","ne","se","sw","nw"].indexOf(this.sizer.direction)&&(t=-1<["w","sw","nw"].indexOf(this.sizer.direction)?-1:1,n.width=Math.max(4,this.sizer.width+this.delta.x*t),this.element.style.width=n.width+"px"),this.element.style.pointerEvents="none",p.dispatchEvent(window,"wpgb_builder.resize_move",n)}},_.prototype.pointerUp=function(e){p.handleEvent(this,window,this.pointers.move,"pointerMove",!1),p.handleEvent(this,window,this.pointers.up,"pointerUp",!1),this.resizing&&p.dispatchEvent(window,"wpgb_builder.resize_end",{element:this.element}),document.body.classList.remove("wpgb-resizing"),this.element.classList.remove("wpgb-resized"),this.resizing=this.delta=!1};function S(e){this.pointers=p.detectPointers(),this.transitionend=p.Transitionend(),this.options=e?p.extend(e,k):k,this.computed={},this.snapTo=this.options.snapTo?document.querySelector(this.options.snapTo):null,p.handleEvent(this,document,this.pointers.down,"pointerDown"),document.querySelector('[name="wpgb-snap-to-grid"]').addEventListener("click",this.snapToGrid.bind(this),!0)}var k={handle:".wpgb-block",drop:".wpgb-droppable",cancel:".wpgb-resize",snapTo:".wpgb-card",classes:{dragged:"wpgb-dragged",placeholder:"wpgb-placeholder"}};S.prototype.mapPoint=function(e){e=e.touches?e.changedTouches:[e];return e[0]||{}},S.prototype.pointerDown=function(e){3!==e.which&&(this.sorting||p.getParent(e.target,this.options.cancel)||document.querySelector(".wpgb-preview")||(this.draggable=p.getParent(e.target,this.options.handle),this.droppable=p.getParent(e.target,this.options.drop),this.draggable&&(e=this.mapPoint(e),this.pointer={x:Math.round(e.clientX),y:Math.round(e.clientY)},p.handleEvent(this,window,this.pointers.move,"pointerMove"),p.handleEvent(this,window,this.pointers.up,"pointerUp"))))},S.prototype.pointerMove=function(e){var t=this.mapPoint(e),n=p.getParent(e.target,this.options.drop);this.droppable=n||this.droppable,this.delta={x:Math.round(t.clientX)-this.pointer.x,y:Math.round(t.clientY)-this.pointer.y},this.sorting?(e.preventDefault(),e.stopPropagation(),this.moveDraggedItem(),this.sortItems(t)):(5<Math.abs(this.delta.x)||5<Math.abs(this.delta.y))&&(this.pointer.x+=this.delta.x,this.pointer.y+=this.delta.y,this.sorting=!0,this.addDraggedItem(),this.pointerMove(e),document.body.classList.add("wpgb-dragging"),p.dispatchEvent(window,"wpgb_builder.sort_start",{element:this.draggable,droppable:this.droppable}))},S.prototype.pointerUp=function(e){p.handleEvent(this,window,this.pointers.move,"pointerMove",!1),p.handleEvent(this,window,this.pointers.up,"pointerUp",!1),this.sorting&&(Y=!0,p.dispatchEvent(window,"wpgb_builder.sort_end",{element:this.draggable,droppable:this.droppable})),"absolute"!==this.computed.position&&this.draggedItem&&(this.delta.x||this.delta.y)?(Y=!0,this.revertItem()):this.revertEnd()},S.prototype.revertItem=function(){var e=this.draggable.getBoundingClientRect(),t=this.getScrollOffset();p.handleEvent(this,this.draggedItem,[this.transitionend],"revertEnd"),this.draggable.classList.remove(this.options.classes.placeholder),this.draggedItem.style.transition="transform 0.3s",this.draggedItem.style.transform="translate3d("+(t.left+e.left)+"px,"+(t.top+e.top)+"px,0)",this.draggable.classList.add(this.options.classes.placeholder)},S.prototype.revertEnd=function(){document.body.classList.remove("wpgb-dragging"),this.draggable.classList.remove(this.options.classes.placeholder),this.removeDraggedItem(),this.sorting=!1},S.prototype.addDraggedItem=function(){this.initial=this.draggable.getBoundingClientRect(),this.computed=this.getComputedStyle(this.draggable),this.draggedItem=this.draggable.cloneNode(!0),this.draggedItem.style.width=this.initial.width+"px",this.draggedItem.style.height=this.initial.height+"px",this.draggedItem.style.padding=this.computed.padding,this.draggedItem.style.fontSize=this.computed.fontSize,this.draggedItem.style.lineHeight=this.computed.lineHeight,this.draggedItem.style.color=this.computed.color,this.draggedItem.classList.add(this.options.classes.dragged),this.draggable.classList.add(this.options.classes.placeholder),document.body.appendChild(this.draggedItem)},S.prototype.removeDraggedItem=function(){this.draggedItem&&(p.handleEvent(this,this.draggedItem,[this.transitionend],"revertEnd",!1),this.draggedItem=this.draggedItem.parentNode.removeChild(this.draggedItem),this.draggedItem=null)},S.prototype.moveDraggedItem=function(){var e,t,n=this.options.grid,i=this.getScrollOffset(),o=(this.snapTo||this.droppable.parentElement).getBoundingClientRect(),r={x:this.initial.left+this.delta.x,y:this.initial.top+this.delta.y};n&&"absolute"===this.computed.position&&(e=n&&n[0],t=n&&n[1],n=e?(o.left/e-Math.round(o.left/e))*e:0,o=t?(o.top/t-Math.round(o.top/t))*t:0,r.x=e?n+Math.round(r.x/e)*e:r.x,r.y=t?o+Math.round(r.y/t)*t:r.y),r.x+=i.left,r.y+=i.top,this.draggedItem.style.transform="translate3d("+r.x+"px,"+r.y+"px,0)",this.moveDraggable(i,r)},S.prototype.moveDraggable=function(e,t){var n,i,o;"absolute"===this.computed.position&&(n=this.droppable.parentElement.getBoundingClientRect(),i=window.getComputedStyle(this.droppable.parentElement),o=window.getComputedStyle(this.draggable),t.x=t.x-(n.left+e.left+parseInt(o.marginLeft,10)+parseInt(i.borderLeftWidth,10)),t.y=t.y-(n.top+e.top+parseInt(o.marginTop,10)+parseInt(i.borderTopWidth,10)),t.element=this.draggable,this.draggable.style.left=t.x+"px",this.draggable.style.top=t.y+"px",p.dispatchEvent(window,"wpgb_builder.sort_move",t))},S.prototype.sortItems=function(e){var t=this.droppable.children,n=this.getScrollOffset(),i=!1,o={},r=n.left+Math.round(e.clientX),s=n.top+Math.round(e.clientY);if(t.length){if("absolute"!==this.computed.position)for(var a=0,l=t.length;a<l;a++)if(t[a]!==this.draggable){if("absolute"!==(o=this.getComputedStyle(t[a])).position&&o.left<r&&o.right>r&&o.top<s&&o.bottom>s){var c=s<o.top+(o.bottom-o.top)/2,d=(c="inline-block"===o.display&&"inline-block"===this.computed.display?r<o.left+(o.right-o.left)/2:c)?t[a]:t[a].nextSibling;return(c?t[a].previousSibling:t[a].nextSibling)===this.draggable?void 0:void this.droppable.insertBefore(this.draggable,d)}}else i=!0;else if(!this.droppable.contains(this.draggable))return void this.droppable.appendChild(this.draggable);!i&&s<o.bottom?this.droppable.insertBefore(this.draggable,this.droppable.firstElementChild):!i&&s>o.bottom&&this.droppable.appendChild(this.draggable)}else this.droppable.appendChild(this.draggable)},S.prototype.getScrollOffset=function(){return{left:window.pageXOffset,top:window.pageYOffset}},S.prototype.getComputedStyle=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e),i=this.getScrollOffset(),o=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),r=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),s=parseInt(n.borderLeftWidth,10)+parseInt(n.borderRightWidth,10),a=parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10),l=parseInt(n.marginLeft,10)+parseInt(n.borderLeftWidth,10),c=parseInt(n.marginTop,10)+parseInt(n.borderTopWidth,10),s=t.right-t.left+o+s,a=t.bottom-t.top+r+a;return"block"===n.display&&(s=e.parentElement.clientWidth),{position:n.getPropertyValue("position"),display:n.getPropertyValue("display"),top:i.top+t.top-c,right:i.left+t.left-l+s,bottom:i.top+t.top-c+a,left:i.left+t.left-l,fontSize:n.getPropertyValue("font-size"),lineHeight:n.getPropertyValue("line-height"),padding:n.getPropertyValue("padding"),color:n.getPropertyValue("color")}},S.prototype.snapToGrid=function(e){e=e.target.checked;document.querySelector(".wpgb-builder-grid").style.display=e?"block":"none",this.options.grid=e?[10,10]:""};function E(){this.pointers=p.detectPointers(),p.handleEvent(this,document,this.pointers.down,"pointerDown")}E.prototype.mapPoint=function(e){e=e.touches?e.changedTouches:[e];return e[0]||{}},E.prototype.pointerDown=function(e){var t,n=(n=p.getParent(e.target,".wpgb-handle-resize"))||p.getParent(e.target,".wpgb-panel-title");n&&(p.getParent(e.target,".wpgb-panel-close")||(this.element=n.parentNode,this.method=n.classList.contains("wpgb-handle-resize")?"resize":"drag",t=this.element.getBoundingClientRect(),n=window.getComputedStyle(this.element),this.size={top:t.top+window.pageYOffset,left:t.left+window.pageXOffset,height:parseInt(n.getPropertyValue("height"),10),width:parseInt(n.getPropertyValue("width"),10),window:{width:window.innerWidth,height:window.innerHeight}},document.body.classList.add("wpgb-dragging"),p.handleEvent(this,window,this.pointers.move,"pointerMove"),p.handleEvent(this,window,this.pointers.up,"pointerUp"),e=this.mapPoint(e),this.pointer={x:Math.round(e.clientX),y:Math.round(e.clientY)},document.body.click()))},E.prototype.pointerMove=function(e){e.preventDefault(),e.stopPropagation();var t=this.mapPoint(e);this.delta={x:Math.round(t.clientX)-this.pointer.x,y:Math.round(t.clientY)-this.pointer.y},"resize"===this.method?(this.element.style.height=this.size.height+this.delta.y+"px",this.element.style.width=this.size.width+this.delta.x+"px"):(5<Math.abs(this.delta.x)||5<Math.abs(this.delta.y))&&(e=this.size.top+this.delta.y-window.pageYOffset,t=this.size.left+this.delta.x-window.pageXOffset,this.element.style.top=Math.min(this.size.window.height-100,Math.max(32,e))+"px",this.element.style.left=Math.min(this.size.window.width-this.size.width,Math.max(0,t))+"px")},E.prototype.pointerUp=function(e){document.cookie="wpgb_panel_size="+this.element.clientWidth+","+this.element.clientHeight+","+parseInt(this.element.style.top)+","+parseInt(this.element.style.left),p.handleEvent(this,window,this.pointers.move,"pointerMove",!1),p.handleEvent(this,window,this.pointers.up,"pointerUp",!1),document.body.classList.remove("wpgb-dragging")};function C(){Object.keys(W).forEach(function(e){N["'"+e+"'"]=e})}var T,L,P,N=[],O={text:function(e){return(e=p.extend(e,{ID:"text",value:"",placeholder:""})).angle_quotes&&(e.value=e.value.replace(/&lt;/g,"<")),["input",{type:"text",class:"wpgb-input wpgb-text",id:e.uid,name:e.id,value:e.value,placeholder:e.placeholder,autocomplete:"off"}]},url:function(e){return O.text(e)},number:function(e){return["input",{type:"number",class:"wpgb-input wpgb-number",id:(e=p.extend(e,{ID:"number",value:"",min:0,max:"9999",step:1})).uid,name:e.id,value:e.value,min:e.min,max:e.max,step:e.step}]},text_number:function(e){return["input",{type:"text",class:"wpgb-input wpgb-text-number",id:(e=p.extend(e,{ID:"text-number",value:"",min:0,max:9999,step:1,steps:[],units:[],tooltip:""})).uid,name:e.id,value:e.value,"aria-label":e.tooltip,"data-min":e.min,"data-max":e.max,"data-steps":JSON.stringify(e.steps),"data-units":JSON.stringify(e.units),autocomplete:"off"}]},code:function(e){return["textarea",{class:"wpgb-code",id:(e=p.extend(e,{ID:"code",value:"",mode:"javascript",height:"204",placeholder:""})).uid,name:e.id,rows:"5",cols:"25",placeholder:e.placeholder,"data-mode":e.mode,"data-height":e.height,value:e.value}]},slider:function(e){e=p.extend(e,{ID:"slider",value:0,min:0,max:100,step:1,steps:[],units:[]});var t=parseFloat(e.value||0),n=100*(t-e.min)/(e.max-e.min)+.5,n=(""!==e.value?Math.min(100,wpgb_L10n.RTL?100-n:n):0)+"% 100%";return["div",{class:"wpgb-range"},["input",{type:"range",class:"wpgb-input wpgb-range-slider",id:e.uid,style:{"background-size":n},min:e.min,max:e.max,step:.001,"data-steps":JSON.stringify(e.steps),"data-units":JSON.stringify(e.units),value:t}],["input",{type:"text",class:"wpgb-input wpgb-range-slider-value",name:e.id,value:e.value,"aria-label":e.label,autocomplete:"off"}]]},toggle:function(e){return["div",{class:"wpgb-toggle"},["input",{type:"checkbox",class:"wpgb-input wpgb-checkbox",id:(e=p.extend(e,{ID:"switch",value:0})).uid,name:e.id,value:1,checked:e.value}],["span"]]},file:function(e){return["div",{class:"wpgb-upload-file"},["input",{type:"text",id:(e=p.extend(e,{ID:"file",label:"upload",value:0,placeholder:"",mime_type:"image"})).uid,name:e.id,value:e.value,placeholder:e.placeholder,autocomplete:"off"}],["button",{class:"wpgb-button wpgb-button-small wpgb-upload-media",type:"button","data-mime-type":e.mime_type},G.L10n.labels.file_uploader]]},color:function(e){return["div",{class:"wpgb-color","data-gradient":(e=p.extend(e,{ID:"color",value:"",gradient:"",alpha:!1,label:"Select Color",clear:"Clear"})).gradient,"data-alpha":e.alpha},["div",{class:"wpgb-color-picker"},["input",{class:"wpgb-input wpgb-color-picker-input",id:e.uid,name:e.id,value:e.value,readonly:!0}],["span",{class:"wpgb-color-picker-preview",style:{background:e.value}}],["span",{class:"wpgb-color-picker-text"},G.L10n.labels.color_picker]],["div",{class:"wpgb-color-clear"},e.clear]]},font_family:function(e){return e.options["Google Fonts"]=N,T=e.value,e},font_weight:function(t){var e=W[T.replace(/'/g,"")],n=e?e.variants:null;return n&&Object.keys(t.options).forEach(function(e){n.indexOf(e)<0&&"400"!==e&&delete t.options[e]}),t},radio:function(e){var t,n,i,o;if((e=p.extend(e,{ID:"radio",value:"",options:{},icons:{},style:""})).options){for(var r in t="list"===e.style?["ul",{class:"wpgb-radio-list wpgb-list"}]:["div",{class:"wpgb-radio-list"}],e.options)e.options.hasOwnProperty(r)&&(n="wpgb-"+Math.random().toString(36).substr(2,9),i=e.value===r||null,o=e.icons&&e.icons[r]?C.prototype.buildSVGIcon(e.icons[r]):"",t.push(["list"===e.style?"li":"span",{class:"list"===e.style?"wpgb-list-item":"wpgb-radio-item"},["input",{type:"radio",class:"wpgb-input wpgb-radio wpgb-sr-only",id:n,name:e.id,value:r,checked:i}],["label",{for:n},o,["span",e.options[r]]]]));return t}},checkbox:function(e){if((e=p.extend(e,{ID:"checkbox",value:"",options:{},icons:{}})).options){var t,n,i,o,r=["ul",{class:"wpgb-checkbox-list"}],s=Object.keys(e.options).length;for(t in e.options)e.options.hasOwnProperty(t)&&(n="wpgb-"+Math.random().toString(36).substr(2,9),i=e.value===t||null,o=e.icons&&e.icons[t]?C.prototype.buildSVGIcon(e.icons[t]):"",o=[1===s?"div":"li",{class:"wpgb-checkbox-item"},["input",{type:"checkbox",class:"wpgb-input wpgb-checkbox wpgb-sr-only",id:n,name:e.id,value:t,checked:i}],["label",{for:n},o?"":e.options[t],o]],1===s?r=o:r.push(o));return r}},select:function(e){var t=["select",{class:"wpgb-select",id:(e=p.extend(e,{ID:"select",value:"",options:{},multiple:"",placeholder:"",search:"",async:"",validate:!1})).uid,name:e.id,"data-search":e.search,"data-async":e.async,multiple:e.multiple}];if((e="font-family"===(e="font-weight"===e.id?O.font_weight(e):e).id?O.font_family(e):e).options){for(var n in e.placeholder&&t.push(["option",{value:""},e.placeholder]),e.async&&e.value&&!e.options.hasOwnProperty(e.value)&&(e.options[e.value]=e.value),e.options)if(e.options.hasOwnProperty(n)){var i=!!(e.multiple&&e.value&&e.value.length&&-1<e.value.indexOf(n)||e.value===n)||null;if(Array.isArray(e.options[n])||"object"==typeof e.options[n]){var o,r=["optgroup",{label:n}];for(o in e.options[n])e.options[n].hasOwnProperty(o)&&(i=!!(e.multiple&&-1<e.value.indexOf(o)||e.value===o)||null,r.push(["option",{value:o,selected:i},e.options[n][o]]));t.push(r)}else t.push(["option",{value:n,selected:i},e.options[n]])}return t}},icons:function(e){return e=p.extend(e,{ID:"icon",value:"",label:"Select Icon"}),["div",{class:"wpgb-icon"},["div",{class:"wpgb-icon-picker"},["span",{class:"wpgb-icon-picker-svg"}],["span",{class:"wpgb-icon-picker-label"},G.L10n.labels.icon_picker],["input",{type:"hidden",class:"wpgb-input",name:e.id,value:e.value}]]]},notabene:function(e){return e=p.extend(e,{value:""}),["p",{class:"wpgb-nota-bene"},C.prototype.buildSVGIcon(G.icons.info),e.value]},group:function(e){for(var t=["div",{class:"wpgb-field-group wpgb-group-"+e.id}],n=0;n<e.fields.length;n++){var i={class:"wpgb-settings-sub-field wpgb-field-"+e.fields[n].id};e.fields[n].conditional_logic&&(i["data-field-condition"]=JSON.stringify(e.fields[n].conditional_logic)),e.fields[n].uid=1<e.fields.length?"wpgb-"+Math.random().toString(36).substr(2,9):e.uid,t.push(["div",i,e.fields[n].label?["label",{class:"wpgb-field-label",for:e.fields[n].uid},e.fields[n].label]:null,O[e.fields[n].type](e.fields[n])])}return t},blocks:function(e){for(var t=["div",["div",{class:"wpgb-search-field"},C.prototype.buildSVGIcon(G.icons.search),["input",{type:"search",class:"wpgb-input wpgb-search-blocks","aria-label":e.placeholder,placeholder:e.placeholder}]]],n=0;n<wpgb_builder_blocks.length;n++)if(wpgb_builder_blocks[n].blocks){t.push(["h3",wpgb_builder_blocks[n].label]);var i,o,r=["ul",{class:"wpgb-list wpgb-blocks-list wpgb-list-flex"}];for(i in wpgb_builder_blocks[n].blocks)wpgb_builder_blocks[n].blocks.hasOwnProperty(i)&&(o=wpgb_builder_blocks[n].blocks[i],r.push(["li",{class:"wpgb-list-item wpgb-default-block"},C.prototype.buildSVGIcon(e.icons[o.icon]||o.icon||G.icons.custom_block),["span",o.name],["div",C.prototype.buildSVGIcon(G.icons.plus)]]));t.push(r)}return t}};C.prototype.buildSVGIcon=function(e){if(e)return["svg",["use",{"xlink:href":e}]]},C.prototype.buildFields=function(e,t){var n=["div",{class:"wpgb-panel-fields"}];if(e.forEach(function(e){e&&"group"===e.type?e.fields.forEach(function(e){e.value=e.id&&t.hasOwnProperty(e.id)?t[e.id]:void 0!==e.value?e.value:""}):e.value=e.id&&t.hasOwnProperty(e.id)?t[e.id]:void 0!==e.value?e.value:"",n.push("title"===e.type&&e.title?["h3",e.title]:this.buildField(e))}.bind(this)),n[2])return n},C.prototype.buildField=function(e){var t={class:"wpgb-settings-field wpgb-field-"+e.id.replace("_","-")};if(O[e.type]){e.conditional_logic&&(t["data-field-condition"]=JSON.stringify(e.conditional_logic)),e.uid="wpgb-"+Math.random().toString(36).substr(2,9);var n="radio"!==e.type&&"checbox"!==e.for&&"gallery"!==e.type&&"image"!==e.for;return e.label?"group"===e.type&&1<e.fields.length?["div",t,["span",{class:"wpgb-field-label"},e.label,this.buildTooltip(e)],["div",{class:"wpgb-field-input"},O[e.type](e)]]:["div",t,n?["label",{class:"wpgb-field-label",for:e.uid},e.label,this.buildTooltip(e)]:["span",{class:"wpgb-field-label"},e.label,this.buildTooltip(e)],"group"!==e.type?["div",{class:"wpgb-field-input"},O[e.type](e)]:O[e.type](e)]:["div",t,"group"!==e.type?["div",{class:"wpgb-field-input"},O[e.type](e)]:O[e.type](e)]}},C.prototype.buildPanel=function(e,t){var n=["div",{class:"wpgb-panel "+(t?"wpgb-draggable-panel ":"")+"wpgb-"+e.id+"-panel",role:"dialog","aria-modal":!0,tabindex:"-1"},e.title?["div",{class:"wpgb-panel-title"},["h3",e.title,["span",{class:"wpgb-block-name"}]],["button",{class:"wpgb-button wpgb-panel-close",type:"button","aria-label":"close"},this.buildSVGIcon(G.icons.cross)]]:""];return e.tabs&&n.push(this.buildTabs(e.tabs)),e.footer&&n.push(this.buildFooter(e.footer)),t&&n.push(["div",{class:"wpgb-handle-resize"}]),n},C.prototype.buildFooter=function(e){if(e.buttons){var n=["div",{class:"wpgb-panel-footer"}];return e.buttons.forEach(function(e){var t=["button",{class:"wpgb-panel-button "+e.class,type:"button","aria-label":e.label,"data-tooltip":""}],e=this.buildSVGIcon(G.icons[e.icon]);t.push(e),n.push(t)}.bind(this)),n}},C.prototype.buildToggles=function(e,o,r){var s=["div",{class:"wpgb-panel-toggles",role:"presentation"}],a=this.buildSVGIcon(G.icons["chevron-down"]);return e.forEach(function(e,t){var n,i;"accordion"===e.type&&(e.tab!==r&&!Array.isArray(e.tab)&&e.tab.indexOf(r)<0||(n=this.hasSettings(e.id,o),i="wpgb-toggle-"+Math.random().toString(36).substr(2,9),s.push(["div",{class:"wpgb-panel-toggle",role:"heading","aria-level":3,"data-wpgb":e.id},["div",{class:"wpgb-panel-toggle-title"},["button",{class:"wpgb-panel-toggle-button",type:"button","aria-expanded":!1,"aria-controls":i},e.title,["span",{class:n?"wpgb-hassettings":""}],a]],["div",{class:"wpgb-panel-toggle-content",id:i,role:"region"}]])))}.bind(this)),s},C.prototype.hasSettings=function(t,e){var n=[];if(!e)return!1;for(var i=0,o=(n=(n=(n=(n=G.panels.blocks.fields).concat(G.panels.layers.fields)).filter(function(e){return e.id===t&&"accordion"===e.type}))&&n[0]&&n[0].fields).length;i<o;i++){if("group"===n[i].type)for(var r=n[i].fields,s=0,a=r.length;s<a;s++)if(e.hasOwnProperty(r[s].id)&&""!==e[r[s].id])return!0;if(e.hasOwnProperty(n[i].id)&&""!==e[n[i].id])return!0}return!1},C.prototype.buildTabs=function(e){var i=["ul",{class:"wpgb-panel-tabs",role:"tablist"}];return e&&e.length&&e.forEach(function(e,t){var n=e.icon?this.buildSVGIcon(e.icon):"";i.push(["li",{class:"wpgb-panel-tab",role:"tab","aria-selected":t?"false":"true",tabindex:t?"-1":"0","data-wpgb":e.id},n,e.label])}.bind(this)),i},C.prototype.buildTooltip=function(e){if(e.tooltip)return["span",{role:"tooltip","aria-label":e.tooltip,"data-tooltip":"","data-layout":"large"},this.buildSVGIcon(G.icons.info)]},(L=jQuery)(function(){var e="li.wpgb-panel-tab";function t(e,t){var n=0;switch(e.keyCode){case 37:case 38:n=-1;break;case 39:case 40:n=1}n&&(e.preventDefault(),t&&function e(t,n){var i=t.parentElement.children;t=1===n?(t=t.nextElementSibling)||i[0]:(t=t.previousElementSibling)||i[i.length-1];if(null===t.offsetParent)return void e(t,n);o(t);t.focus();t.click()}(e.target,n))}function o(e){for(var t=e.parentElement.children,n=0,i=t.length;n<i;n++){var o=e===t[n],r=o?"true":"false";t[n].setAttribute("tabindex",o?"0":"-1"),t[n].setAttribute("aria-selected",r)}}L(document).on("keydown",e,function(e){t(e,!1)}),L(document).on("keyup",e,function(e){t(e,!0)})});function A(){if(P)return P;M.forEach(function(e){var t=document.createElement("style");document.head.appendChild(t),this[e+"Sheet"]=t.sheet}.bind(this)),P=this}var M=["layout","idle","idlebefore","idleafter","hover","hoverbefore","hoverafter","animate","custom","import","test"];A.prototype.getStyleSheet=function(e){return(e&&-1<M.indexOf(e)?e:"idle")+"Sheet"},A.prototype.addRules=function(e,t,n){var i;e=this.getStyleSheet(e),"@import"!==t?(i=this.rulesExist(e,t,n))?this.addRule(i,n):(n=this.buildRules(n))&&this.insertRules(e,t+"{"+n+"}"):this[e].insertRule(t+" url("+n+")",0)},A.prototype.rulesExist=function(e,t,n){for(var i=0,o=(n=this[e].cssRules).length;i<o;i++)if(n[i].selectorText===t)return n[i].style},A.prototype.addRule=function(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e.hasOwnProperty(n)&&e[n]===t[n]||e.setProperty(n,t[n]))},A.prototype.buildRules=function(e){var t,n="";if(!e)return n;for(t in e)e.hasOwnProperty(t)&&""!==e[t]&&(n+=t+":"+e[t]+";");return n},A.prototype.insertRules=function(e,t){try{var n=this[e].cssRules.length;this[e].insertRule(t,n)}catch(e){return""}},A.prototype.checkRule=function(e,t){var n=!0,i=".check-rule";try{var o=i+"{"+e+":"+t+"}",r=this.testSheet.cssRules.length;this.testSheet.insertRule(o,r),this.testSheet.cssRules[r].style[e]||(n=!1)}catch(e){this.deleteRules("test",i),n=!1}return this.deleteRules("test",i),n},A.prototype.deleteRules=function(e,t){e=this.getStyleSheet(e);for(var n=this[e].cssRules,i=n.length-1;0<=i;i--)n[i]&&n[i].selectorText&&n[i].selectorText.match(t+"\\b")&&this[e].deleteRule(i)},A.prototype.duplicateRules=function(e,t,n){e=this.getStyleSheet(e);for(var i,o=this[e].cssRules,r=0,s=o.length;r<s;r++){if(!o[r]||!o[r].selectorText)return;o[r].selectorText.match(t+"\\b")&&(i=o[r].cssText.replace(t,n),this.insertRules(e,i))}},A.prototype.getRules=function(e,t){return e=this.getStyleSheet(e),this[e].cssRules};function z(){}z.element=null,z.prototype.init=function(){this.styleSheet=new A,this.buildCard(),new S,new E,this.bindEvents()},z.prototype.bindEvents=function(){window.addEventListener("wpgb_builder.resize_move",this.onResizeMove.bind(this)),window.addEventListener("wpgb_builder.resize_end",this.onResizeEnd.bind(this)),window.addEventListener("wpgb_builder.sort_start",this.onSortStart.bind(this)),window.addEventListener("wpgb_builder.sort_move",this.onSortMove.bind(this)),window.addEventListener("wpgb_builder.sort_end",this.onSortEnd.bind(this)),document.addEventListener("click",this.click.bind(this)),document.addEventListener("input",this.onChange.bind(this)),document.addEventListener("input",this.searchBlocks.bind(this)),document.addEventListener("change",p.throttle(this.onChange.bind(this))),document.querySelector('[data-action="preview"] input').addEventListener("click",this.previewCard.bind(this),!0),document.querySelector('[data-action="save"]').addEventListener("click",this.saveCard.bind(this),!0),window.addEventListener("beforeunload",this.beforeunload.bind(this))},z.prototype.beforeunload=function(e){if(!0===Y)return e.returnValue=wpgb_popup_L10n.beforeunload,e.returnValue},z.prototype.searchBlocks=function(e){var t=e.target;if("INPUT"===t.tagName&&"search"===t.type&&t.classList.contains("wpgb-search-blocks")){var n=t.value.toLowerCase(),i=(t.parentElement,document.querySelectorAll(".wpgb-blocks-list")),o=!1;String.prototype.normalize&&(n=n.normalize("NFD").replace(/[\u0300-\u036f]/g,""));for(var r=0,s=i.length;r<s;r++){for(var a=!1,l=i[r].children,c=0,d=l.length;c<d;c++){var p=l[c];-1<p.children[1].textContent.toLowerCase().indexOf(n)?(o=a=!0,p.removeAttribute("style")):p.style.display="none"}a?(i[r].removeAttribute("style"),i[r].previousSibling.removeAttribute("style")):(i[r].style.display="none",i[r].previousSibling.style.display="none")}e=t.parentNode.nextSibling;e="SPAN"===e.tagName?e:null,!n||o||e?o&&e&&e.parentNode.removeChild(e):((e=document.createElement("span")).textContent=G.L10n.messages.no_results,t.parentNode.parentNode.insertBefore(e,t.parentNode.nextSibling))}},z.prototype.previewCard=function(e){var t=document.querySelector(".wpgb-builder-holder");t.style.display="none",t.classList[this.preview?"remove":"add"]("wpgb-preview");t.clientHeight;t.style.display="",this.preview=!this.preview},z.prototype.getItemName=function(e){return e=e.match("block")?e.replace("wpgb-block-","Block "):G.L10n.layers[e]||e},z.prototype.refreshCodeMirror=function(){for(var e=document.querySelectorAll(".CodeMirror"),t=0;t<e.length;t++)e[t].CodeMirror.refresh()},z.prototype.getSettings=function(e){var e=p.getParent(e,".wpgb-panel"),t=e.querySelectorAll(".wpgb-panel-tab"),n=U[e.wpgb];if("general"===e.wpgb)return n;n.hasOwnProperty(this.element)&&n[this.element]?n=n[this.element]:n[this.element]={};for(var i=0;i<t.length;i++)t[i].wpgbActive&&((!n[t[i].wpgb]||Object.keys(n[t[i].wpgb]).length<1)&&(n[t[i].wpgb]={}),n=n[t[i].wpgb]);return n},z.prototype.click=function(e){var t=e.target,n=!!t&&t.previousSibling;"LABEL"===t.tagName&&n&&"radio"===n.type&&(["font-style","text-transform","text-decoration","text-align","color_scheme"].indexOf(n.name)<0||n.checked&&(e.preventDefault(),e.stopImmediatePropagation(),n.checked=!n.checked,p.dispatchHTMLEvent(n,"change")))},z.prototype.onChange=function(e){var t=e.target;if(("input"!==e.type||"radio"!==t.type)&&t.name){var n=p.getParent(t,".wpgb-panel");if(n){var e=n.querySelectorAll(".wpgb-panel-tab.wpgb-active-tab"),i=t.value,n=e[e.length-1].wpgb,e=this.getSettings(t);if("checkbox"===t.type&&(i=t.checked?1:0),"radio"!==t.type||t.checked||(i=""),"SELECT"===t.tagName&&t.multiple)for(var i=[],o=t.children,r=0,s=o.length;r<s;r++)o[r].selected&&o[r].value&&i.push(o[r].value);e[t.name]=i,"color_scheme"!==t.name&&"color"!==t.name||this.setColorScheme(this.element,n,t),this.onStyleChange(n,t,e),this.onContentChange(n,t,e),this.onLayoutChange(n,t,e),this.formatCustomCSS(n,t,e),Y=!0}}},z.prototype.setColorScheme=function(e,t,n){var i=document.querySelector("."+e);if(i.wpgbName&&U.blocks.hasOwnProperty(e)){var o=i.className.match(/wpgb-idle-scheme-([0-9]+)[^\b]*?|wpgb-hover-scheme-([0-9]+)[^\b]*?|wpgb-idle-accent-([0-9]+)[^\b]*?|wpgb-hover-accent-([0-9]+)[^\b]*?/gi),r=U.blocks[e],s=r?r.style:"",a=s&&s.idle?s.idle.color:"",e=s&&s.hover?s.hover.color:"",l=s&&s.hover?s.hover.hover_selector:"",a=s&&s.idle&&!a?s.idle.color_scheme:"",c=s&&s.hover&&!e?s.hover.color_scheme:"";if(o&&o.forEach(function(e){i.classList.remove(e)}),t&&((o="idle"===t?a:c)?r.content[t+"_scheme"]=o:delete r.content[t+"_scheme"]),"hover"!==t||l?"hover_selector"===n.name&&(r.content.hover_scheme=c):delete r.content.hover_scheme,a&&i.classList.add("wpgb-idle-"+a),c&&l&&("post_field"!==r.content.source||"the_terms"!==r.content.post_field))i.classList.add("wpgb-hover-"+c);else if("post_field"===r.content.source&&"the_terms"===r.content.post_field)for(var d=0,p=i.children.length;d<p;d++)i.children[d].classList.contains("wpgb-block-term")&&(i.children[d].className="wpgb-block-term",c&&l&&i.children[d].classList.add("wpgb-hover-"+c))}},z.prototype.formatCustomCSS=function(e,t,n){if("custom_css"===e){for(var i=this.parseCSS(t.value),o=this.styleSheet.customSheet.rules.length-1,r=0;r<=o;o--)this.styleSheet.customSheet.deleteRule(o);for(o=0,r=i.length;o<r;o++)this.styleSheet.insertRules("customSheet",i[o])}},z.prototype.onStyleChange=function(t,n,i){if(-1<["idle","hover","animation"].indexOf(t)){if("idle"===t||"hover"===t){if(this.formatProperties(n,i),"hover_selector"===n.name)return["","before","after"].forEach(function(e){this.styleSheet.deleteRules(t+e,this.element),n.value&&this.renderStyles(this.element,t,e,i)}.bind(this)),void this.setColorScheme(this.element,t,n);var e=-1<n.name.indexOf("custom_css_")?n.name.replace("custom_css_",""):"";-1<n.name.indexOf("custom_css")&&this.styleSheet.deleteRules(t+e,this.element),this.renderStyles(this.element,t,e,i)}"animation"===t&&(this.animationPresets(n,i),this.formatAnimation(n,i),n&&"selector"===n.name&&this.styleSheet.deleteRules("animate",this.element),n&&"custom"!==i.presets&&n.name.match("transform|translate|rotate|scale|skew|perspective")&&(document.querySelector('[name="presets"][value="custom"]').checked=!0,i.presets="custom"),this.renderAnimation(this.element,i)),this.checkPosition(n,i)}},z.prototype.onContentChange=function(e,t,n){"content"===e&&("source"===t.name&&"raw_content_block"===t.value&&this.refreshCodeMirror(),this.renderContent(this.element,n))},z.prototype.onLayoutChange=function(e,t,n){"general"===e&&t&&"name"!==t.name&&this.formatLayout(n)},z.prototype.formatLayout=function(e){var t,n,i=document.querySelector(".wpgb-card"),o=document.querySelector(".wpgb-card-header"),r=document.querySelector(".wpgb-card-content"),s=document.querySelector(".wpgb-card-footer"),a=document.querySelector(".wpgb-card-media"),l=document.querySelector(".wpgb-card-media-overlay"),c=document.querySelector('.wpgb-edit-layer[data-layer="wpgb-card-media-overlay"]'),d=document.querySelector(".wpgb-builder-holder"),p=document.querySelector(".wpgb-builder-ruler-h"),u=document.querySelector(".wpgb-builder-grid-inner"),h=e.type||"masonry",m=e.content_position,g=e.media_position||"left",f=void 0===e.display_media?1:e.display_media,b=void 0===e.display_overlay?1:e.display_overlay,y=void 0===e.display_footer?1:e.display_footer,v=e.card_layout||"vertical",w=parseInt(e.switch_layout),_=Math.max(300,parseInt(e.card_width,10)||500),S=parseInt(e.media_width,10)||50,x=e.responsive;this.card_layout&&this.card_layout!==v&&(t=(n=document.querySelector('[name="card_width"]')).previousSibling,n.value=e.card_width="vertical"===v?"500px":"1000px",t.value=_=parseFloat(n.value),n=100*(_-t.min)/(t.max-t.min),t.style.backgroundSize=(wpgb_L10n.RTL?100-n:n)+"% 100%"),o.style.display="masonry"!==h||"top"!==m&&"both"!==m?"none":"",r.style.display="masonry"!==h||"bottom"!==m&&"both"!==m?"none":"",a.style.display="masonry"===h&&!f&&m?"none":"",l.style.display=c.style.display=b?"":"none",s.style.display="masonry"!==h||y?"":"none",d.style.width=_+"px",p.style.width=_+"px",u.style.width=_+"px",i.classList.remove("wpgb-horizontal-left","wpgb-horizontal-right"),i.style.fontSize=x?Math.min(_/500*16,999)*("horizontal"===v?.5:1)+"px":"";for(var _={"-webkit-box-flex":1,"-ms-flex-positive":1,"flex-grow":1},k=this.styleSheet.layoutSheet.cssRules.length-1;0<=k;k--)this.styleSheet.layoutSheet.deleteRule(k);"horizontal"===v&&"masonry"===h?(o.style.display="none",r.style.display=a.style.display="",i.classList.add("wpgb-horizontal-"+("right"===g?"left":"right")),g=".wpgb-card-preview .wpgb-card-inner { -ms-flex-direction: "+("right"===g?"row-reverse":"row")+";-webkit-box-orient: horizontal;-webkit-box-direction: "+("right"===g?"reverse":"normal")+";flex-direction: "+("right"===g?"row-reverse":"row")+";}",g+=".wpgb-card-preview .wpgb-card-media { width: "+S+"% }",this.styleSheet.insertRules("layoutSheet","@media screen and (min-width: "+(w||768)+"px) {"+(g+=".wpgb-card-preview .wpgb-card-media + .wpgb-card-content { width: "+(100-S)+"% }")+"}"),this.styleSheet.addRules("layout",".wpgb-card-preview .wpgb-card-content",_)):"vertical"!==v||"masonry"!==h||"bottom"!==m&&"both"!==m?"vertical"===v&&"masonry"===h&&"top"===m?this.styleSheet.addRules("layout",".wpgb-card-preview .wpgb-card-header",_):("vertical"!==v||"masonry"!==h||m)&&"masonry"===h||this.styleSheet.addRules("layout",".wpgb-card-preview .wpgb-card-media",_):this.styleSheet.addRules("layout",".wpgb-card-preview .wpgb-card-content",_),e.flex_media&&"masonry"===h&&(this.styleSheet.addRules("layout",".wpgb-card-preview .wpgb-card-media svg[data-ratio]",{display:"none"}),this.styleSheet.addRules("layout",".wpgb-card-preview .wpgb-card-media-content",{position:"relative",width:"100%"}),this.styleSheet.addRules("layout",".wpgb-card-preview .wpgb-card-media-content-top, .wpgb-card-preview .wpgb-card-media-content-bottom",{position:"relative"})),this.card_layout=v},z.prototype.checkPosition=function(e,t){"position"===e.name&&this.checkDroppables()},z.prototype.animationPresets=function(e,t){if(e&&"presets"===e.name){var n,i,o,r,s,a,l=G.animations[e.value];for(n in l)!l.hasOwnProperty(n)||(i=document.querySelector('.wpgb-draggable-panel [name="'+n+'"]'))&&(i.value=t[n]=l[n],i.classList.contains("wpgb-range-slider-value")&&(r=(o=i.previousSibling).min,s=o.max,a=parseInt(l[n],10),o.value=a,o.style.backgroundSize=100*(a-r)/(s-r)+"% 100%"),"SELECT"===i.tagName&&p.dispatchHTMLEvent(i,"change"))}},z.prototype.onResizeMove=function(e){var t={},n={},i=e.detail.element,o=i.parentElement.parentElement,r=U.blocks[i.wpgbName].style.idle;n.width=r.width?(r.width.match(/px|%|em/gi)||["px"]).shift():"px",r.height?"absolute"===r.position?n.height=(r.height.match(/px|%|em/gi)||["px"]).shift():n.height=(r.height.match(/px|em/gi)||["px"]).shift():n.height="px",t.width="%"===n.width?(e.detail.width/o.clientWidth*100).toFixed(2):parseInt(e.detail.width,10),t.height="%"===n.height?(e.detail.height/o.clientHeight*100).toFixed(2):parseInt(e.detail.height,10),"em"!==n.width&&"em"!==n.height||(o=parseFloat(document.querySelector(".wpgb-card").style.fontSize||16),o=r["font-size"]&&r["font-size"].match(/em/gi)?parseFloat(r["font-size"])*o:parseFloat(r["font-size"]||o)*(o/16),t.width="em"===n.width?Number(Math.round(e.detail.width/o+"e6")+"e-6").toFixed(3):t.width,t.height="em"===n.height?Number(Math.round(e.detail.height/o+"e6")+"e-6").toFixed(3):t.height),e.detail.width&&(r.width=parseFloat(t.width)+n.width),e.detail.height&&(r.height=parseFloat(t.height)+n.height),this.element!==i.wpgbName||(n=document.querySelector(".wpgb-block-panel"))&&(i=n.querySelector('.wpgb-input[name="width"]'),n=n.querySelector('.wpgb-input[name="height"]'),i&&n&&(e.detail.width&&(i.value=r.width),e.detail.height&&(n.value=r.height)))},z.prototype.onResizeEnd=function(e){var t=e.detail.element,e=U.blocks[t.wpgbName].style.idle;this.renderCSS("idle","."+t.wpgbName,"",e),t.removeAttribute("style")},z.prototype.onSortStart=function(e){for(var t=e.detail.element,e=e.detail.droppable,n=e.children,i=!1,o=0,r=n.length;o<r;o++)if(n[o]!==t&&"relative"===window.getComputedStyle(n[o]).getPropertyValue("position")){i=!0;break}i||e.classList.remove("wpgb-filled")},z.prototype.onSortMove=function(e){var t=e.detail.element,n=t.parentElement.parentElement,i=U.blocks[t.wpgbName].style.idle,o={},r=i.left&&0!==Number(i.left)?i.left.match(/px|em|%/gi).shift():"px",s=i.top&&0!==Number(i.top)?i.top.match(/px|em|%/gi).shift():"px";o.left="%"===r?(e.detail.x/n.clientWidth*100).toFixed(2):parseInt(e.detail.x,10),o.top="%"===s?(e.detail.y/n.clientHeight*100).toFixed(2):parseInt(e.detail.y,10),"em"!==r&&"em"!==s||(n=parseFloat(document.querySelector(".wpgb-card").style.fontSize||16),n=i["font-size"]&&i["font-size"].match(/em/gi)?parseFloat(i["font-size"])*n:parseFloat(i["font-size"]||n)*(n/16),o.left="em"===r?Number(Math.round(e.detail.x/n+"e6")+"e-6").toFixed(3):o.left,o.top="em"===s?Number(Math.round(e.detail.y/n+"e6")+"e-6").toFixed(3):o.top),i.left=parseFloat(o.left)+r,i.top=parseFloat(o.top)+s,this.element!==t.wpgbName||(s=document.querySelector(".wpgb-block-panel"))&&(t=s.querySelector('.wpgb-input[name="left"]'),s=s.querySelector('.wpgb-input[name="top"]'),t&&s&&(t.value=i.left,s.value=i.top))},z.prototype.onSortEnd=function(e){this.checkDroppables();var t=e.detail.element;"absolute"===window.getComputedStyle(t).getPropertyValue("position")&&(e=U.blocks[t.wpgbName].style.idle,this.renderCSS("idle","."+t.wpgbName,"",e),t.removeAttribute("style"))},z.prototype.checkDroppables=function(){for(var e=document.querySelectorAll(".wpgb-droppable"),t=0,n=e.length;t<n;t++){var i=e[t].children;if(e[t].classList.remove("wpgb-filled"),0!==i.length)for(var o=0,r=i.length;o<r;o++)if("relative"===window.getComputedStyle(i[o]).getPropertyValue("position")){e[t].classList.add("wpgb-filled");break}}};var I=function(){I.prototype.fonts=[],I.prototype.styleSheet=new A,document.addEventListener("change",this.getFontWeights.bind(this)),document.addEventListener("mouseover",this.getGoogleFont.bind(this))};I.prototype=z.prototype,I.prototype.getGoogleFont=function(e){var t,e=e.target;e&&"LI"===e.tagName&&e.classList&&e.classList.contains("wpgb-select-option")&&(e===this.lastFont||"Open Sans"!==(t=e.wpgb_value.replace(/'/g,""))&&W[t]&&(-1<this.fonts.indexOf(t)||(clearTimeout(this.fontTimeout),this.lastFont=e,this.fontTimeout=setTimeout(function(){this.setGoogleFont(t)}.bind(this),400))))},I.prototype.setGoogleFont=function(e){var t,n;"Open Sans"!==e&&W[e]&&(-1<this.fonts.indexOf(e)||(n=W[e],t=Object.keys(W).indexOf(e)+1,n=e.replace(/ /g,"+")+":"+n.variants.join(",")+"&subsets="+n.subsets.join(","),this.fonts.push(e),this.styleSheet.addRules("import","@import","https://fonts.googleapis.com/css?family="+n),this.styleSheet.addRules("import","#wpgb-select-font-family ul > li:last-child li:nth-child("+t+")",{"font-family":"'"+e+"'"})))},I.prototype.getFontWeights=function(e){var t,n,i,o=p.getParent(e.target,'.wpgb-select[name="font-family"]');o&&(t=o.value.replace(/'/g,""),e=G.panels.blocks.fields,n={},e.forEach(function(e){"font_accordion"===e.id&&e.fields.forEach(function(e){"font-weight"===e.id&&(n=p.clone(e.options))})}),W[t]&&(t=W[t],i=t.variants,Object.keys(n).forEach(function(e){i.indexOf(e)<0&&"400"!==e&&delete n[e]})),this.setFontWeights(o,n),e=null)},I.prototype.setFontWeights=function(e,t){var n,i=p.getParent(e,".wpgb-settings-field").nextSibling.querySelector('select[name="font-weight"]'),e=i.value,o=document.createDocumentFragment();Object.keys(t).forEach(function(e){(n=document.createElement("option")).value=e,n.textContent=t[e],o.appendChild(n)}),p.removeChildren(i),i.appendChild(o),i.querySelector('option[value="'+e+'"]')?i.value=e:i.value=this.findClosestWeight(i,e),p.dispatchHTMLEvent(i,"change"),p.dispatchHTMLEvent(i,"input")},I.prototype.findClosestWeight=function(e,t){for(var n=0,i=400,o=e.children,r=0,s=o.length;r<s;r++){var a=o[r];(!n||Math.abs(a.value-t)<=n)&&(i=a.value,n=Math.abs(a.value-t))}return i};z.prototype.buildCard=function(){var e=U.general,t=U.layers,n=U.blocks;this.formatLayout(e),this.buildCardContent();n=p.merge(t,n);this.buildCardCSS(n),this.checkDroppables()},z.prototype.buildCardContent=function(e){for(var t in e=e||wpgb_builder_layout)if(e.hasOwnProperty(t)&&e[t]&&"object"==typeof e[t])if(e[t].hasOwnProperty("blocks")){var n=e[t].blocks,i=document.querySelector(".wpgb-card-"+t);if(n&&i)for(var o=i.querySelector(".wpgb-droppable"),r=0,s=n.length;r<s;r++){var a=n[r],l=document.createElement("div"),c=a.content.name,a=U.blocks[c];a&&a.content&&(l.wpgbName=c,l.className="wpgb-block "+c,o.appendChild(l),this.renderContent(c,a.content),new _(l))}}else this.buildCardContent(e[t])};var q,R;z.prototype.buildCardCSS=function(e){var n,o;for(n in e)e.hasOwnProperty(n)&&((o=e[n]).animation&&this.renderAnimation(n,o.animation),o.style&&["idle","hover"].forEach(function(t){o.style.hasOwnProperty(t)&&(r=o.style[t])&&(r["font-family"]&&this.setGoogleFont(r["font-family"].replace(/'/g,"")),["","before","after"].forEach(function(e){this.renderStyles(n,t,e,r)}.bind(this)))}.bind(this)));var r=null,t=U.general.global_css,s=this.parseCSS(t);for(i=0,l=s.length;i<l;i++)this.styleSheet.insertRules("customSheet",s[i])};z.prototype.saveCard=function(){q&&q.abort();var n=document.querySelector('[name="wpgb_id"]'),e={inner:{header:"",media:{"media-thumbnail":"","media-overlay":"","media-content":{"media-content-top":"","media-content-center":"","media-content-bottom":""}},content:{body:"",footer:""}}};this.savedFonts={google:{}},this.savedSelectors=[],WPGB_Popup_Message("save_changes","loading");var t=p.clone(U.general);delete t.name,q=jQuery.ajax({url:ajaxurl,type:"POST",data:{nonce:document.querySelector("#wpgb_fields_nonce").value,action:"wpgb_card",method:"save",object:"settings",id:n.value,settings:JSON.stringify({name:U.general.name,type:U.general.type||"masonry",layout:{settings:this.filterSettings(this.getLayoutSettings(e)),layers:this.filterSettings(this.getLayout(e)),fonts:this.savedFonts},settings:{general:t,layers:this.filterSettings(this.getLayers()),blocks:this.filterSettings(this.getBlocks())},css:this.getStyles()})},context:this,error:function(e){WPGB_Popup_Message("unknown","error")},success:function(e){var t;e.success||e.message?(WPGB_Popup_Message("save_changes",e.success?"success":"error",e.message),window.history&&window.history.pushState&&e.content&&(t=WPGB_Query_String.set({create:"",id:e.content}),window.history.replaceState({},"",t),n.value=e.content)):WPGB_Popup_Message("unknown","error")}}),this.savedFonts=this.savedSelectors=null,Y=!1},z.prototype.getLayoutSettings=function(e){return delete(e=this.filterSettings(p.clone(U.general))).name,delete e.global_css,e},z.prototype.getLayout=function(e){for(var t in e)if("object"==typeof e[t]&&e[t]){var n=U.layers["wpgb-card-"+t]||{},i=this.getLayout(e[t]);"media"===t||!i||Object.keys(i).length?(e[t]=i,e[t].action=n.action||{}):delete e[t]}else{i=document.querySelector(".wpgb-card-"+t);if(i&&i.offsetParent){var o=i.querySelectorAll(".wpgb-droppable > .wpgb-block");if(o.length||"media"===t||"media-thumbnail"===t||"media-overlay"===t){n=U.layers["wpgb-card-"+t]||{};e[t]={action:n.action||{},blocks:[]};for(var r=0,s=o.length;r<s;r++){var a=o[r].wpgbName,l=U.blocks[a],c=l.content||{},l=l.action||{};c.name=a,e[t].blocks.push(this.normalizeBlock({content:c,action:l})),this.savedSelectors.push(a),0}}else delete e[t]}else delete e[t]}return e},z.prototype.getLayers=function(e){for(var t={},n=document.querySelectorAll(".wpgb-card .wpgb-layer"),i=0,o=n.length;i<o;i++){var r=n[i];r.offsetParent&&((r=r.classList[0])&&(this.savedSelectors.push(r),U.layers[r]&&(t[r]=U.layers[r])))}return this.savedSelectors.push("wpgb-card-media svg[data-ratio]"),this.savedSelectors.push("wpgb-card-media-content-top"),this.savedSelectors.push("wpgb-card-media-content-center"),this.savedSelectors.push("wpgb-card-media-content-bottom"),t},z.prototype.getBlocks=function(e){for(var t,n={},i=0,o=this.savedSelectors.length;i<o;i++)U.blocks[this.savedSelectors[i]]&&(t=U.blocks[this.savedSelectors[i]],n[this.savedSelectors[i]]=this.normalizeBlock(t));return n},z.prototype.normalizeBlock=function(e){if(!e.content)return e;switch(e.content.source){case"post_field":delete e.content.product_field,delete e.content.user_field,delete e.content.term_field;break;case"product_field":delete e.content.post_field,delete e.content.user_field,delete e.content.term_field;break;case"term_field":delete e.content.product_field,delete e.content.post_field,delete e.content.user_field;break;case"user_field":delete e.content.product_field,delete e.content.post_field,delete e.content.term_field;break;default:delete e.content.post_field,delete e.content.product_field,delete e.content.user_field,delete e.content.term_field}return e},z.prototype.filterSettings=function(n){var i,t=this;for(i in n)"object"==typeof n[i]&&n[i]?n[i]=Object.keys(n[i]).filter(function(e){return"object"==typeof n[i][e]&&t.filterSettings(n[i]),""!==n[i][e]&&null!==n[i][e]&&void 0!==n[i][e]}).reduce(function(e,t){return e[t]=n[i][t],e},{}):""!==n[i]&&null!==n[i]&&void 0!==n[i]||delete n[i];return n},z.prototype.downloadDefaultBlock=function(e){var t=0,n={};for(i in e){var i,o=(i=e[i]).content,r=o.source||"post_field",o=o[r]||r;n[r="metadata"===(r="media_button_block"===r||"social_share_block"===r||"svg_icon_block"===r?"media_content":r)||"raw_content_block"===r||"custom_block"===r?"custom_content":r]||(n[r]={label:r,blocks:{}}),this.normalizeBlock(i),n[r].blocks[t]={name:o,settings:i},t++}var s,e=[];for(s in n)e.push(n[s]);var a=new Blob([JSON.stringify(e)],{type:"octet/stream"}),l=URL.createObjectURL(a),a=document.createElement("a");a.href=l,a.download="default-blocks.json",a.textContent="default-blocks.json",document.body.appendChild(a),a.click()},z.prototype.downloadBlocksSettings=function(e){var t={};for(n in e){var n,i=(n=e[n]).content,o=i.source||"post_field",o=i[o]||o;this.normalizeBlock(n),t[o]=n}var r=new Blob([JSON.stringify(t)],{type:"octet/stream"}),s=URL.createObjectURL(r),r=document.createElement("a");r.href=s,r.download="default-blocks.json",r.textContent="default-blocks.json",document.body.appendChild(r),r.click()},z.prototype.getIcons=function(){for(var e,t=[],n=0,i=this.savedSelectors.length;n<i;n++)U.blocks[this.savedSelectors[n]]&&("svg_icon_block"===(e=U.blocks[this.savedSelectors[n]].content).source?t.push(e.svg_name):"social_share_block"===e.source&&t.push("wpgb/social-media/"+e.social_network));return t&&t.filter(function(e,t,n){return n.indexOf(e)===t})},z.prototype.getStyles=function(e){var t="",n=["layout","idle","idlebefore","idleafter","hover","hoverbefore","hoverafter","animate"];this.savedSelectors=this.orderSelector(this.savedSelectors),arr=[];for(var o,r=0,i=this.savedSelectors.length;r<i;r++)n.forEach(function(e){if(this.styleSheet[e+"Sheet"])for(var t,n=0,i=(o=this.styleSheet[e+"Sheet"].cssRules).length;n<i;n++)o[n]&&o[n].selectorText&&(t=new RegExp("(^|[^\\w-])"+this.savedSelectors[r]+"([^\\w-]|$)","g"),o[n].selectorText.match(t)&&(t=o[n].selectorText.replace(" .wpgb-preview",""),arr[this.savedSelectors[r]]||(arr[this.savedSelectors[r]]={}),arr[this.savedSelectors[r]][t]?arr[this.savedSelectors[r]][t]+=this.autoPrefix(o[n]):arr[this.savedSelectors[r]][t]=this.autoPrefix(o[n])))}.bind(this));for(o in arr)for(var s in arr[o])s.indexOf("wpgb-block-")<0&&(t+=s+" {"+this.removeDuplicateDeclarations(arr[o][s])+"}");for(o in arr)for(var s in arr[o])-1<s.indexOf("wpgb-block-")&&(t+=s+" {"+this.removeDuplicateDeclarations(arr[o][s])+"}");return o=this.styleSheet.layoutSheet.cssRules,t+=this.getMediaStyles(o,!1),o=this.styleSheet.customSheet.cssRules,t=(t+=this.getMediaStyles(o,!0)).replace(/.wpgb-card-preview/g,".wp-grid-builder .wpgb-card-preview")},z.prototype.removeDuplicateDeclarations=function(e){for(var t,n=e.split(";"),i=[],o="",r=0,s=n.length;r<s;r++){var a=n[r].trim().split(/:(.+)/);a[0]&&a[1]&&(i[a[0].trim()]=a[1].trim())}for(t in i)o+=t+": "+i[t]+";";return o},z.prototype.getMediaStyles=function(e,t){for(var n="",i=0,o=e.length;i<o;i++)e[i]&&(7!==e[i].type?e[i].cssRules?n+="@media "+e[i].media.mediaText+"{"+this.getMediaStyles(e[i].cssRules,!0)+"}":e[i].href?n+=e[i].cssText:e[i].selectorText&&t&&(n+=e[i].selectorText.replace(" .wpgb-preview","")+"{"+this.autoPrefix(e[i])+"}"):n+=e[i].cssText);return n},z.prototype.orderSelector=function(e){return e.sort(function(e,t){function n(e){for(var t,n=new Array,i=0,o=-1,r=0;s=(t=e.charAt(i++)).charCodeAt(0);){var s=46==s||48<=s&&s<=57;s!==r&&(n[++o]="",r=s),n[o]+=t}return n}var i=n(e),o=n(t);for(x=0;i[x]&&o[x];x++)if(i[x]!==o[x]){var r=Number(i[x]),s=Number(o[x]);return r==i[x]&&s==o[x]?r-s:i[x]>o[x]?1:-1}return i.length-o.length})},z.prototype.autoPrefix=function(e){for(var t=e.cssText.replace(e.selectorText+" {",""),n=(t=t.substring(0,t.length-1)).split(";"),i="",o="",r="",s=0,a=n.length;s<a;s++){var l,c,d=n[s].trim().split(/:(.+)/);d[0]&&d[1]&&(l=d[0].trim(),c=d[1].trim(),("background-position"!==l&&"background-repeat"!==l||"initial initial"!==c)&&("transform"!==l&&"transition-property"!==l&&"transition-duration"!==l&&"transition-delay"!==l&&"transition-timing-function"!==l&&"filter"!==l&&"appearance"!==l?"object-fit"!==l?"flex-direction"!==l?"flex-grow"!==l?"display"!==l||"flex"!==c?"flex"!==l?("font-family"===l&&W[c.replace(/"/g,"")]&&(o=c.replace(/"/g,"")),"font-weight"===l&&(r=parseInt(c,10)),"inset"!==l?i+=l+": "+c+";":(void 0!==e.style.top&&""!==e.style.top&&(i+="top: "+e.style.top+";"),void 0!==e.style.right&&""!==e.style.right&&(i+="right: "+e.style.right+";"),void 0!==e.style.bottom&&""!==e.style.bottom&&(i+="bottom: "+e.style.bottom+";"),void 0!==e.style.left&&""!==e.style.left&&(i+="left: "+e.style.left+";"))):(i+="-ms-flex: "+c+";",i+="flex: "+c+";"):(i+="display: -webkit-box;",i+="display: -ms-flexbox;",i+="display: flex;"):(i+="-webkit-box-flex: "+c+";",i+="-ms-flex-positive: "+c+";",i+="flex-grow: "+c+";"):(d=["column","vertical","normal"],"row"===c?d=["row","horizontal","normal"]:"row-reverse"===c&&(d=["row-reverse","horizontal","reverse"]),i+="-ms-flex-direction: "+d[0]+";",i+="-webkit-box-orient: "+d[1]+";",i+="-webkit-box-direction: "+d[2]+";",i+="flex-direction: "+d[0]+";"):(i+="-o-"+l+": "+c+";",i+=l+": "+c+";"):(i+="-webkit-"+l+": "+c+";",i+=l+": "+c+";")))}return o&&(this.savedFonts.google[o]=this.savedFonts.google[o]||[],W[o].variants.indexOf(r.toString())<0&&(r=W[o].variants.reduce(function(e,t){return Math.abs(parseInt(t,10)-r)<Math.abs(parseInt(e,!0)-r)?t:e})),-1===this.savedFonts.google[o].indexOf(r)&&this.savedFonts.google[o].push(r)),i},z.prototype.renderStyles=function(e,t,n,i){e.match("wpgb-block");var o,r,s=i.hover_selector;if("hover"===t&&(o=this.getParentSelector(e)),e="."+e,-1<["before","after"].indexOf(n)&&(r=i["custom_css"+(n?"_"+n:"")],(i={}).custom_css=r),"hover"===t){if(!s)return;e=((o="card"===s?"":o)||"itself"===s?".wpgb-preview ":".wpgb-preview")+(e="itself"===s?e+":hover":o+":hover "+e)}this.renderCSS(t,e,n,i)},z.prototype.renderCSS=function(e,t,n,i){e+=n,t+=n=n?"::"+n:"",i=p.clone(i),this.validateCustomCSS(n,i),this.setResponsiveFont(n,i),delete i.custom_css,delete i.custom_css_before,delete i.custom_css_after,this.renderFilters(e,t,n,i),this.renderTerms(e,t,n,i),this.styleSheet.addRules(e,".wpgb-card-preview "+t,i),i=null},z.prototype.renderFilters=function(e,t,n,i){i.hasOwnProperty("filter")&&(this.styleSheet.addRules(e,".wpgb-card-preview .wpgb-preview "+t.replace(".wpgb-preview",""),{filter:i.filter}),delete i.filter),i.hasOwnProperty("mix-blend-mode")&&(this.styleSheet.addRules(e,".wpgb-card-preview .wpgb-preview "+t.replace(".wpgb-preview",""),{"mix-blend-mode":i["mix-blend-mode"]}),delete i["mix-blend-mode"])},z.prototype.renderTerms=function(e,t,n,i){var o=t.match(/wpgb-block-(\d*)/);if(o=o?o[0]:null){var r=U.blocks[o];if(r&&r.content&&"post_field"===r.content.source&&"the_terms"===r.content.post_field){var s,a={},l=["position","display","overflow","z-index","clear","float","top","right","bottom","left","width","height","margin-top","margin-right","margin-bottom","margin-left","text-align","line-height","font-size"];for(s in t.indexOf(":hover")<0&&l.push("color"),n&&(l=null),i)"animate"!==e&&(!l||l.indexOf(s)<0)&&(a[s]=i[s],delete i[s]);"animate"===e&&(a.transition=i.transition||""),a&&(t=t.replace(o,o+" .wpgb-block-term"),this.styleSheet.addRules(e,".wpgb-card-preview "+t,a)),"idle"===e&&this.styleSheet.addRules(e,".wpgb-card-preview ."+o+" .wpgb-block-term",{"margin-top":r.content["margin-top"]||"","margin-right":r.content["margin-right"]||"","margin-bottom":r.content["margin-bottom"]||"","margin-left":r.content["margin-left"]||""})}}},z.prototype.renderAnimation=function(e,t){var n,i=this.getParentSelector(e),i="card"===t.selector?"":" "+i,o={opacity:t.opacity<1?t.opacity:"","transition-timing-function":t["transition-timing-function"]||"","transition-duration":t["transition-duration"]||"","transition-delay":t["transition-delay"]||"","transform-origin":t.transform?t["transform-origin"]:"",transform:t.transform||""},r=(t.transform||"").replace(/(translate3d)\((.+?)\)/g,"$1(0,0,0)").replace(/(rotateX)\((.+?)\)/g,"$1(0)").replace(/(rotateY)\((.+?)\)/g,"$1(0)").replace(/(rotateZ)\((.+?)\)/g,"$1(0)").replace(/(scaleX)\((.+?)\)/g,"$1(1)").replace(/(scaleY)\((.+?)\)/g,"$1(1)").replace(/(scaleZ)\((.+?)\)/g,"$1(1)").replace(/(skew)\((.+?)\)/g,"$1(0,0)"),s={opacity:t.opacity<1?1:"",transform:t.transform?r:""};t.reverse&&(s.transform=t.transform||"",o.transform=t.transform?r:"",s.opacity=t.opacity<1?t.opacity:"",o.opacity=t.opacity<1?1:""),this.preview&&(n=document.querySelector(".wpgb-preview ."+e)),this.preview&&n&&(n.style.transition="none"),this.renderCSS("animate",".wpgb-preview ."+e,"",o),this.renderCSS("animate",".wpgb-preview"+i+":hover ."+e,"",s),this.preview&&n&&requestAnimationFrame(function(){setTimeout(function(){n.removeAttribute("style")},0)})},z.prototype.formatAnimation=function(e,t){this.formatTransformOrigin(t),this.formatTransition(t),this.formatTransform(t)},z.prototype.formatProperties=function(e,t){this.formatPosition(e,t),this.formatBoxShadow(e,t),this.formatTextShadow(e,t),this.formatBackgroundImage(e,t),this.formatFilters(e,t)},z.prototype.getParentSelector=function(e){if(!(e=!!e&&document.querySelector("."+e)))return"";e=p.getParent(e.parentElement,".wpgb-layer");if(!e)return"";e=e.classList;return e.contains("wpgb-card-header")?".wpgb-card-header":e.contains("wpgb-card-media")||e.contains("wpgb-card-media-thumbnail")||e.contains("wpgb-card-media-overlay")||e.contains("wpgb-card-media-content")?".wpgb-card-media":e.contains("wpgb-card-body")||e.contains("wpgb-card-footer")?".wpgb-card-content":""},z.prototype.formatPosition=function(e,n){if("position"===e.name){var i=e?p.getParent(e,".wpgb-block-panel"):null;if("absolute"===n.position){if(n.float="",n.display="block",!i)return;var t=i.querySelector('.wpgb-select[name="float"]'),e=i.querySelector('.wpgb-select[name="display"]');return t.value="",e.value="block",p.dispatchHTMLEvent(t,"change"),void p.dispatchHTMLEvent(e,"change")}["top","left","bottom","right"].forEach(function(e){var t=i?i.querySelector('.wpgb-input[name="'+e+'"]'):null;t&&(t.value=""),n[e]=""})}},z.prototype.formatBoxShadow=function(e,t){var n="",i=[],o={"box-shadow-type":"","box-shadow-horizontal":0,"box-shadow-vertical":0,"box-shadow-blur":0,"box-shadow-spread":0,"box-shadow-color":""};if(o.hasOwnProperty(e.name)){for(var r in o)o.hasOwnProperty(r)&&(t.hasOwnProperty(r)||(t[r]=""),"box-shadow-type"!==r&&(n+=t[r]),r=t[r]||o[r],i.push(r));t["box-shadow"]=""!==n?i.join(" ").trim():""}},z.prototype.formatTextShadow=function(e,t){var n="",i=[],o={"text-shadow-horizontal":0,"text-shadow-vertical":0,"text-shadow-blur":0,"text-shadow-color":""};if(o.hasOwnProperty(e.name)){for(var r in o)o.hasOwnProperty(r)&&(t.hasOwnProperty(r)||(t[r]=""),n+=t[r],r=t[r]||o[r],i.push(r));t["text-shadow"]=""!==n?i.join(" ").trim():""}},z.prototype.formatBackgroundImage=function(e,t){"background-url"===e.name&&(t["background-url"]?t["background-image"]='url("'+t["background-url"]+'")':t["background-image"]="")},z.prototype.validateCustomCSS=function(e,t){if(t.custom_css&&(i=t.custom_css.replace(/.*{([^}]+)}/,"$1"))){var n,i=i.split("\r\n").join("\n").split(";");if(Array.isArray(i))for(n in i)if(i.hasOwnProperty(n)){if(!(r=i[n])||r.indexOf(":")<0)return;var o=(r=r.split(":"))[0].trim(),r=r.slice(1).join(":").trim();if(o.length<1||r.length<1)return;if(!this.styleSheet.checkRule(o,r)||!e&&"position"===o)return;t[o]=r}}},z.prototype.setResponsiveFont=function(e,t){this.setFontSize(t),this.setLineHeight(t)},z.prototype.setFontSize=function(e){var t,n,i="font-size";e.hasOwnProperty(i)&&""!==e[i]&&(t=parseFloat(e[i]||16),t="px"===(n=(n=e[i].toString().match("px|em"))?n.shift():"px")?t/16:t,t=Number(Math.round(t+"e6")+"e-6"),e[i]=t+"em")},z.prototype.setLineHeight=function(e){var t,n,i="line-height";e.hasOwnProperty(i)&&""!==e[i]&&(t=parseFloat(e[i]),(n=(n=e[i].toString().match("px|em"))?n.shift():"")&&"em"!==n&&(t/=this.getFontSize(e),e[i]=Number(Math.round(t+"e6")+"e-6")+"em"))},z.prototype.getFontSize=function(e){var t=0<parseFloat(e["font-size"])?e["font-size"]:"16px",e=parseFloat(t),t=t.toString().match("px|em");return"em"===(t=t?t.shift():"px")?16*e:e},z.prototype.formatTransition=function(e){var t=e["transition-easing"]||"",n=parseInt(e["transition-duration"]||0,10),i=parseInt(e["transition-delay"]||0,10);"custom"===t&&e["cubic-bezier-function"]&&(t=e["cubic-bezier-function"]||""),e["transition-timing-function"]=t,e["transition-duration"]=0<n?(n+"ms ").trim():"",e["transition-delay"]=0<i?(i+"ms ").trim():""},z.prototype.formatTransformOrigin=function(e){var t,n,i="",o=[],r={"transform-origin-x":"50%","transform-origin-y":"50%","transform-origin-z":0};for(t in r)r.hasOwnProperty(t)&&(e.hasOwnProperty(t)||(e[t]=""),i+=e[t],n=e[t]||r[t],o.push(n));e["transform-origin"]=""!==i?o.join(" ").trim():""},z.prototype.formatTranslate3d=function(e){var t,n,i="",o=[],r={translateX:0,translateY:0,translateZ:0};for(t in r)r.hasOwnProperty(t)&&(e.hasOwnProperty(t)||(e[t]=""),i+=e[t],n=e[t]||r[t],o.push(n));""!==i&&e.transform.push("translate3d("+o.join(",").trim()+")")},z.prototype.formatRotate3d=function(e){var t,n={rotateX:0,rotateY:0,rotateZ:0};for(t in n)n.hasOwnProperty(t)&&(e.hasOwnProperty(t)||(e[t]=""),""!==e[t]&&e.transform.push(t+"("+e[t]+")"))},z.prototype.formatScale3d=function(e){var t,n={scaleX:0,scaleY:0,scaleZ:0};for(t in n)n.hasOwnProperty(t)&&(e.hasOwnProperty(t)||(e[t]=""),""!==e[t]&&e.transform.push(t+"("+e[t]+")"))},z.prototype.formatSkew2d=function(e){var t,n,i="",o=[],r={skewX:0,skewY:0};for(t in r)r.hasOwnProperty(t)&&(e.hasOwnProperty(t)||(e[t]=""),i+=e[t],n=e[t]||r[t],o.push(n));""!==i&&e.transform.push("skew("+o.join(",").trim()+")")},z.prototype.formatTransformPerspective=function(e){var t=e["transform-perspective"];0<e.transform.length&&0<=parseInt(t,10)&&e.transform.unshift("perspective("+t+")")},z.prototype.formatTransform=function(e){e.transform=[],this.formatTranslate3d(e),this.formatRotate3d(e),this.formatScale3d(e),this.formatSkew2d(e),this.formatTransformPerspective(e),e.transform=e.transform?e.transform.join(" "):""},z.prototype.formatFilters=function(e,t){var n=[],i={"filter-sepia":"","filter-brightness":"","filter-contrast":"","filter-saturate":"","filter-grayscale":"","filter-invert":"","filter-hue-rotate":"","filter-blur":""};if(i.hasOwnProperty(e.name)){for(var o in i)i.hasOwnProperty(o)&&(t.hasOwnProperty(o)||(t[o]=""),""!==t[o]&&n.push(o.replace("filter-","")+"("+t[o]+")"));t.filter=n.length?n.join(" ").trim():""}},window.WP_Grid_Builder=new u,window.WP_Grid_Builder.blocks={},window.WP_Grid_Builder.content=z.prototype,window.WP_Grid_Builder.styleSheet={add:function(e){for(selector in e)z.prototype.renderStyles(selector,"idle","",e[selector])},delete:function(e){z.prototype.styleSheet.deleteRules("idle",e)}};function D(){R=G.L10n.blocks}D.prototype=z.prototype,D.date=new e,D.lorem_ipsum=["Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dignissim massa nulla, sed accumsan libero imperdiet vitae.","Phasellus quis tincidunt ipsum. Vestibulum blandit massa id nisi rhoncus, eu volutpat sem bibendum. Curabitur ac justo elit. Aliquam nunc massa, accumsan vitae dui id, vestibulum viverra elit.","Donec tincidunt purus lorem, at rhoncus odio venenatis vel. Fusce quis nunc vel libero vulputate ultrices ut ac quam. Sed euismod nibh sit amet neque vulputate efficitur. Integer congue imperdiet mollis."],D.prototype.purifyText=function(e){if(""===e)return"";var t=document.createElement("div");return t.innerHTML=DOMPurify.sanitize((e||"").replace(/</g,"&lt;").replace(/>/g,"&gt;"),{ALLOWED_TAGS:[""],KEEP_CONTENT:!0}),t.firstChild?t.firstChild.nodeValue:""},D.prototype.post_fields={the_id:function(e,t){return document.createTextNode(9)},the_title:function(e,t){return document.createTextNode(R.the_title)},the_name:function(e,t){return document.createTextNode(R.the_name)},the_content:function(e,t){var n=document.createDocumentFragment();return D.lorem_ipsum.forEach(function(e,t){n.appendChild(document.createTextNode(e)),t<2&&(n.appendChild(document.createElement("br")),n.appendChild(document.createElement("br")))}),n},the_excerpt:function(e,t){t=p.extend(t,{excerpt_length:35,excerpt_suffix:""});var n=D.lorem_ipsum.join(" "),i=parseInt(t.excerpt_length,10),t=-1<i?D.prototype.purifyText(t.excerpt_suffix):"";return i=(i=0===(i=isNaN(i)?0:i)?55:i)<=-1?999:i,document.createTextNode(n.split(" ").splice(0,i).join(" ")+t)},the_post_type:function(e,t){return document.createTextNode(R.the_post_type)},the_post_format:function(e,t){return document.createTextNode(R.the_post_format)},the_post_status:function(e,t){return document.createTextNode(R.the_post_status)},the_date:function(e,t){t.format=(t.date_format||R.the_date).trim();t="ago"!==t.format?D.date.getFormat(t.format):R.the_date_ago;return document.createTextNode(t)},the_modified_date:function(e,t){return D.prototype.post_fields.the_date(e,t)},the_terms:function(e,t){t=p.extend(t,{term_glue:""});for(var n=document.createDocumentFragment(),i=0;i<3;i++){var o=document.createElement("span");o.className="wpgb-block-term",o.textContent=R.the_terms+" "+(i+1),n.appendChild(o),t.term_glue&&i<2&&((o=document.createElement("span")).textContent=D.prototype.purifyText(t.term_glue),n.appendChild(o))}return n},the_author:function(e,t){t=t.author_prefix;return document.createTextNode(D.prototype.purifyText((t||"")+R.the_author))},the_avatar:function(e,t){var n=document.createElement("div");return n.className="wpgb-block-avatar",n},comments_number:function(e,t){return t=p.extend(t,{count_format:"text"}),document.createTextNode("number"===t.count_format?2:R.comments_number)}},D.prototype.product_fields={the_price:function(e,t){return document.createTextNode("$99")},the_full_price:function(e,t){var n=document.createDocumentFragment(),i=document.createElement("del"),o=document.createElement("ins"),r=document.createElement("span"),s=document.createElement("span");return i.className=o.className="wpgb-block-price",r.className=s.className="amout",r.textContent="$179",s.textContent="$99",i.appendChild(r),o.appendChild(s),n.appendChild(i),n.appendChild(o),n},the_regular_price:function(e,t){var n=document.createElement("del");return n.textContent="$179",n},the_sale_price:function(e,t){return document.createTextNode("$99")},the_star_rating:function(e,t){var n="http://www.w3.org/2000/svg",i="http://www.w3.org/1999/xlink",o=document.createElementNS(n,"svg"),r=document.createElementNS(n,"use");return o.setAttribute("xmlns",n),o.setAttribute("xmlns:xlink",i),o.setAttributeNS(null,"class","wpgb-icon-rating-stars"),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"viewbox","0 0 120 24"),r.setAttributeNS(i,"xlink:href",G.icons["rating-stars"]),o.appendChild(r),o},the_text_rating:function(e,t){return document.createTextNode(R.the_text_rating)},the_on_sale_badge:function(e,t){var n={badge_type:"text",badge_icon:"wpgb/business/cart-1",badge_label:R.the_on_sale_badge};return"icon"!==(t=p.extend(t,n)).badge_type?(t.badge_label=D.prototype.purifyText(t.badge_label),document.createTextNode((t.badge_label||"").trim()||R.the_on_sale_badge)):(icon=document.querySelector('.wpgb-icon-item[data-icon="'+t.badge_icon+'"]'),icon=icon?icon.firstElementChild.cloneNode(!0):null,icon)},the_in_stock_badge:function(e,t){return t.badge_label=D.prototype.purifyText(t.badge_label),document.createTextNode((t.badge_label||"").trim()||R.the_in_stock_badge)},the_out_of_stock_badge:function(e,t){return t.badge_label=D.prototype.purifyText(t.badge_label),document.createTextNode((t.badge_label||"").trim()||R.the_out_of_stock_badge)},the_cart_button:function(e,t){return document.createTextNode(R.the_cart_button)}},D.prototype.user_fields={the_user_id:function(e,t){return document.createTextNode(9)},the_user_display_name:function(e,t){return document.createTextNode(R.the_user_display_name)},the_user_first_name:function(e,t){return document.createTextNode(R.the_user_first_name)},the_user_last_name:function(e,t){return document.createTextNode(R.the_user_last_name)},the_user_nickname:function(e,t){return document.createTextNode(R.the_user_nickname)},the_user_login:function(e,t){return document.createTextNode(R.the_user_login)},the_user_description:function(e,t){return D.prototype.post_fields.the_excerpt(e,t)},the_user_email:function(e,t){return document.createTextNode("user@email.com")},the_user_url:function(e,t){return t=p.extend(t,{website_text:""}),document.createTextNode(D.prototype.purifyText(t.website_text)||"https://website.com")},the_user_roles:function(e,t){return document.createTextNode(R.the_user_roles)},the_user_post_count:function(e,t){return t=p.extend(t,{count_format:"text"}),document.createTextNode("number"===t.count_format?10:R.the_user_post_count)}},D.prototype.term_fields={the_term_id:function(e,t){return document.createTextNode(9)},the_term_name:function(e,t){return document.createTextNode(R.the_term_name)},the_term_slug:function(e,t){return document.createTextNode(R.the_term_slug)},the_term_taxonomy:function(e,t){return document.createTextNode(R.the_term_taxonomy)},the_term_parent:function(e,t){return document.createTextNode(R.the_term_parent)},the_term_description:function(e,t){return D.prototype.post_fields.the_excerpt(e,t)},the_term_count:function(e,t){return t=p.extend(t,{count_format:"text"}),document.createTextNode("number"===t.count_format?10:R.the_term_count)}},D.prototype.renderContent=function(e,t){var n=document.querySelector("."+e);if(n){var i=0<n.querySelectorAll("svg").length,o=0<n.querySelectorAll(".wpgb-block-term").length,r="";switch(t.source){case"post_field":var s=document.querySelector('select[name="'+t.source+'"]'),r=t.post_field=t.post_field||s&&s.value||"the_id";this.post_fields.hasOwnProperty(r)&&(c=this.post_fields[r](n,t));break;case"product_field":s=document.querySelector('select[name="'+t.source+'"]');r=t.product_field=t.product_field||s&&s.value||"the_full_price",this.product_fields.hasOwnProperty(r)&&(c=this.product_fields[r](n,t));break;case"user_field":s=document.querySelector('select[name="'+t.source+'"]');r=t.user_field=t.user_field||s&&s.value||"the_user_id",this.user_fields.hasOwnProperty(r)&&(c=this.user_fields[r](n,t));break;case"term_field":s=document.querySelector('select[name="'+t.source+'"]');r=t.term_field=t.term_field||s&&s.value||"the_term_id",this.term_fields.hasOwnProperty(r)&&(c=this.term_fields[r](n,t));break;case"metadata":r="metadata";var a=D.prototype.purifyText(t.meta_prefix||""),l=D.prototype.purifyText(t.meta_suffix||""),c=document.createTextNode(a+"{{ "+(t.meta_key||R.metadata)+" }}"+l);break;case"media_button_block":r="media_button_block";var d=t.lightbox_icon||"wpgb/user-interface/add";c=(c=document.querySelector('.wpgb-icon-item[data-icon="'+d+'"]'))?c.firstElementChild.cloneNode(!0):null;break;case"social_share_block":r="social_share_block",c=(c=document.querySelector('.wpgb-icon-item[data-icon="wpgb/social-media/'+(t.social_network||"facebook")+'"]'))?c.firstElementChild.cloneNode(!0):null;break;case"svg_icon_block":r="svg_icon_block";d=t.svg_name||"wpgb/animals/bug";c=(c=document.querySelector('.wpgb-icon-item[data-icon="'+d+'"]'))?c.firstElementChild.cloneNode(!0):null;break;case"raw_content_block":r="raw_content_block",(c=document.createElement("div")).innerHTML=DOMPurify.sanitize(t.raw_content);break;case"custom_block":r="custom_block";l=t.block_name||"",d=G.panels.blocks.fields.filter(function(e){return"block_name"===e.id}),l=d[0]&&d[0].hasOwnProperty("options")?l&&d[0].options.hasOwnProperty(l)?"{{ "+d[0].options[l]+" }}":"*** "+R.custom_block.not_selected+" ***":"*** "+R.custom_block.not_founded+" ***";c=document.createTextNode(l);break;default:var p=t.source,s=document.querySelector('select[name="'+p+'"]'),s=!t[p]&&G.panels.blocks.fields.filter(function(e){return e.id===p});s&&s[0]&&(t[p]=s[0].options&&Object.keys(s[0].options)[0]),c=(r=t[p])&&WP_Grid_Builder.blocks[r]&&WP_Grid_Builder.blocks[r](t,e,n),r&&!c?c=document.createTextNode("{{ "+r+" }}"):r||(c=document.createTextNode("*** "+R.not_founded+" ***"))}var u=n.firstElementChild;u&&c&&u.isEqualNode(c)||(this.removeContent(n),c&&n.insertBefore(c,n.firstElementChild)),this.setClassName(n,t),this.iconStroke(n,i,e,t),this.termsStyles(n,o,e,t),this.termsSpacing(e,t),WP_Grid_Builder.emit("blockRendered",[r,t,e,n])}},D.prototype.removeContent=function(e){for(var t=e.childNodes,n=t.length-1;0<=n;n--)t[n].classList&&t[n].classList.contains("wpgb-resizer")||t[n].parentNode.removeChild(t[n])},D.prototype.setClassName=function(e,t){for(var n=t.class,i=e.classList,o=new RegExp("^wpgb-block$|^"+e.wpgbName+"$|wpgb-idle-scheme-([0-9]+)[^\b]*?|wpgb-hover-scheme-([0-9]+)[^\b]*?|wpgb-idle-accent-([0-9]+)[^\b]*?|wpgb-hover-accent-([0-9]+)[^\b]*?","gi"),r=i.length-1,s=0;s<=r;r--)i[r].match(o)||i[r]&&e.classList.remove(i[r]);if(this.setColorScheme(e.wpgbName,"",""),n)for(var a=n.trim().split(/\s+/),r=0,s=a.length;r<s;r++)if(n=(n=(n=a[r]).replace(/|%[a-fA-F0-9][a-fA-F0-9]|/g,"")).replace(/[^A-Za-z0-9_-]/g,"").trim())try{i.add(n)}catch(e){}},D.prototype.iconStroke=function(e,t,n,i){e=0<e.querySelectorAll("svg").length;if(!0===t&&!1==e)return U.blocks[n].style.idle["stroke-width"]="",void this.renderStyles(n,"","",{"stroke-width":""});!0==e&&(U.blocks[n].style.idle["stroke-width"]=i["stroke-width"]||1,this.renderStyles(n,"","",{"stroke-width":i["stroke-width"]||1}))},D.prototype.termsSpacing=function(e,t){"the_terms"===t.post_field&&this.renderStyles(e+" .wpgb-block-term","","",{"margin-top":t["margin-top"]||"","margin-right":t["margin-right"]||"","margin-bottom":t["margin-bottom"]||"","margin-left":t["margin-left"]||""})},D.prototype.termsStyles=function(e,t,n,i){t!==0<e.querySelectorAll(".wpgb-block-term").length&&(i=U.blocks[n].style,["idle","hover"].forEach(function(t){i.hasOwnProperty(t)&&["","before","after"].forEach(function(e){this.styleSheet.deleteRules(t+e,n),this.renderStyles(n,t,e,i[t])}.bind(this))}.bind(this)))},z.prototype.cssKeyframe="((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})",z.prototype.cssCombined="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",z.prototype.cssImport=new RegExp("@import .*?;","gi"),z.prototype.parseCSS=function(e){if(void 0===e)return[];for(var t,n=[];null!==(t=this.cssImport.exec(e));)n.push(t[0]);e=e.replace(this.cssImport,"");for(var i=new RegExp(this.cssKeyframe,"gi");null!==(t=i.exec(e));)n.push(t[0]);e=e.replace(i,"");for(var o=new RegExp(this.cssCombined,"gi");null!==(t=o.exec(e));){var r,s=void 0===t[2]?t[5]:t[2];-1!==(s=(s=s.split("\r\n").join("\n").trim()).replace(/\n+/,"\n")).indexOf("@media")?(r=this.parseCSS(t[3]+"\n}"),n.push(s+"{"+r.join("")+"}")):n.push(".wpgb-card-preview .wpgb-preview "+s+"{"+t[6]+"}")}return n};function F(){z.call(this),this.view=new g,this.framework=new C,this.appendGeneralPanel(),this.bindEvents()}((F.prototype=Object.create(z.prototype)).constructor=F).prototype.bindEvents=function(){this.mobile=window.innerWidth<=1280,window.addEventListener("resize",this.switchEditor.bind(this)),window.addEventListener("click",this.onClick.bind(this),!0),window.addEventListener("click",this.closePanel.bind(this),!0),window.addEventListener("click",this.appendLayerPanel.bind(this),!0);for(var e=document.querySelectorAll(".wpgb-edit-layer-menu li"),t=0;t<e.length;t++)e[t].addEventListener("mouseenter",this.highlightLayer.bind(this,!0)),e[t].addEventListener("mouseleave",this.highlightLayer.bind(this,!1))},F.prototype.switchEditor=function(){var e=window.innerWidth,t=document.querySelector(".wpgb-card-panel > ul > li:nth-child(2)"),n=document.querySelector(".wpgb-card-panel > ul > li:nth-child(1)");e<=1280&&!this.mobile?(t.click(),this.mobile=!0):1280<e&&this.mobile&&(t.classList.contains("wpgb-active-tab")&&n.click(),this.mobile=!1)},F.prototype.onClick=function(e){var t=p.getParent(e.target,".wpgb-panel-toggle-title");if(t)return t=t.parentElement,this.renderToggle(t,t.wpgb),void this.initHelpers();(t=p.getParent(e.target,".wpgb-panel-tab"))&&!t.wpgbActive&&(p.getParent(e.target,".wpgb-card-panel")&&document.querySelector(".wpgb-builder-right-panel").classList["editor"===t.wpgb?"add":"remove"]("wpgb-reveal-editor"),this.renderTabContent(t,t.wpgb),this.initHelpers())},F.prototype.appendGeneralPanel=function(){var e="general",t=G.panels;t=t[e],t=this.framework.buildPanel(t),(t=this.view.render(t)).wpgb=e,this.renderTabContent(t.querySelector(".wpgb-panel-tab")),document.querySelector(".wpgb-builder-left-panel").appendChild(t),this.initHelpers()},F.prototype.initHelpers=function(){requestAnimationFrame(function(){setTimeout(function(){WPGB_Select_Init(),WPGB_Tooltip_Init(),WPGB_Gradient_Init()},0)}),p.dispatchEvent(window,"wpgb_builder.render_field")},F.prototype.renderToggle=function(e,n,t){var i,o=p.getParent(e,".wpgb-panel"),r=o.querySelector(".wpgb-active-toggle"),s=(s=o.querySelectorAll(".wpgb-active-tab"))[s.length-1].wpgb;r&&(i=U[o.wpgb][this.element].style["style"===s?"idle":s],i=this.framework.hasSettings(r.wpgb,i),r.querySelector(".wpgb-panel-toggle-title span").classList[i?"add":"remove"]("wpgb-hassettings")),e.classList.contains("wpgb-active-toggle")?this.removeToggle(e):(this.removeToggle(e),e.classList.add("wpgb-active-toggle"),e.querySelector(".wpgb-panel-toggle-button").setAttribute("aria-expanded",!0),i=this.getSettings(e),r=e.lastElementChild,(o=(o=(o=(o=(o=p.clone(G.panels[o.wpgb].fields)).filter(function(e){var t=e.tab===s||Array.isArray(e.tab)&&-1<e.tab.indexOf(s),e="accordion"===e.type&&e.id===n;return t&&e}))&&o[0]&&o[0].fields)&&this.framework.buildFields(o,i))&&this.view.render(o))&&r.appendChild(o),!1!==t&&w(e),o=null)},F.prototype.removeToggle=function(e){for(var t=e.parentNode.querySelectorAll(".wpgb-panel-toggle-content"),n=0;n<t.length;n++)t[n].parentElement.classList.remove("wpgb-active-toggle"),t[n].previousElementSibling.firstElementChild.setAttribute("aria-expanded",!1),p.removeChildren(t[n])},F.prototype.appendPanel=function(e,t){z.prototype.element=t;var n=document.querySelector(".wpgb-draggable-panel");if(n&&n.wpgb===e)return n.querySelector(".wpgb-block-name").textContent="("+this.getItemName(t)+")",this.replacePanel(n),void this.initHelpers();n&&(this.removePanel(),z.prototype.element=t),n=(n=(n=G.panels)[e]).hasOwnProperty(t)?n[t]:n,n=this.framework.buildPanel(n,!0),(n=this.view.render(n)).wpgb=e,n.querySelector(".wpgb-block-name").textContent="("+this.getItemName(t)+")";t=this.getPanelCookie();n.style.height=t.height+"px",n.style.width=t.width+"px",this.panelPosition?(n.style.left=this.panelPosition.left,n.style.top=this.panelPosition.top):(n.style.top=Math.max(46,t.top||document.body.clientHeight/2-t.height/2+32)+"px",n.style.left=Math.max(0,t.left||document.body.clientWidth/2-t.width/2)+"px");t=n.querySelector(".wpgb-panel-tab");this.renderTabContent(t),document.querySelector(".wpgb-builder-right-panel").appendChild(n),t.focus(),this.updateItemList(),this.initHelpers()},F.prototype.getPanelCookie=function(){var e=new RegExp("wpgb_panel_size=(.*?);");return e=(e=document.cookie.match(e))&&e[1]?e[1].split(","):[440,650,null,null],{width:Math.min(document.body.clientWidth,e[0]),height:Math.min(document.body.clientHeight,e[1]),top:e[2],left:e[3]}},F.prototype.appendLayerPanel=function(e){var t=document.querySelector(".wpgb-card-media .wpgb-edit-layer"),n=p.getParent(e.target,".wpgb-edit-layer");if(!n)return t.classList.remove("wpgb-active"),void this.layerPerspective(!1);if(n.querySelector(".wpgb-edit-layer-menu"))if(t.classList.toggle("wpgb-active"),t.classList.contains("wpgb-active")){for(var i=t.querySelectorAll("li"),o=0;o<i.length;o++){var r=i[o].getAttribute("data-layer");i[o].classList[this.element===r?"add":"remove"]("wpgb-selected")}this.layerPerspective(!0)}else this.layerPerspective(!1);else{if((e=n.getAttribute("data-layer"))===this.element)return t.classList.remove("wpgb-active"),void this.layerPerspective(!1);this.layerPerspective(!1),this.appendPanel("layers",e);var s=document.querySelectorAll(".wpgb-edit-layer.wpgb-show");if(s)for(var o=0,a=s.length;o<a;o++)s[o].classList.remove("wpgb-show");n="LI"===n.tagName?p.getParent(n.parentElement,".wpgb-edit-layer"):n,t.classList.remove("wpgb-active"),n.classList.add("wpgb-show")}},F.prototype.addIcon=function(e){for(var t=e.querySelectorAll(".wpgb-icon-picker input.wpgb-input"),n=0,i=t.length;n<i;n++){var o,r=t[n];r.value&&((o=(o=document.querySelector('.wpgb-icon-item[data-icon="'+r.value+'"]'))?o.firstElementChild.cloneNode(!0):null)&&r.parentElement.querySelector(".wpgb-icon-picker-svg").appendChild(o))}},F.prototype.replacePanel=function(e){var t=e.querySelectorAll(".wpgb-active-tab"),n=e.querySelectorAll(".wpgb-active-toggle"),i=(n=n[n.length-1])?Array.prototype.indexOf.call(n.parentNode.children,n):null,o=t?t[t.length-1].parentElement.nextSibling.scrollTop:0;t.length&&(t=t[t.length-1],this.renderTabContent(t,t.wpgb,!1)),n&&0<=i&&(n=(n=e.querySelectorAll(".wpgb-panel-toggle"))[i],this.renderToggle(n,n.wpgb,!1),t.parentElement.nextSibling.scrollTop=o),this.updateItemList()},F.prototype.closePanel=function(e){p.getParent(e.target,".wpgb-panel-close")&&(this.removePanel(e),this.updateItemList())},F.prototype.removePanel=function(){var e,t,n;this.element&&(e=document.querySelector(".wpgb-draggable-panel"),document.querySelector("."+this.element),e&&(this.panelPosition={left:e.style.left,top:e.style.top},t=document.querySelector(".wpgb-resizer.wpgb-show"),n=document.querySelector(".wpgb-edit-layer.wpgb-show"),t&&t.classList.remove("wpgb-show"),n&&n.classList.remove("wpgb-show"),e.parentNode.removeChild(e),z.prototype.element=null))},F.prototype.renderTabContent=function(e,t){if(e){for(var n=e.parentNode.children,i=p.getParent(e,".wpgb-panel"),o=0,r=n.length;o<r;o++)n[o].classList.remove("wpgb-active-tab"),n[o].wpgbActive=0;e.classList.add("wpgb-active-tab"),e.wpgbActive=1,(n=e.parentElement).nextSibling&&n.nextSibling.classList.contains("wpgb-panel-content")&&n.nextSibling.parentNode.removeChild(n.nextSibling);e=this.getSettings(e),e=this.getTabContent(i.wpgb,t,e);e&&(this.addIcon(e),n.parentNode.insertBefore(e,n.nextSibling))}},F.prototype.getTabContent=function(e,t,n){var i,o,r=[],s=document.createDocumentFragment(),a=p.clone(G).panels,l=a?a[e]:null;l.hasOwnProperty(this.element)&&(l=l[this.element]);var c=this.searchTabContent(l,t);if(c){var d=l.tabs.filter(function(e){return e.id===t});return d&&d[0]&&d[0].tabs&&(i=this.framework.buildTabs(d[0].tabs),(i=this.view.render(i)).firstElementChild.classList.add("wpgb-active-tab"),i.firstElementChild.wpgbActive=1,c=this.searchTabContent(l,d[0].tabs[0].id),t=d[0].tabs[0].id),c.fields&&(r=c.fields,a=(d=(a=this.element&&U[e][this.element])&&a.content)&&d.source,"blocks"===e&&"action"===t&&("media_button_block"===a||"social_share_block"===a||"user_field"===a&&"the_user_url"===d.user_field||"user_field"===a&&"the_user_email"===d.user_field||"product_field"===a&&"the_cart_button"===d.product_field||"post_field"===a&&"the_terms"===d.post_field&&d.term_link?r=r.slice(0,1):r.shift()),(r=(r=r&&this.framework.buildFields(r,n))&&this.view.render(r))&&s.appendChild(r)),"idle"!==t&&"hover"!==t||(n=(n=U[e][this.element].style)?n["style"===t?"idle":t]:null,o=this.framework.buildToggles(c.fields,n,t),o=this.view.render(o),s.appendChild(o)),s?(l=this.view.render(["div",{class:"wpgb-panel-content"}]),i?((c=l.cloneNode()).appendChild(s),l.appendChild(i),l.appendChild(c)):l.appendChild(s),l):void 0}},F.prototype.searchTabContent=function(e,t){var n={fields:[]};return t=t||e.tabs[0].id,e.fields.forEach(function(e){(e.tab===t||Array.isArray(e.tab)&&-1<e.tab.indexOf(t))&&n.fields.push(e)}.bind(this)),n},F.prototype.layerPerspective=function(e){var t,n,i=document.querySelector(".wpgb-card-media"),o=document.querySelectorAll(".wpgb-card-media, .wpgb-card-media > .wpgb-layer");e=!document.querySelector(".wpgb-preview")&&e;for(var r=0;r<o.length;r++)t=o[r],e?t.querySelector(".wpgb-layer-highlight")||((n=document.createElement("div")).className="wpgb-layer-highlight",t.appendChild(n)):(n=t.lastElementChild)&&n.classList.contains("wpgb-layer-highlight")&&t.removeChild(n);i.style.perspective=e?2.4*i.clientWidth+"px":null,setTimeout(function(){i.classList[e?"add":"remove"]("wpgb-layers-perspective")},0)},F.prototype.highlightLayer=function(e,t){t=t.target.getAttribute("data-layer"),t=document.querySelector("."+t);t&&t.classList[e?"add":"remove"]("wpgb-show")};function B(){this.view=new g,window.addEventListener("click",this.openList.bind(this),!0),window.addEventListener("wpgb_builder.sort_start",this.openList.bind(this)),window.addEventListener("wpgb_builder.resize_start",this.openList.bind(this))}(B.prototype=F.prototype).openList=function(e){var t=document.querySelector(".wpgb-builder-list ul"),e=p.getParent(e.target,".wpgb-builder-list");if(t)return t.parentNode.classList.remove("wpgb-list-open"),t=t.parentNode.removeChild(t),void(t=null);e&&(t=document.querySelector(".wpgb-card"),t=this.buildList(t,!1),this.layerPerspective(!0),e.classList.add("wpgb-list-open"),e.appendChild(t))},B.prototype.buildList=function(e,t){var n=t||document.createElement("ul"),i=e.children;if(i){for(var o=0,r=i.length;o<r;o++){var s,a=i[o],l=p.matchesSelector(a,".wpgb-layer"),c=p.matchesSelector(a,".wpgb-block"),d=this.buildList(a,!l&&n);(c||l)&&(a&&"none"===a.style.display||("wpgb-card-content"!==(s=c?a.wpgbName:a.classList[0])?(l&&(l=this.getListItem(a,"layer",s),n.appendChild(l)),d&&l&&(l||n).appendChild(d),c&&(c=this.getListItem(a,"block",s),n.appendChild(c))):d&&n.appendChild(d)))}return n}},B.prototype.getListItem=function(e,t,n){var i=U.blocks[n],o=i?i.content:null,r=o?o.source||"post_field":null,s=o&&"custom_block"===r?o.block_name||r:o&&o[r]?o[r]:r,i=V[s],o=X[s],r=document.createElement("li"),s=document.createElement("span"),i=i?i+" ("+n.replace("wpgb-block-","")+")":this.getItemName(n);o=o||"block"!==t?o||G.icons.layer:G.icons.custom_block;o=this.view.render(["svg",["use",{"xlink:href":o}]]);return s.className="wpgb-builder-list-"+t+(this.element===n?" wpgb-selected":""),s.wpgbName=n,s.appendChild(o),s.appendChild(document.createTextNode(i)),s.addEventListener("click",this.selectItem.bind(this)),s.addEventListener("mouseenter",this.revealItem.bind(this,"add")),s.addEventListener("mouseleave",this.revealItem.bind(this,"remove")),r.appendChild(s),r},B.prototype.selectItem=function(e){this.revealItem("remove",e);var t=document.querySelector("."+e.target.wpgbName);t.classList.contains("wpgb-block")?t.click():(e=document.querySelector('[data-layer="'+e.target.wpgbName+'"]'))&&e.click()},B.prototype.updateItemList=function(){var e=document.querySelector(".wpgb-builder-list"),t=e.querySelector("span");this.placeholder||(this.placeholder=t.textContent);var n=this.element?this.getItemName(this.element):this.placeholder;e.classList[this.element?"add":"remove"]("wpgb-selected"),t.textContent=n},B.prototype.revealItem=function(e,t){var n=document.querySelector("."+t.target.wpgbName);!n||this.element&&n.wpgbName===this.element||(n=(t=n.lastElementChild)&&t.classList.contains("wpgb-resizer")?t:n).classList[e]("wpgb-show")};function j(){F.call(this),this.styleSheet=new A,document.addEventListener("click",this.blockActions.bind(this),!1),document.addEventListener("click",this.selectBlock.bind(this),!1),document.addEventListener("click",this.addBlock.bind(this),!1)}((j.prototype=Object.create(F.prototype)).constructor=j).prototype.blockActions=function(e){e=p.getParent(e.target,".wpgb-panel-button");if(e){e=e.classList;if(e=e[1]||null){var t=document.querySelector("."+this.element);if(t)switch(e){case"wpgb-delete-block":this.deleteBlock(t);break;case"wpgb-duplicate-block":this.duplicateBlock(t);break;case"wpgb-move-up-block":this.moveUpBlock(t);break;case"wpgb-move-down-block":this.moveDownBlock(t)}}}},j.prototype.uniqueName=function(e){for(var t,n,i=U.blocks,o=1;t=i[n=e+"-"+o],o++,t;);return n},j.prototype.selectBlock=function(e){if(3!=e.which){e=p.getParent(e.target,".wpgb-block");if(e&&e.wpgbName!==this.element){this.appendPanel("blocks",e.wpgbName);for(var e=e.querySelector(".wpgb-resizer"),t=document.querySelectorAll(".wpgb-resizer.wpgb-show"),n=0,i=t.length;n<i;n++)t[n].classList.remove("wpgb-show");e&&e.classList.add("wpgb-show")}}},j.prototype.addBlock=function(e){var t=p.getParent(e.target,".wpgb-default-block");if(t){for(var n,i=Array.prototype.indexOf.call(document.querySelectorAll(".wpgb-default-block"),t),o=this.uniqueName("wpgb-block"),e=document.createElement("div"),r=(document.createElement("div"),document.querySelectorAll(".wpgb-layer .wpgb-droppable")),s=0,a=r.length;s<a;s++)if(r[s].offsetParent){n=r[s];break}if(n){e.wpgbName=o,e.className="wpgb-block "+o,n.firstElementChild?n.insertBefore(e,n.firstElementChild):n.appendChild(e);for(var l={},s=0,a=wpgb_builder_blocks.length;s<a;s++){var c=wpgb_builder_blocks[s].blocks;if(c&&c.hasOwnProperty(i)){l=c[i].settings;break}}U.blocks||(U.blocks=[]),U.blocks[o]=p.clone(l);t={};t[o]=U.blocks[o],this.renderContent(o,U.blocks[o].content),this.buildCardCSS(t),this.checkDroppables(),new _(e),Y=!0}}},j.prototype.duplicateBlock=function(e){var t,n,i=e?e.wpgbName:null;i&&(t=e.cloneNode(!0),n=this.uniqueName("wpgb-block"),t.querySelector(".wpgb-resizer")&&t.removeChild(t.querySelector(".wpgb-resizer")),t.className=t.className.replace(i,n),t.wpgbName=n,new _(t),U.blocks[n]=p.clone(U.blocks[i]),this.styleSheet.duplicateRules("idle",i,n),this.styleSheet.duplicateRules("idlebefore",i,n),this.styleSheet.duplicateRules("idleafter",i,n),this.styleSheet.duplicateRules("hover",i,n),this.styleSheet.duplicateRules("hoverbefore",i,n),this.styleSheet.duplicateRules("hoverafter",i,n),this.styleSheet.duplicateRules("animate",i,n),e.parentNode.insertBefore(t,e.nextSibling),this.checkDroppables(),Y=!0)},j.prototype.deleteBlock=function(t){WPGB_Dialog(wpgb_dialog_L10n.delete_block,function(){var e=t?t.wpgbName:null;e&&t.parentElement&&(e===this.element&&this.removePanel(),t.parentElement.removeChild(t),delete U.blocks[e],this.styleSheet.deleteRules("idle",e),this.styleSheet.deleteRules("idlebefore",e),this.styleSheet.deleteRules("idleafter",e),this.styleSheet.deleteRules("hover",e),this.styleSheet.deleteRules("hoverbefore",e),this.styleSheet.deleteRules("hoverafter",e),this.styleSheet.deleteRules("animate",e),e===this.element&&(this.element=null),this.checkDroppables())}.bind(this)),Y=!0},j.prototype.moveUpBlock=function(e){var t=window.getComputedStyle(e).getPropertyValue("position"),n=document.querySelectorAll(".wpgb-droppable"),i=e.previousSibling;if(Y=!0,"absolute"===t||!i){for(var o,r=Array.prototype.indexOf.call(n,e.parentNode);!o||!o.offsetParent;)o=n[p.modulo(n.length,--r)];return o.appendChild(e),void this.checkDroppables()}e.parentNode.insertBefore(e,i),this.checkDroppables()},j.prototype.moveDownBlock=function(e){var t=window.getComputedStyle(e).getPropertyValue("position"),n=document.querySelectorAll(".wpgb-droppable"),i=e.nextSibling;if(Y=!0,"absolute"===t||!i){for(var o,r=Array.prototype.indexOf.call(n,e.parentNode);!o||!o.offsetParent;)o=n[p.modulo(n.length,++r)];return o.insertBefore(e,o.firstChild),void this.checkDroppables()}e.parentNode.insertBefore(e,i.nextSibling),this.checkDroppables()};function H(){this.view=new g,this.styleSheet=new A,window.addEventListener("scroll",this.hide.bind(this),!1),window.addEventListener("resize",this.hide.bind(this),!1),document.addEventListener("click",this.hide.bind(this),!1),document.addEventListener("contextmenu",this.reveal.bind(this),!1),window.addEventListener("wpgb_builder.sort_start",this.hide.bind(this))}var W,G,U;((H.prototype=Object.create(j.prototype)).constructor=H).prototype.reveal=function(e){this.hide();var t=p.getParent(e.target,".wpgb-block");t&&(e.preventDefault(),this.block=t,this.renderMenu(e))},H.prototype.hide=function(e){this.select(e),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu)},H.prototype.select=function(e){e=e?p.getParent(e.target,".wpgb-context-menu-item"):null;if(e)switch(Array.prototype.indexOf.call(e.parentNode.childNodes,e)){case 0:this.block.click();break;case 1:this.duplicateBlock(this.block);break;case 2:this.deleteBlock(this.block)}},H.prototype.renderMenu=function(e){var t=G.icons,n=G.L10n.contextMenu,e={top:e.pageY+15+"px",left:e.pageX-20+"px"};this.menu=this.view.render(["div",{class:"wpgb-context-menu",style:e},["ul",{class:"wpgb-context-menu-list"},["li",{class:"wpgb-context-menu-item"},["svg",["use",{"xlink:href":t.settings}]],n.edit],["li",{class:"wpgb-context-menu-item"},["svg",["use",{"xlink:href":t.clipboard}]],n.duplicate],["li",{class:"wpgb-context-menu-item"},["svg",["use",{"xlink:href":t.delete}]],n.delete]]]),document.body.appendChild(this.menu)};var Y,V=[],X=[];function $(){var e=document.querySelector(".wpgb-builder-right-panel");e.style.minHeight=window.innerHeight-window.pageYOffset-e.getBoundingClientRect().top-20+"px"}new y(".wpgb-builder-ruler-h canvas","horizontal"),new y(".wpgb-builder-ruler-v canvas","vertical"),document.body.classList.add("wpgb-card-preview"),jQuery.ajax({url:ajaxurl,type:"POST",data:{nonce:document.querySelector("#wpgb_fields_nonce").value,action:"wpgb_card",method:"get_settings",object:"settings",id:document.querySelector('[name="wpgb_id"]').value},error:function(e){WPGB_Popup_Message("unknown","error")},success:function(e){e.success&&e.content?(W=e.content.fonts,G=e.content.content,U=e.content.settings,wpgb_builder_blocks=e.content.blocks,wpgb_builder_layout=e.content.layers,function(){(function(){var t=[];G.panels.blocks.fields.filter(function(e){return-1<["source","post_field","term_field","user_field","product_field"].indexOf(e.id)}).forEach(function(e){t[e.id]=e});var e=G.panels.general.fields.filter(function(e){return"available-blocks"===e.id});e=e[0]&&e[0].icons;var n=wpgb_builder_blocks,i=[t.source.options,t.post_field.options,t.term_field.options,t.user_field.options,t.product_field.options];V=i=i.reduce(function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},{});for(var o=0,r=0;r<n.length;r++)if(n[r].blocks){var s,a,l,c,d={};for(s in wpgb_builder_blocks[r].blocks)wpgb_builder_blocks[r].blocks.hasOwnProperty(s)&&(a=wpgb_builder_blocks[r].blocks[s],l=a.settings.content,c=l.source,i[a.name]?(V[a.name]=i[a.name],X[a.name]=e[a.name],a.icon=a.name,a.name=i[a.name]):c&&l[c]&&!V[l[c]]?(V[l[c]]=a.name,X[l[c]]=a.icon):"custom_block"===c&&(a.block_name=s,a.settings.content.block_name=s,V[s]=a.name,X[s]=a.icon),d[o]=a,o++);wpgb_builder_blocks[r].blocks=d}})(),new v,new I,D(),new j,new H,new B,(new z).init();var e=document.querySelector(".wpgb-preloader");e.classList.add("wpgb-loaded");G.panels.general.fields.filter(function(e){return"available-blocks"===e.id});setTimeout(function(){e.parentElement.removeChild(e)},600)}()):WPGB_Popup_Message("unknown","error")}}),$(),window.addEventListener("resize",$,!0)}();

Zerion Mini Shell 1.0