var wpgmza_data={};
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(l,y,A){l instanceof String&&(l=String(l));for(var q=l.length,E=0;E<q;E++){var P=l[E];if(y.call(A,P,E,l))return{i:E,v:P}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(l,y,A){if(l==Array.prototype||l==Object.prototype)return l;l[y]=A.value;return l};$jscomp.getGlobal=function(l){l=["object"==typeof globalThis&&globalThis,l,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var y=0;y<l.length;++y){var A=l[y];if(A&&A.Math==Math)return A}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(l,y){var A=$jscomp.propertyToPolyfillSymbol[y];if(null==A)return l[y];A=l[A];return void 0!==A?A:l[y]};
$jscomp.polyfill=function(l,y,A,q){y&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(l,y,A,q):$jscomp.polyfillUnisolated(l,y,A,q))};$jscomp.polyfillUnisolated=function(l,y,A,q){A=$jscomp.global;l=l.split(".");for(q=0;q<l.length-1;q++){var E=l[q];if(!(E in A))return;A=A[E]}l=l[l.length-1];q=A[l];y=y(q);y!=q&&null!=y&&$jscomp.defineProperty(A,l,{configurable:!0,writable:!0,value:y})};
$jscomp.polyfillIsolated=function(l,y,A,q){var E=l.split(".");l=1===E.length;q=E[0];q=!l&&q in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var P=0;P<E.length-1;P++){var la=E[P];if(!(la in q))return;q=q[la]}E=E[E.length-1];A=$jscomp.IS_SYMBOL_NATIVE&&"es6"===A?q[E]:null;y=y(A);null!=y&&(l?$jscomp.defineProperty($jscomp.polyfills,E,{configurable:!0,writable:!0,value:y}):y!==A&&($jscomp.propertyToPolyfillSymbol[E]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(E):$jscomp.POLYFILL_PREFIX+E,
E=$jscomp.propertyToPolyfillSymbol[E],$jscomp.defineProperty(q,E,{configurable:!0,writable:!0,value:y})))};$jscomp.polyfill("Array.prototype.find",function(l){return l?l:function(y,A){return $jscomp.findInternal(this,y,A).v}},"es6","es3");
(function(l){"function"===typeof define&&define.amd?define(["jquery"],function(y){return l(y,window,document)}):"object"===typeof exports?module.exports=function(y,A){y||(y=window);A||(A="undefined"!==typeof window?require("jquery"):require("jquery")(y));return l(A,y,y.document)}:window.DataTable=l(jQuery,window,document)})(function(l,y,A,q){function E(a){var b,c,d={};l.each(a,function(e,h){(b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" ")&&(c=e.replace(b[0],
b[2].toLowerCase()),d[c]=e,"o"===b[1]&&E(a[e]))});a._hungarianMap=d}function P(a,b,c){a._hungarianMap||E(a);var d;l.each(b,function(e,h){d=a._hungarianMap[e];d===q||!c&&b[d]!==q||("o"===d.charAt(0)?(b[d]||(b[d]={}),l.extend(!0,b[d],b[e]),P(a[d],b[d],c)):b[d]=b[e])})}function la(a){var b=u.defaults.oLanguage,c=b.sDecimal;c&&bb(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&d&&"No data available in table"===b.sEmptyTable&&Y(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&d&&"Loading..."===b.sLoadingRecords&&
Y(a,a,"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&c!==a&&bb(a)}}function Db(a){S(a,"ordering","bSort");S(a,"orderMulti","bSortMulti");S(a,"orderClasses","bSortClasses");S(a,"orderCellsTop","bSortCellsTop");S(a,"order","aaSorting");S(a,"orderFixed","aaSortingFixed");S(a,"paging","bPaginate");S(a,"pagingType","sPaginationType");S(a,"pageLength","iDisplayLength");S(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":
"");"boolean"===typeof a.scrollX&&(a.scrollX=a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&P(u.models.oSearch,a[b])}function Eb(a){S(a,"orderable","bSortable");S(a,"orderData","aDataSort");S(a,"orderSequence","asSorting");S(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"!==typeof b||Array.isArray(b)||(a.aDataSort=[b])}function Fb(a){if(!u.__browser){var b={};u.__browser=b;var c=l("<div/>").css({position:"fixed",top:0,left:-1*l(y).scrollLeft(),height:1,
width:1,overflow:"hidden"}).append(l("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(l("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}l.extend(a.oBrowser,u.__browser);a.oScroll.iBarWidth=u.__browser.barWidth}
function Gb(a,b,c,d,e,h){var f=!1;if(c!==q){var g=c;f=!0}for(;d!==e;)a.hasOwnProperty(d)&&(g=f?b(g,a[d],d,a):a[d],f=!0,d+=h);return g}function cb(a,b){var c=u.defaults.column,d=a.aoColumns.length;c=l.extend({},u.models.oColumn,c,{nTh:b?b:A.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=l.extend({},u.models.oSearch,c[d]);Ia(a,d,l(b).data())}function Ia(a,b,c){b=a.aoColumns[b];
var d=a.oClasses,e=l(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var h=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);h&&(b.sWidthOrig=h[1])}c!==q&&null!==c&&(Eb(c),P(u.defaults.column,c,!0),c.mDataProp===q||c.mData||(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),h=b.sClass,l.extend(b,c),Y(b,c,"sWidth","sWidthOrig"),h!==b.sClass&&(b.sClass=h+" "+b.sClass),c.iDataSort!==q&&(b.aDataSort=[c.iDataSort]),
Y(b,c,"aDataSort"));var f=b.mData,g=ma(f),k=b.mRender?ma(b.mRender):null;c=function(m){return"string"===typeof m&&-1!==m.indexOf("@")};b._bAttrSrc=l.isPlainObject(f)&&(c(f.sort)||c(f.type)||c(f.filter));b._setter=null;b.fnGetData=function(m,n,p){var t=g(m,n,q,p);return k&&n?k(t,n,m,p):t};b.fnSetData=function(m,n,p){return ha(f)(m,n,p)};"number"!==typeof f&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==l.inArray("asc",b.asSorting);c=-1!==l.inArray("desc",
b.asSorting);b.bSortable&&(a||c)?a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI):(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI="")}function sa(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;db(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;""===b.sY&&""===b.sX||Ja(a);F(a,null,"column-sizing",
[a])}function ta(a,b){a=Ka(a,"bVisible");return"number"===typeof a[b]?a[b]:null}function ua(a,b){a=Ka(a,"bVisible");b=l.inArray(b,a);return-1!==b?b:null}function na(a){var b=0;l.each(a.aoColumns,function(c,d){d.bVisible&&"none"!==l(d.nTh).css("display")&&b++});return b}function Ka(a,b){var c=[];l.map(a.aoColumns,function(d,e){d[b]&&c.push(e)});return c}function eb(a){var b=a.aoColumns,c=a.aoData,d=u.ext.type.detect,e,h,f;var g=0;for(e=b.length;g<e;g++){var k=b[g];var m=[];if(!k.sType&&k._sManualType)k.sType=
k._sManualType;else if(!k.sType){var n=0;for(h=d.length;n<h;n++){var p=0;for(f=c.length;p<f;p++){m[p]===q&&(m[p]=T(a,p,g,"type"));var t=d[n](m[p],a);if(!t&&n!==d.length-1)break;if("html"===t&&!aa(m[p]))break}if(t){k.sType=t;break}}k.sType||(k.sType="string")}}}function Hb(a,b,c,d){var e,h,f,g=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){var k=b[e];var m=k.target!==q?k.target:k.targets!==q?k.targets:k.aTargets;Array.isArray(m)||(m=[m]);var n=0;for(h=m.length;n<h;n++)if("number"===typeof m[n]&&0<=m[n]){for(;g.length<=
m[n];)cb(a);d(m[n],k)}else if("number"===typeof m[n]&&0>m[n])d(g.length+m[n],k);else if("string"===typeof m[n]){var p=0;for(f=g.length;p<f;p++)("_all"==m[n]||l(g[p].nTh).hasClass(m[n]))&&d(p,k)}}if(c)for(e=0,a=c.length;e<a;e++)d(e,c[e])}function ia(a,b,c,d){var e=a.aoData.length,h=l.extend(!0,{},u.models.oRow,{src:c?"dom":"data",idx:e});h._aData=b;a.aoData.push(h);for(var f=a.aoColumns,g=0,k=f.length;g<k;g++)f[g].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==q&&(a.aIds[b]=h);!c&&a.oFeatures.bDeferRender||
fb(a,e,c,d);return e}function La(a,b){var c;b instanceof l||(b=l(b));return b.map(function(d,e){c=gb(a,e);return ia(a,c.data,e,c.cells)})}function T(a,b,c,d){"search"===d?d="filter":"order"===d&&(d="sort");var e=a.iDraw,h=a.aoColumns[c],f=a.aoData[b]._aData,g=h.sDefaultContent,k=h.fnGetData(f,d,{settings:a,row:b,col:c});if(k===q)return a.iDrawError!=e&&null===g&&(ea(a,0,"Requested unknown parameter "+("function"==typeof h.mData?"{function}":"'"+h.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=
e),g;if((k===f||null===k)&&null!==g&&d!==q)k=g;else if("function"===typeof k)return k.call(f);if(null===k&&"display"===d)return"";"filter"===d&&(a=u.ext.type.search,a[h.sType]&&(k=a[h.sType](k)));return k}function Ib(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}function hb(a){return l.map(a.match(/(\\.|[^\.])+/g)||[""],function(b){return b.replace(/\\\./g,".")})}function ib(a){return U(a.aoData,"_aData")}function Ma(a){a.aoData.length=0;a.aiDisplayMaster.length=
0;a.aiDisplay.length=0;a.aIds={}}function Na(a,b,c){for(var d=-1,e=0,h=a.length;e<h;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===q&&a.splice(d,1)}function va(a,b,c,d){var e=a.aoData[b],h,f=function(k,m){for(;k.childNodes.length;)k.removeChild(k.firstChild);k.innerHTML=T(a,b,m,"display")};if("dom"!==c&&(c&&"auto"!==c||"dom"!==e.src)){var g=e.anCells;if(g)if(d!==q)f(g[d],d);else for(c=0,h=g.length;c<h;c++)f(g[c],c)}else e._aData=gb(a,e,d,d===q?q:e._aData).data;e._aSortData=null;e._aFilterData=null;f=
a.aoColumns;if(d!==q)f[d].sType=null;else{c=0;for(h=f.length;c<h;c++)f[c].sType=null;jb(a,e)}}function gb(a,b,c,d){var e=[],h=b.firstChild,f,g=0,k,m=a.aoColumns,n=a._rowReadObject;d=d!==q?d:n?{}:[];var p=function(x,w){if("string"===typeof x){var r=x.indexOf("@");-1!==r&&(r=x.substring(r+1),ha(x)(d,w.getAttribute(r)))}},t=function(x){if(c===q||c===g)f=m[g],k=x.innerHTML.trim(),f&&f._bAttrSrc?(ha(f.mData._)(d,k),p(f.mData.sort,x),p(f.mData.type,x),p(f.mData.filter,x)):n?(f._setter||(f._setter=ha(f.mData)),
f._setter(d,k)):d[g]=k;g++};if(h)for(;h;){var v=h.nodeName.toUpperCase();if("TD"==v||"TH"==v)t(h),e.push(h);h=h.nextSibling}else for(e=b.anCells,h=0,v=e.length;h<v;h++)t(e[h]);(b=b.firstChild?b:b.nTr)&&(b=b.getAttribute("id"))&&ha(a.rowId)(d,b);return{data:d,cells:e}}function fb(a,b,c,d){var e=a.aoData[b],h=e._aData,f=[],g,k;if(null===e.nTr){var m=c||A.createElement("tr");e.nTr=m;e.anCells=f;m._DT_RowIndex=b;jb(a,e);var n=0;for(g=a.aoColumns.length;n<g;n++){var p=a.aoColumns[n];e=(k=c?!1:!0)?A.createElement(p.sCellType):
d[n];e._DT_CellIndex={row:b,column:n};f.push(e);if(k||!(!p.mRender&&p.mData===n||l.isPlainObject(p.mData)&&p.mData._===n+".display"))e.innerHTML=T(a,b,n,"display");p.sClass&&(e.className+=" "+p.sClass);p.bVisible&&!c?m.appendChild(e):!p.bVisible&&c&&e.parentNode.removeChild(e);p.fnCreatedCell&&p.fnCreatedCell.call(a.oInstance,e,T(a,b,n),h,b,n)}F(a,"aoRowCreatedCallback",null,[m,h,b,f])}}function jb(a,b){var c=b.nTr,d=b._aData;if(c){if(a=a.rowIdFn(d))c.id=a;d.DT_RowClass&&(a=d.DT_RowClass.split(" "),
b.__rowc=b.__rowc?Oa(b.__rowc.concat(a)):a,l(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&l(c).attr(d.DT_RowAttr);d.DT_RowData&&l(c).data(d.DT_RowData)}}function Jb(a){var b,c,d=a.nTHead,e=a.nTFoot,h=0===l("th, td",d).length,f=a.oClasses,g=a.aoColumns;h&&(c=l("<tr/>").appendTo(d));var k=0;for(b=g.length;k<b;k++){var m=g[k];var n=l(m.nTh).addClass(m.sClass);h&&n.appendTo(c);a.oFeatures.bSort&&(n.addClass(m.sSortingClass),!1!==m.bSortable&&(n.attr("tabindex",a.iTabIndex).attr("aria-controls",
a.sTableId),kb(a,m.nTh,k)));m.sTitle!=n[0].innerHTML&&n.html(m.sTitle);lb(a,"header")(a,n,m,f)}h&&wa(a.aoHeader,d);l(d).children("tr").children("th, td").addClass(f.sHeaderTH);l(e).children("tr").children("th, td").addClass(f.sFooterTH);if(null!==e)for(a=a.aoFooter[0],k=0,b=a.length;k<b;k++)m=g[k],m.nTf=a[k].cell,m.sClass&&l(m.nTf).addClass(m.sClass)}function xa(a,b,c){var d,e,h=[],f=[],g=a.aoColumns.length;if(b){c===q&&(c=!1);var k=0;for(d=b.length;k<d;k++){h[k]=b[k].slice();h[k].nTr=b[k].nTr;for(e=
g-1;0<=e;e--)a.aoColumns[e].bVisible||c||h[k].splice(e,1);f.push([])}k=0;for(d=h.length;k<d;k++){if(a=h[k].nTr)for(;e=a.firstChild;)a.removeChild(e);e=0;for(b=h[k].length;e<b;e++){var m=g=1;if(f[k][e]===q){a.appendChild(h[k][e].cell);for(f[k][e]=1;h[k+g]!==q&&h[k][e].cell==h[k+g][e].cell;)f[k+g][e]=1,g++;for(;h[k][e+m]!==q&&h[k][e].cell==h[k][e+m].cell;){for(c=0;c<g;c++)f[k+c][e+m]=1;m++}l(h[k][e].cell).attr("rowspan",g).attr("colspan",m)}}}}}function ja(a,b){var c="ssp"==Q(a),d=a.iInitDisplayStart;
d!==q&&-1!==d&&(a._iDisplayStart=c?d:d>=a.fnRecordsDisplay()?0:d,a.iInitDisplayStart=-1);c=F(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==l.inArray(!1,c))V(a,!1);else{c=[];var e=0;d=a.asStripeClasses;var h=d.length,f=a.oLanguage,g="ssp"==Q(a),k=a.aiDisplay,m=a._iDisplayStart,n=a.fnDisplayEnd();a.bDrawing=!0;if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,V(a,!1);else if(!g)a.iDraw++;else if(!a.bDestroying&&!b){Kb(a);return}if(0!==k.length)for(b=g?a.aoData.length:n,f=g?0:m;f<b;f++){g=k[f];var p=a.aoData[g];
null===p.nTr&&fb(a,g);var t=p.nTr;if(0!==h){var v=d[e%h];p._sRowStripe!=v&&(l(t).removeClass(p._sRowStripe).addClass(v),p._sRowStripe=v)}F(a,"aoRowCallback",null,[t,p._aData,e,f,g]);c.push(t);e++}else e=f.sZeroRecords,1==a.iDraw&&"ajax"==Q(a)?e=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(e=f.sEmptyTable),c[0]=l("<tr/>",{"class":h?d[0]:""}).append(l("<td />",{valign:"top",colSpan:na(a),"class":a.oClasses.sRowEmpty}).html(e))[0];F(a,"aoHeaderCallback","header",[l(a.nTHead).children("tr")[0],
ib(a),m,n,k]);F(a,"aoFooterCallback","footer",[l(a.nTFoot).children("tr")[0],ib(a),m,n,k]);d=l(a.nTBody);d.children().detach();d.append(l(c));F(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function ka(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&Lb(a);d?ya(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;ja(a);a._drawHold=!1}function Mb(a){var b=a.oClasses,c=l(a.nTable);c=l("<div/>").insertBefore(c);var d=a.oFeatures,
e=l("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var h=a.sDom.split(""),f,g,k,m,n,p,t=0;t<h.length;t++){f=null;g=h[t];if("<"==g){k=l("<div/>")[0];m=h[t+1];if("'"==m||'"'==m){n="";for(p=2;h[t+p]!=m;)n+=h[t+p],p++;"H"==n?n=b.sJUIHeader:"F"==n&&(n=b.sJUIFooter);-1!=n.indexOf(".")?(m=n.split("."),k.id=m[0].substr(1,m[0].length-1),k.className=m[1]):"#"==n.charAt(0)?k.id=n.substr(1,
n.length-1):k.className=n;t+=p}e.append(k);e=l(k)}else if(">"==g)e=e.parent();else if("l"==g&&d.bPaginate&&d.bLengthChange)f=Nb(a);else if("f"==g&&d.bFilter)f=Ob(a);else if("r"==g&&d.bProcessing)f=Pb(a);else if("t"==g)f=Qb(a);else if("i"==g&&d.bInfo)f=Rb(a);else if("p"==g&&d.bPaginate)f=Sb(a);else if(0!==u.ext.feature.length)for(k=u.ext.feature,p=0,m=k.length;p<m;p++)if(g==k[p].cFeature){f=k[p].fnInit(a);break}f&&(k=a.aanFeatures,k[g]||(k[g]=[]),k[g].push(f),e.append(f))}c.replaceWith(e);a.nHolding=
null}function wa(a,b){b=l(b).children("tr");var c,d,e;a.splice(0,a.length);var h=0;for(e=b.length;h<e;h++)a.push([]);h=0;for(e=b.length;h<e;h++){var f=b[h];for(c=f.firstChild;c;){if("TD"==c.nodeName.toUpperCase()||"TH"==c.nodeName.toUpperCase()){var g=1*c.getAttribute("colspan");var k=1*c.getAttribute("rowspan");g=g&&0!==g&&1!==g?g:1;k=k&&0!==k&&1!==k?k:1;var m=0;for(d=a[h];d[m];)m++;var n=m;var p=1===g?!0:!1;for(d=0;d<g;d++)for(m=0;m<k;m++)a[h+m][n+d]={cell:c,unique:p},a[h+m].nTr=f}c=c.nextSibling}}}
function Pa(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],wa(c,b)));b=0;for(var e=c.length;b<e;b++)for(var h=0,f=c[b].length;h<f;h++)!c[b][h].unique||d[h]&&a.bSortCellsTop||(d[h]=c[b][h].cell);return d}function Qa(a,b,c){F(a,"aoServerParams","serverParams",[b]);if(b&&Array.isArray(b)){var d={},e=/(.*?)\[\]$/;l.each(b,function(n,p){(n=p.name.match(e))?(n=n[0],d[n]||(d[n]=[]),d[n].push(p.value)):d[p.name]=p.value});b=d}var h=a.ajax,f=a.oInstance,g=function(n){var p=a.jqXHR?a.jqXHR.status:null;if(null===n||"number"===typeof p&&204==p)n={},za(a,n,[]);(p=n.error||n.sError)&&ea(a,0,p);a.json=n;F(a,null,"xhr",[a,n,a.jqXHR]);c(n)};if(l.isPlainObject(h)&&h.data){var k=h.data;var m="function"===typeof k?k(b,a):k;b="function"===typeof k&&m?m:l.extend(!0,b,m);delete h.data}m={data:b,success:g,dataType:"json",cache:!1,type:a.sServerMethod,error:function(n,p,t){t=F(a,null,"xhr",[a,null,a.jqXHR]);-1===l.inArray(!0,t)&&("parsererror"==p?ea(a,0,"Invalid JSON response",1):4===n.readyState&&ea(a,0,"Ajax error",
7));V(a,!1)}};a.oAjaxData=b;F(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(f,a.sAjaxSource,l.map(b,function(n,p){return{name:p,value:n}}),g,a):a.sAjaxSource||"string"===typeof h?a.jqXHR=l.ajax(l.extend(m,{url:h||a.sAjaxSource})):"function"===typeof h?a.jqXHR=h.call(f,b,g,a):(a.jqXHR=l.ajax(l.extend(m,h)),h.data=k)}function Kb(a){a.iDraw++;V(a,!0);Qa(a,Tb(a),function(b){Ub(a,b)})}function Tb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,h=a.aoPreSearchCols,f=[],g=oa(a);
var k=a._iDisplayStart;var m=!1!==d.bPaginate?a._iDisplayLength:-1;var n=function(x,w){f.push({name:x,value:w})};n("sEcho",a.iDraw);n("iColumns",c);n("sColumns",U(b,"sName").join(","));n("iDisplayStart",k);n("iDisplayLength",m);var p={draw:a.iDraw,columns:[],order:[],start:k,length:m,search:{value:e.sSearch,regex:e.bRegex}};for(k=0;k<c;k++){var t=b[k];var v=h[k];m="function"==typeof t.mData?"function":t.mData;p.columns.push({data:m,name:t.sName,searchable:t.bSearchable,orderable:t.bSortable,search:{value:v.sSearch,
regex:v.bRegex}});n("mDataProp_"+k,m);d.bFilter&&(n("sSearch_"+k,v.sSearch),n("bRegex_"+k,v.bRegex),n("bSearchable_"+k,t.bSearchable));d.bSort&&n("bSortable_"+k,t.bSortable)}d.bFilter&&(n("sSearch",e.sSearch),n("bRegex",e.bRegex));d.bSort&&(l.each(g,function(x,w){p.order.push({column:w.col,dir:w.dir});n("iSortCol_"+x,w.col);n("sSortDir_"+x,w.dir)}),n("iSortingCols",g.length));b=u.ext.legacy.ajax;return null===b?a.sAjaxSource?f:p:b?f:p}function Ub(a,b){var c=function(f,g){return b[f]!==q?b[f]:b[g]},
d=za(a,b),e=c("sEcho","draw"),h=c("iTotalRecords","recordsTotal");c=c("iTotalDisplayRecords","recordsFiltered");if(e!==q){if(1*e<a.iDraw)return;a.iDraw=1*e}d||(d=[]);Ma(a);a._iRecordsTotal=parseInt(h,10);a._iRecordsDisplay=parseInt(c,10);e=0;for(h=d.length;e<h;e++)ia(a,d[e]);a.aiDisplay=a.aiDisplayMaster.slice();ja(a,!0);a._bInitComplete||Ra(a,b);V(a,!1)}function za(a,b,c){a=l.isPlainObject(a.ajax)&&a.ajax.dataSrc!==q?a.ajax.dataSrc:a.sAjaxDataProp;if(!c)return"data"===a?b.aaData||b[a]:""!==a?ma(a)(b):
b;ha(a)(b,c)}function Ob(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,h=a.aanFeatures,f='<input type="search" class="'+b.sFilterInput+'"/>',g=d.sSearch;g=g.match(/_INPUT_/)?g.replace("_INPUT_",f):g+f;b=l("<div/>",{id:h.f?null:c+"_filter","class":b.sFilter}).append(l("<label/>").append(g));var k=function(n){var p=this.value?this.value:"";e.return&&"Enter"!==n.key||p==e.sSearch||(ya(a,{sSearch:p,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive,"return":e.return}),
a._iDisplayStart=0,ja(a))};h=null!==a.searchDelay?a.searchDelay:"ssp"===Q(a)?400:0;var m=l("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",h?mb(k,h):k).on("mouseup",function(n){setTimeout(function(){k.call(m[0],n)},10)}).on("keypress.DT",function(n){if(13==n.keyCode)return!1}).attr("aria-controls",c);l(a.nTable).on("search.dt.DT",function(n,p){if(a===p)try{m[0]!==A.activeElement&&m.val(e.sSearch)}catch(t){}});return b[0]}function ya(a,
b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,h=function(g){d.sSearch=g.sSearch;d.bRegex=g.bRegex;d.bSmart=g.bSmart;d.bCaseInsensitive=g.bCaseInsensitive;d.return=g.return},f=function(g){return g.bEscapeRegex!==q?!g.bEscapeRegex:g.bRegex};eb(a);if("ssp"!=Q(a)){Vb(a,b.sSearch,c,f(b),b.bSmart,b.bCaseInsensitive,b.return);h(b);for(b=0;b<e.length;b++)Wb(a,e[b].sSearch,b,f(e[b]),e[b].bSmart,e[b].bCaseInsensitive);Xb(a)}else h(b);a.bFiltered=!0;F(a,null,"search",[a])}function Xb(a){for(var b=u.ext.search,
c=a.aiDisplay,d,e,h=0,f=b.length;h<f;h++){for(var g=[],k=0,m=c.length;k<m;k++)e=c[k],d=a.aoData[e],b[h](a,d._aFilterData,e,d._aData,k)&&g.push(e);c.length=0;l.merge(c,g)}}function Wb(a,b,c,d,e,h){if(""!==b){var f=[],g=a.aiDisplay;d=nb(b,d,e,h);for(e=0;e<g.length;e++)b=a.aoData[g[e]]._aFilterData[c],d.test(b)&&f.push(g[e]);a.aiDisplay=f}}function Vb(a,b,c,d,e,h){e=nb(b,d,e,h);var f=a.oPreviousSearch.sSearch,g=a.aiDisplayMaster;h=[];0!==u.ext.search.length&&(c=!0);var k=Yb(a);if(0>=b.length)a.aiDisplay=
g.slice();else{if(k||c||d||f.length>b.length||0!==b.indexOf(f)||a.bSorted)a.aiDisplay=g.slice();b=a.aiDisplay;for(c=0;c<b.length;c++)e.test(a.aoData[b[c]]._sFilterRow)&&h.push(b[c]);a.aiDisplay=h}}function nb(a,b,c,d){a=b?a:ob(a);c&&(a="^(?=.*?"+l.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(e){if('"'===e.charAt(0)){var h=e.match(/^"(.*)"$/);e=h?h[1]:e}return e.replace('"',"")}).join(")(?=.*?")+").*$");return new RegExp(a,d?"i":"")}function Yb(a){var b=a.aoColumns,c,d;var e=!1;var h=0;for(c=a.aoData.length;h<
c;h++){var f=a.aoData[h];if(!f._aFilterData){var g=[];e=0;for(d=b.length;e<d;e++){var k=b[e];k.bSearchable?(k=T(a,h,e,"filter"),null===k&&(k=""),"string"!==typeof k&&k.toString&&(k=k.toString())):k="";k.indexOf&&-1!==k.indexOf("&")&&(Sa.innerHTML=k,k=Bc?Sa.textContent:Sa.innerText);k.replace&&(k=k.replace(/[\r\n\u2028]/g,""));g.push(k)}f._aFilterData=g;f._sFilterRow=g.join("  ");e=!0}}return e}function Zb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}
function $b(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function Rb(a){var b=a.sTableId,c=a.aanFeatures.i,d=l("<div/>",{"class":a.oClasses.sInfo,id:c?null:b+"_info"});c||(a.aoDrawCallback.push({fn:ac,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),l(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function ac(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),h=a.fnRecordsTotal(),
f=a.fnRecordsDisplay(),g=f?c.sInfo:c.sInfoEmpty;f!==h&&(g+=" "+c.sInfoFiltered);g+=c.sInfoPostFix;g=bc(a,g);c=c.fnInfoCallback;null!==c&&(g=c.call(a.oInstance,a,d,e,h,f,g));l(b).html(g)}}function bc(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,h=a.fnRecordsDisplay(),f=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,h)).replace(/_PAGE_/g,c.call(a,f?1:Math.ceil(d/
e))).replace(/_PAGES_/g,c.call(a,f?1:Math.ceil(h/e)))}function Aa(a){var b=a.iInitDisplayStart,c=a.aoColumns;var d=a.oFeatures;var e=a.bDeferLoading;if(a.bInitialised){Mb(a);Jb(a);xa(a,a.aoHeader);xa(a,a.aoFooter);V(a,!0);d.bAutoWidth&&db(a);var h=0;for(d=c.length;h<d;h++){var f=c[h];f.sWidth&&(f.nTh.style.width=K(f.sWidth))}F(a,null,"preInit",[a]);ka(a);c=Q(a);if("ssp"!=c||e)"ajax"==c?Qa(a,[],function(g){var k=za(a,g);for(h=0;h<k.length;h++)ia(a,k[h]);a.iInitDisplayStart=b;ka(a);V(a,!1);Ra(a,g)},
a):(V(a,!1),Ra(a))}else setTimeout(function(){Aa(a)},200)}function Ra(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&sa(a);F(a,null,"plugin-init",[a,b]);F(a,"aoInitComplete","init",[a,b])}function pb(a,b){b=parseInt(b,10);a._iDisplayLength=b;qb(a);F(a,null,"length",[a,b])}function Nb(a){var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=Array.isArray(d[0]),h=e?d[0]:d;d=e?d[1]:d;e=l("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect});for(var f=0,g=h.length;f<g;f++)e[0][f]=new Option("number"===typeof d[f]?a.fnFormatNumber(d[f]):d[f],h[f]);var k=l("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(k[0].id=c+"_length");k.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));l("select",k).val(a._iDisplayLength).on("change.DT",function(m){pb(a,l(this).val());ja(a)});l(a.nTable).on("length.dt.DT",function(m,n,p){a===n&&l("select",k).val(p)});return k[0]}function Sb(a){var b=a.sPaginationType,c=u.ext.pager[b],d="function"===typeof c,e=function(f){ja(f)};b=l("<div/>").addClass(a.oClasses.sPaging+
b)[0];var h=a.aanFeatures;d||c.fnInit(a,b,e);h.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(f){if(d){var g=f._iDisplayStart,k=f._iDisplayLength,m=f.fnRecordsDisplay(),n=-1===k;g=n?0:Math.ceil(g/k);k=n?1:Math.ceil(m/k);m=c(g,k);var p;n=0;for(p=h.p.length;n<p;n++)lb(f,"pageButton")(f,h.p[n],n,m,g,k)}else c.fnUpdate(f,e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,h=a.fnRecordsDisplay();0===h||-1===e?d=0:"number"===typeof b?(d=b*
e,d>h&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<h&&(d+=e):"last"==b?d=Math.floor((h-1)/e)*e:ea(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(F(a,null,"page",[a]),c&&ja(a));return b}function Pb(a){return l("<div/>",{id:a.aanFeatures.r?null:a.sTableId+"_processing","class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).append("<div><div></div><div></div><div></div><div></div></div>").insertBefore(a.nTable)[0]}function V(a,
b){a.oFeatures.bProcessing&&l(a.aanFeatures.r).css("display",b?"block":"none");F(a,null,"processing",[a,b])}function Qb(a){var b=l(a.nTable),c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,h=a.oClasses,f=b.children("caption"),g=f.length?f[0]._captionSide:null,k=l(b[0].cloneNode(!1)),m=l(b[0].cloneNode(!1)),n=b.children("tfoot");n.length||(n=null);k=l("<div/>",{"class":h.sScrollWrapper}).append(l("<div/>",{"class":h.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,
width:d?d?K(d):null:"100%"}).append(l("<div/>",{"class":h.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(k.removeAttr("id").css("margin-left",0).append("top"===g?f:null).append(b.children("thead"))))).append(l("<div/>",{"class":h.sScrollBody}).css({position:"relative",overflow:"auto",width:d?K(d):null}).append(b));n&&k.append(l("<div/>",{"class":h.sScrollFoot}).css({overflow:"hidden",border:0,width:d?d?K(d):null:"100%"}).append(l("<div/>",{"class":h.sScrollFootInner}).append(m.removeAttr("id").css("margin-left",
0).append("bottom"===g?f:null).append(b.children("tfoot")))));b=k.children();var p=b[0];h=b[1];var t=n?b[2]:null;if(d)l(h).on("scroll.DT",function(v){v=this.scrollLeft;p.scrollLeft=v;n&&(t.scrollLeft=v)});l(h).css("max-height",e);c.bCollapse||l(h).css("height",e);a.nScrollHead=p;a.nScrollBody=h;a.nScrollFoot=t;a.aoDrawCallback.push({fn:Ja,sName:"scrolling"});return k[0]}function Ja(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY;b=b.iBarWidth;var h=l(a.nScrollHead),f=h[0].style,g=h.children("div"),k=
g[0].style,m=g.children("table");g=a.nScrollBody;var n=l(g),p=g.style,t=l(a.nScrollFoot).children("div"),v=t.children("table"),x=l(a.nTHead),w=l(a.nTable),r=w[0],C=r.style,G=a.nTFoot?l(a.nTFoot):null,ba=a.oBrowser,L=ba.bScrollOversize;U(a.aoColumns,"nTh");var O=[],I=[],H=[],fa=[],Z,Ba=function(D){D=D.style;D.paddingTop="0";D.paddingBottom="0";D.borderTopWidth="0";D.borderBottomWidth="0";D.height=0};var X=g.scrollHeight>g.clientHeight;if(a.scrollBarVis!==X&&a.scrollBarVis!==q)a.scrollBarVis=X,sa(a);
else{a.scrollBarVis=X;w.children("thead, tfoot").remove();if(G){X=G.clone().prependTo(w);var ca=G.find("tr");var Ca=X.find("tr");X.find("[id]").removeAttr("id")}var Ua=x.clone().prependTo(w);x=x.find("tr");X=Ua.find("tr");Ua.find("th, td").removeAttr("tabindex");Ua.find("[id]").removeAttr("id");c||(p.width="100%",h[0].style.width="100%");l.each(Pa(a,Ua),function(D,W){Z=ta(a,D);W.style.width=a.aoColumns[Z].sWidth});G&&da(function(D){D.style.width=""},Ca);h=w.outerWidth();""===c?(C.width="100%",L&&
(w.find("tbody").height()>g.offsetHeight||"scroll"==n.css("overflow-y"))&&(C.width=K(w.outerWidth()-b)),h=w.outerWidth()):""!==d&&(C.width=K(d),h=w.outerWidth());da(Ba,X);da(function(D){var W=y.getComputedStyle?y.getComputedStyle(D).width:K(l(D).width());H.push(D.innerHTML);O.push(W)},X);da(function(D,W){D.style.width=O[W]},x);l(X).css("height",0);G&&(da(Ba,Ca),da(function(D){fa.push(D.innerHTML);I.push(K(l(D).css("width")))},Ca),da(function(D,W){D.style.width=I[W]},ca),l(Ca).height(0));da(function(D,
W){D.innerHTML='<div class="dataTables_sizing">'+H[W]+"</div>";D.childNodes[0].style.height="0";D.childNodes[0].style.overflow="hidden";D.style.width=O[W]},X);G&&da(function(D,W){D.innerHTML='<div class="dataTables_sizing">'+fa[W]+"</div>";D.childNodes[0].style.height="0";D.childNodes[0].style.overflow="hidden";D.style.width=I[W]},Ca);Math.round(w.outerWidth())<Math.round(h)?(ca=g.scrollHeight>g.offsetHeight||"scroll"==n.css("overflow-y")?h+b:h,L&&(g.scrollHeight>g.offsetHeight||"scroll"==n.css("overflow-y"))&&
(C.width=K(ca-b)),""!==c&&""===d||ea(a,1,"Possible column misalignment",6)):ca="100%";p.width=K(ca);f.width=K(ca);G&&(a.nScrollFoot.style.width=K(ca));!e&&L&&(p.height=K(r.offsetHeight+b));c=w.outerWidth();m[0].style.width=K(c);k.width=K(c);d=w.height()>g.clientHeight||"scroll"==n.css("overflow-y");e="padding"+(ba.bScrollbarLeft?"Left":"Right");k[e]=d?b+"px":"0px";G&&(v[0].style.width=K(c),t[0].style.width=K(c),t[0].style[e]=d?b+"px":"0px");w.children("colgroup").insertBefore(w.children("thead"));
n.trigger("scroll");!a.bSorted&&!a.bFiltered||a._drawHold||(g.scrollTop=0)}}function da(a,b,c){for(var d=0,e=0,h=b.length,f,g;e<h;){f=b[e].firstChild;for(g=c?c[e].firstChild:null;f;)1===f.nodeType&&(c?a(f,g,d):a(f,d),d++),f=f.nextSibling,g=c?g.nextSibling:null;e++}}function db(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,h=d.sX,f=d.sXInner,g=c.length,k=Ka(a,"bVisible"),m=l("th",a.nTHead),n=b.getAttribute("width"),p=b.parentNode,t=!1,v,x=a.oBrowser;d=x.bScrollOversize;(v=b.style.width)&&-1!==v.indexOf("%")&&(n=v);for(v=0;v<k.length;v++){var w=c[k[v]];null!==w.sWidth&&(w.sWidth=cc(w.sWidthOrig,p),t=!0)}if(d||!t&&!h&&!e&&g==na(a)&&g==m.length)for(v=0;v<g;v++)k=ta(a,v),null!==k&&(c[k].sWidth=K(m.eq(v).width()));else{g=l(b).clone().css("visibility","hidden").removeAttr("id");g.find("tbody tr").remove();var r=l("<tr/>").appendTo(g.find("tbody"));g.find("thead, tfoot").remove();g.append(l(a.nTHead).clone()).append(l(a.nTFoot).clone());g.find("tfoot th, tfoot td").css("width","");m=Pa(a,g.find("thead")[0]);
for(v=0;v<k.length;v++)w=c[k[v]],m[v].style.width=null!==w.sWidthOrig&&""!==w.sWidthOrig?K(w.sWidthOrig):"",w.sWidthOrig&&h&&l(m[v]).append(l("<div/>").css({width:w.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(v=0;v<k.length;v++)t=k[v],w=c[t],l(dc(a,t)).clone(!1).append(w.sContentPadding).appendTo(r);l("[name]",g).removeAttr("name");w=l("<div/>").css(h||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(g).appendTo(p);h&&f?g.width(f):h?
(g.css("width","auto"),g.removeAttr("width"),g.width()<p.clientWidth&&n&&g.width(p.clientWidth)):e?g.width(p.clientWidth):n&&g.width(n);for(v=e=0;v<k.length;v++)p=l(m[v]),f=p.outerWidth()-p.width(),p=x.bBounding?Math.ceil(m[v].getBoundingClientRect().width):p.outerWidth(),e+=p,c[k[v]].sWidth=K(p-f);b.style.width=K(e);w.remove()}n&&(b.style.width=K(n));!n&&!h||a._reszEvt||(b=function(){l(y).on("resize.DT-"+a.sInstance,mb(function(){sa(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0)}function cc(a,b){if(!a)return 0;
a=l("<div/>").css("width",K(a)).appendTo(b||A.body);b=a[0].offsetWidth;a.remove();return b}function dc(a,b){var c=ec(a,b);if(0>c)return null;var d=a.aoData[c];return d.nTr?d.anCells[b]:l("<td/>").html(T(a,c,b,"display"))[0]}function ec(a,b){for(var c,d=-1,e=-1,h=0,f=a.aoData.length;h<f;h++)c=T(a,h,b,"display")+"",c=c.replace(Cc,""),c=c.replace(/&nbsp;/g," "),c.length>d&&(d=c.length,e=h);return e}function K(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function oa(a){var b=
[],c=a.aoColumns;var d=a.aaSortingFixed;var e=l.isPlainObject(d);var h=[];var f=function(n){n.length&&!Array.isArray(n[0])?h.push(n):l.merge(h,n)};Array.isArray(d)&&f(d);e&&d.pre&&f(d.pre);f(a.aaSorting);e&&d.post&&f(d.post);for(a=0;a<h.length;a++){var g=h[a][0];f=c[g].aDataSort;d=0;for(e=f.length;d<e;d++){var k=f[d];var m=c[k].sType||"string";h[a]._idx===q&&(h[a]._idx=l.inArray(h[a][1],c[k].asSorting));b.push({src:g,col:k,dir:h[a][1],index:h[a]._idx,type:m,formatter:u.ext.type.order[m+"-pre"]})}}return b}
function Lb(a){var b,c=[],d=u.ext.type.order,e=a.aoData,h=0,f=a.aiDisplayMaster;eb(a);var g=oa(a);var k=0;for(b=g.length;k<b;k++){var m=g[k];m.formatter&&h++;fc(a,m.col)}if("ssp"!=Q(a)&&0!==g.length){k=0;for(b=f.length;k<b;k++)c[f[k]]=k;h===g.length?f.sort(function(n,p){var t,v=g.length,x=e[n]._aSortData,w=e[p]._aSortData;for(t=0;t<v;t++){var r=g[t];var C=x[r.col];var G=w[r.col];C=C<G?-1:C>G?1:0;if(0!==C)return"asc"===r.dir?C:-C}C=c[n];G=c[p];return C<G?-1:C>G?1:0}):f.sort(function(n,p){var t,v=g.length,
x=e[n]._aSortData,w=e[p]._aSortData;for(t=0;t<v;t++){var r=g[t];var C=x[r.col];var G=w[r.col];r=d[r.type+"-"+r.dir]||d["string-"+r.dir];C=r(C,G);if(0!==C)return C}C=c[n];G=c[p];return C<G?-1:C>G?1:0})}a.bSorted=!0}function gc(a){var b=a.aoColumns,c=oa(a);a=a.oLanguage.oAria;for(var d=0,e=b.length;d<e;d++){var h=b[d];var f=h.asSorting;var g=h.ariaTitle||h.sTitle.replace(/<.*?>/g,"");var k=h.nTh;k.removeAttribute("aria-sort");h.bSortable&&(0<c.length&&c[0].col==d?(k.setAttribute("aria-sort","asc"==c[0].dir?"ascending":"descending"),h=f[c[0].index+1]||f[0]):h=f[0],g+="asc"===h?a.sSortAscending:a.sSortDescending);k.setAttribute("aria-label",g)}}function rb(a,b,c,d){var e=a.aaSorting,h=a.aoColumns[b].asSorting,f=function(g,k){var m=g._idx;m===q&&(m=l.inArray(g[1],h));return m+1<h.length?m+1:k?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=l.inArray(b,U(e,"0")),-1!==c?(b=f(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=h[b],e[c]._idx=b)):
(e.push([b,h[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=f(e[0]),e.length=1,e[0][1]=h[b],e[0]._idx=b):(e.length=0,e.push([b,h[0]]),e[0]._idx=0);ka(a);"function"==typeof d&&d(a)}function kb(a,b,c,d){var e=a.aoColumns[c];sb(b,{},function(h){!1!==e.bSortable&&(a.oFeatures.bProcessing?(V(a,!0),setTimeout(function(){rb(a,c,h.shiftKey,d);"ssp"!==Q(a)&&V(a,!1)},0)):rb(a,c,h.shiftKey,d))})}function Va(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=oa(a),e=a.oFeatures,h;if(e.bSort&&e.bSortClasses){e=
0;for(h=b.length;e<h;e++){var f=b[e].src;l(U(a.aoData,"anCells",f)).removeClass(c+(2>e?e+1:3))}e=0;for(h=d.length;e<h;e++)f=d[e].src,l(U(a.aoData,"anCells",f)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function fc(a,b){var c=a.aoColumns[b],d=u.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ua(a,b)));for(var h,f=u.ext.type.order[c.sType+"-pre"],g=0,k=a.aoData.length;g<k;g++)if(c=a.aoData[g],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)h=d?e[g]:T(a,g,b,"sort"),c._aSortData[b]=f?f(h):h}
function Da(a){if(!a._bLoadingState){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:l.extend(!0,[],a.aaSorting),search:Zb(a.oPreviousSearch),columns:l.map(a.aoColumns,function(c,d){return{visible:c.bVisible,search:Zb(a.aoPreSearchCols[d])}})};a.oSavedState=b;F(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oFeatures.bStateSave&&!a.bDestroying&&a.fnStateSaveCallback.call(a.oInstance,a,b)}}function hc(a,b,c){if(a.oFeatures.bStateSave)return b=a.fnStateLoadCallback.call(a.oInstance,
a,function(d){tb(a,d,c)}),b!==q&&tb(a,b,c),!0;c()}function tb(a,b,c){var d,e=a.aoColumns;a._bLoadingState=!0;var h=a._bInitComplete?new u.Api(a):null;if(b&&b.time){var f=F(a,"aoStateLoadParams","stateLoadParams",[a,b]);if(-1!==l.inArray(!1,f))a._bLoadingState=!1;else if(f=a.iStateDuration,0<f&&b.time<+new Date-1E3*f)a._bLoadingState=!1;else if(b.columns&&e.length!==b.columns.length)a._bLoadingState=!1;else{a.oLoadedState=l.extend(!0,{},b);b.length!==q&&(h?h.page.len(b.length):a._iDisplayLength=b.length);
b.start!==q&&(null===h?(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start):Ta(a,b.start/a._iDisplayLength));b.order!==q&&(a.aaSorting=[],l.each(b.order,function(k,m){a.aaSorting.push(m[0]>=e.length?[0,m[1]]:m)}));b.search!==q&&l.extend(a.oPreviousSearch,$b(b.search));if(b.columns){f=0;for(d=b.columns.length;f<d;f++){var g=b.columns[f];g.visible!==q&&(h?h.column(f).visible(g.visible,!1):e[f].bVisible=g.visible);g.search!==q&&l.extend(a.aoPreSearchCols[f],$b(g.search))}h&&h.columns.adjust()}a._bLoadingState=
!1;F(a,"aoStateLoaded","stateLoaded",[a,b])}}else a._bLoadingState=!1;c()}function Wa(a){var b=u.settings;a=l.inArray(a,U(b,"nTable"));return-1!==a?b[a]:null}function ea(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)y.console&&console.log&&console.log(c);else if(b=u.ext,b=b.sErrMode||b.errMode,a&&F(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function Y(a,b,c,d){Array.isArray(c)?l.each(c,function(e,h){Array.isArray(h)?Y(a,b,h[0],h[1]):Y(a,b,h)}):(d===q&&(d=c),b[c]!==q&&(a[d]=b[c]))}function ub(a,b,c){var d;for(d in b)if(b.hasOwnProperty(d)){var e=b[d];l.isPlainObject(e)?(l.isPlainObject(a[d])||(a[d]={}),l.extend(!0,a[d],e)):c&&"data"!==d&&"aaData"!==d&&Array.isArray(e)?a[d]=e.slice():a[d]=e}return a}function sb(a,b,c){l(a).on("click.DT",b,function(d){l(a).trigger("blur");c(d)}).on("keypress.DT",b,function(d){13===d.which&&
(d.preventDefault(),c(d))}).on("selectstart.DT",function(){return!1})}function R(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function F(a,b,c,d){var e=[];b&&(e=l.map(a[b].slice().reverse(),function(h,f){return h.fn.apply(a.oInstance,d)}));null!==c&&(b=l.Event(c+".dt"),l(a.nTable).trigger(b,d),e.push(b.result));return e}function qb(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function lb(a,b){a=a.renderer;var c=u.ext.renderer[b];
return l.isPlainObject(a)&&a[b]?c[a[b]]||c._:"string"===typeof a?c[a]||c._:c._}function Q(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Ea(a,b){var c=ic.numbers_length,d=Math.floor(c/2);b<=c?a=pa(0,b):a<=d?(a=pa(0,c-2),a.push("ellipsis"),a.push(b-1)):(a>=b-1-d?a=pa(b-(c-2),b):(a=pa(a-d+2,a+d-1),a.push("ellipsis"),a.push(b-1)),a.splice(0,0,"ellipsis"),a.splice(0,0,0));a.DT_el="span";return a}function bb(a){l.each({num:function(b){return Xa(b,a)},"num-fmt":function(b){return Xa(b,
a,vb)},"html-num":function(b){return Xa(b,a,Ya)},"html-num-fmt":function(b){return Xa(b,a,Ya,vb)}},function(b,c){M.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(M.type.search[b+a]=M.type.search.html)})}function jc(a,b,c,d,e){return y.moment?a[b](e):y.luxon?a[c](e):d?a[d](e):a}function Za(a,b,c){if(y.moment){var d=y.moment.utc(a,b,c,!0);if(!d.isValid())return null}else if(y.luxon){d=b?y.luxon.DateTime.fromFormat(a,b):y.luxon.DateTime.fromISO(a);if(!d.isValid)return null;d.setLocale(c)}else b?(kc||
alert("DataTables warning: Formatted date without Moment.js or Luxon - https://datatables.net/tn/17"),kc=!0):d=new Date(a);return d}function wb(a){return function(b,c,d,e){0===arguments.length?(d="en",b=c=null):1===arguments.length?(d="en",c=b,b=null):2===arguments.length&&(d=c,c=b,b=null);var h="datetime-"+c;u.ext.type.order[h]||(u.ext.type.detect.unshift(function(f){return f===h?h:!1}),u.ext.type.order[h+"-asc"]=function(f,g){f=f.valueOf();g=g.valueOf();return f===g?0:f<g?-1:1},u.ext.type.order[h+
"-desc"]=function(f,g){f=f.valueOf();g=g.valueOf();return f===g?0:f>g?-1:1});return function(f,g){if(null===f||f===q)"--now"===e?(f=new Date,f=new Date(Date.UTC(f.getFullYear(),f.getMonth(),f.getDate(),f.getHours(),f.getMinutes(),f.getSeconds()))):f="";if("type"===g)return h;if(""===f)return"sort"!==g?"":Za("0000-01-01 00:00:00",null,d);if(null!==c&&b===c&&"sort"!==g&&"type"!==g&&!(f instanceof Date))return f;var k=Za(f,b,d);if(null===k)return f;if("sort"===g)return k;f=null===c?jc(k,"toDate","toJSDate",
"")[a]():jc(k,"format","toFormat","toISOString",c);return"display"===g?$a(f):f}}}function lc(a){return function(){var b=[Wa(this[u.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return u.ext.internal[a].apply(this,b)}}var u=function(a,b){if(this instanceof u)return l(a).DataTable(b);b=a;this.$=function(f,g){return this.api(!0).$(f,g)};this._=function(f,g){return this.api(!0).rows(f,g).data()};this.api=function(f){return f?new B(Wa(this[M.iApiIndex])):new B(this)};this.fnAddData=function(f,
g){var k=this.api(!0);f=Array.isArray(f)&&(Array.isArray(f[0])||l.isPlainObject(f[0]))?k.rows.add(f):k.row.add(f);(g===q||g)&&k.draw();return f.flatten().toArray()};this.fnAdjustColumnSizing=function(f){var g=this.api(!0).columns.adjust(),k=g.settings()[0],m=k.oScroll;f===q||f?g.draw(!1):(""!==m.sX||""!==m.sY)&&Ja(k)};this.fnClearTable=function(f){var g=this.api(!0).clear();(f===q||f)&&g.draw()};this.fnClose=function(f){this.api(!0).row(f).child.hide()};this.fnDeleteRow=function(f,g,k){var m=this.api(!0);
f=m.rows(f);var n=f.settings()[0],p=n.aoData[f[0][0]];f.remove();g&&g.call(this,n,p);(k===q||k)&&m.draw();return p};this.fnDestroy=function(f){this.api(!0).destroy(f)};this.fnDraw=function(f){this.api(!0).draw(f)};this.fnFilter=function(f,g,k,m,n,p){n=this.api(!0);null===g||g===q?n.search(f,k,m,p):n.column(g).search(f,k,m,p);n.draw()};this.fnGetData=function(f,g){var k=this.api(!0);if(f!==q){var m=f.nodeName?f.nodeName.toLowerCase():"";return g!==q||"td"==m||"th"==m?k.cell(f,g).data():k.row(f).data()||
null}return k.data().toArray()};this.fnGetNodes=function(f){var g=this.api(!0);return f!==q?g.row(f).node():g.rows().nodes().flatten().toArray()};this.fnGetPosition=function(f){var g=this.api(!0),k=f.nodeName.toUpperCase();return"TR"==k?g.row(f).index():"TD"==k||"TH"==k?(f=g.cell(f).index(),[f.row,f.columnVisible,f.column]):null};this.fnIsOpen=function(f){return this.api(!0).row(f).child.isShown()};this.fnOpen=function(f,g,k){return this.api(!0).row(f).child(g,k).show().child()[0]};this.fnPageChange=
function(f,g){f=this.api(!0).page(f);(g===q||g)&&f.draw(!1)};this.fnSetColumnVis=function(f,g,k){f=this.api(!0).column(f).visible(g);(k===q||k)&&f.columns.adjust().draw()};this.fnSettings=function(){return Wa(this[M.iApiIndex])};this.fnSort=function(f){this.api(!0).order(f).draw()};this.fnSortListener=function(f,g,k){this.api(!0).order.listener(f,g,k)};this.fnUpdate=function(f,g,k,m,n){var p=this.api(!0);k===q||null===k?p.row(g).data(f):p.cell(g,k).data(f);(n===q||n)&&p.columns.adjust();(m===q||m)&&
p.draw();return 0};this.fnVersionCheck=M.fnVersionCheck;var c=this,d=b===q,e=this.length;d&&(b={});this.oApi=this.internal=M.internal;for(var h in u.ext.internal)h&&(this[h]=lc(h));this.each(function(){var f={},g=1<e?ub(f,b,!0):b,k=0,m;f=this.getAttribute("id");var n=!1,p=u.defaults,t=l(this);if("table"!=this.nodeName.toLowerCase())ea(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{Db(p);Eb(p.column);P(p,p,!0);P(p.column,p.column,!0);P(p,l.extend(g,t.data()),!0);var v=u.settings;
k=0;for(m=v.length;k<m;k++){var x=v[k];if(x.nTable==this||x.nTHead&&x.nTHead.parentNode==this||x.nTFoot&&x.nTFoot.parentNode==this){var w=g.bRetrieve!==q?g.bRetrieve:p.bRetrieve;if(d||w)return x.oInstance;if(g.bDestroy!==q?g.bDestroy:p.bDestroy){x.oInstance.fnDestroy();break}else{ea(x,0,"Cannot reinitialise DataTable",3);return}}if(x.sTableId==this.id){v.splice(k,1);break}}if(null===f||""===f)this.id=f="DataTables_Table_"+u.ext._unique++;var r=l.extend(!0,{},u.models.oSettings,{sDestroyWidth:t[0].style.width,
sInstance:f,sTableId:f});r.nTable=this;r.oApi=c.internal;r.oInit=g;v.push(r);r.oInstance=1===c.length?c:t.dataTable();Db(g);la(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=Array.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=ub(l.extend(!0,{},p),g);Y(r.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));Y(r,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod",
"aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);Y(r.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);Y(r.oLanguage,g,"fnInfoCallback");
R(r,"aoDrawCallback",g.fnDrawCallback,"user");R(r,"aoServerParams",g.fnServerParams,"user");R(r,"aoStateSaveParams",g.fnStateSaveParams,"user");R(r,"aoStateLoadParams",g.fnStateLoadParams,"user");R(r,"aoStateLoaded",g.fnStateLoaded,"user");R(r,"aoRowCallback",g.fnRowCallback,"user");R(r,"aoRowCreatedCallback",g.fnCreatedRow,"user");R(r,"aoHeaderCallback",g.fnHeaderCallback,"user");R(r,"aoFooterCallback",g.fnFooterCallback,"user");R(r,"aoInitComplete",g.fnInitComplete,"user");R(r,"aoPreDrawCallback",
g.fnPreDrawCallback,"user");r.rowIdFn=ma(g.rowId);Fb(r);var C=r.oClasses;l.extend(C,u.ext.classes,g.oClasses);t.addClass(C.sTable);r.iInitDisplayStart===q&&(r.iInitDisplayStart=g.iDisplayStart,r._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(r.bDeferLoading=!0,f=Array.isArray(g.iDeferLoading),r._iRecordsDisplay=f?g.iDeferLoading[0]:g.iDeferLoading,r._iRecordsTotal=f?g.iDeferLoading[1]:g.iDeferLoading);var G=r.oLanguage;l.extend(!0,G,g.oLanguage);G.sUrl?(l.ajax({dataType:"json",url:G.sUrl,
success:function(I){P(p.oLanguage,I);la(I);l.extend(!0,G,I,r.oInit.oLanguage);F(r,null,"i18n",[r]);Aa(r)},error:function(){Aa(r)}}),n=!0):F(r,null,"i18n",[r]);null===g.asStripeClasses&&(r.asStripeClasses=[C.sStripeOdd,C.sStripeEven]);f=r.asStripeClasses;var ba=t.children("tbody").find("tr").eq(0);-1!==l.inArray(!0,l.map(f,function(I,H){return ba.hasClass(I)}))&&(l("tbody tr",this).removeClass(f.join(" ")),r.asDestroyStripes=f.slice());f=[];v=this.getElementsByTagName("thead");0!==v.length&&(wa(r.aoHeader,
v[0]),f=Pa(r));if(null===g.aoColumns)for(v=[],k=0,m=f.length;k<m;k++)v.push(null);else v=g.aoColumns;k=0;for(m=v.length;k<m;k++)cb(r,f?f[k]:null);Hb(r,g.aoColumnDefs,v,function(I,H){Ia(r,I,H)});if(ba.length){var L=function(I,H){return null!==I.getAttribute("data-"+H)?H:null};l(ba[0]).children("th, td").each(function(I,H){var fa=r.aoColumns[I];if(fa.mData===I){var Z=L(H,"sort")||L(H,"order");H=L(H,"filter")||L(H,"search");if(null!==Z||null!==H)fa.mData={_:I+".display",sort:null!==Z?I+".@data-"+Z:q,
type:null!==Z?I+".@data-"+Z:q,filter:null!==H?I+".@data-"+H:q},Ia(r,I)}})}var O=r.oFeatures;f=function(){if(g.aaSorting===q){var I=r.aaSorting;k=0;for(m=I.length;k<m;k++)I[k][1]=r.aoColumns[k].asSorting[0]}Va(r);O.bSort&&R(r,"aoDrawCallback",function(){if(r.bSorted){var Z=oa(r),Ba={};l.each(Z,function(X,ca){Ba[ca.src]=ca.dir});F(r,null,"order",[r,Z,Ba]);gc(r)}});R(r,"aoDrawCallback",function(){(r.bSorted||"ssp"===Q(r)||O.bDeferRender)&&Va(r)},"sc");I=t.children("caption").each(function(){this._captionSide=
l(this).css("caption-side")});var H=t.children("thead");0===H.length&&(H=l("<thead/>").appendTo(t));r.nTHead=H[0];var fa=t.children("tbody");0===fa.length&&(fa=l("<tbody/>").insertAfter(H));r.nTBody=fa[0];H=t.children("tfoot");0===H.length&&0<I.length&&(""!==r.oScroll.sX||""!==r.oScroll.sY)&&(H=l("<tfoot/>").appendTo(t));0===H.length||0===H.children().length?t.addClass(C.sNoFooter):0<H.length&&(r.nTFoot=H[0],wa(r.aoFooter,r.nTFoot));if(g.aaData)for(k=0;k<g.aaData.length;k++)ia(r,g.aaData[k]);else(r.bDeferLoading||
"dom"==Q(r))&&La(r,l(r.nTBody).children("tr"));r.aiDisplay=r.aiDisplayMaster.slice();r.bInitialised=!0;!1===n&&Aa(r)};R(r,"aoDrawCallback",Da,"state_save");g.bStateSave?(O.bStateSave=!0,hc(r,g,f)):f()}});c=null;return this},M,z,J,xb={},mc=/[\r\n\u2028]/g,Ya=/<.*?>/g,Dc=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,Ec=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^|\-)/g,vb=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,aa=function(a){return a&&!0!==a&&"-"!==a?!1:!0},nc=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},oc=function(a,b){xb[b]||(xb[b]=new RegExp(ob(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(xb[b],"."):a},yb=function(a,b,c){var d="string"===typeof a;if(aa(a))return!0;b&&d&&(a=oc(a,b));c&&d&&(a=a.replace(vb,""));return!isNaN(parseFloat(a))&&isFinite(a)},pc=function(a,b,c){return aa(a)?!0:aa(a)||"string"===typeof a?yb(a.replace(Ya,""),b,c)?!0:null:null},U=function(a,b,c){var d=[],e=0,h=a.length;
if(c!==q)for(;e<h;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<h;e++)a[e]&&d.push(a[e][b]);return d},Fa=function(a,b,c,d){var e=[],h=0,f=b.length;if(d!==q)for(;h<f;h++)a[b[h]][c]&&e.push(a[b[h]][c][d]);else for(;h<f;h++)e.push(a[b[h]][c]);return e},pa=function(a,b){var c=[];if(b===q){b=0;var d=a}else d=b,b=a;for(a=b;a<d;a++)c.push(a);return c},qc=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},Oa=function(a){a:{if(!(2>a.length)){var b=a.slice().sort();for(var c=b[0],
d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();b=[];e=a.length;var h,f=0;d=0;a:for(;d<e;d++){c=a[d];for(h=0;h<f;h++)if(b[h]===c)continue a;b.push(c);f++}return b},rc=function(a,b){if(Array.isArray(b))for(var c=0;c<b.length;c++)rc(a,b[c]);else a.push(b);return a},sc=function(a,b){b===q&&(b=0);return-1!==this.indexOf(a,b)};Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});Array.prototype.includes||(Array.prototype.includes=
sc);String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});String.prototype.includes||(String.prototype.includes=sc);u.util={throttle:function(a,b){var c=b!==q?b:200,d,e;return function(){var h=this,f=+new Date,g=arguments;d&&f<d+c?(clearTimeout(e),e=setTimeout(function(){d=q;a.apply(h,g)},c)):(d=f,a.apply(h,g))}},escapeRegex:function(a){return a.replace(Ec,"\\$1")},set:function(a){if(l.isPlainObject(a))return u.util.set(a._);if(null===a)return function(){};if("function"===typeof a)return function(c,d,e){a(c,"set",d,e)};if("string"!==typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(c,d){c[a]=d};var b=function(c,d,e){e=hb(e);var h=e[e.length-1];for(var f,g,k=0,m=e.length-1;k<m;k++){if("__proto__"===e[k]||"constructor"===e[k])throw Error("Cannot set prototype values");f=e[k].match(Ga);g=e[k].match(qa);if(f){e[k]=e[k].replace(Ga,"");c[e[k]]=[];h=e.slice();h.splice(0,k+1);f=h.join(".");if(Array.isArray(d))for(g=
0,m=d.length;g<m;g++)h={},b(h,d[g],f),c[e[k]].push(h);else c[e[k]]=d;return}g&&(e[k]=e[k].replace(qa,""),c=c[e[k]](d));if(null===c[e[k]]||c[e[k]]===q)c[e[k]]={};c=c[e[k]]}if(h.match(qa))c[h.replace(qa,"")](d);else c[h.replace(Ga,"")]=d};return function(c,d){return b(c,d,a)}},get:function(a){if(l.isPlainObject(a)){var b={};l.each(a,function(d,e){e&&(b[d]=u.util.get(e))});return function(d,e,h,f){var g=b[e]||b._;return g!==q?g(d,e,h,f):d}}if(null===a)return function(d){return d};if("function"===typeof a)return function(d,
e,h,f){return a(d,e,h,f)};if("string"!==typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(d,e){return d[a]};var c=function(d,e,h){if(""!==h){var f=hb(h);for(var g=0,k=f.length;g<k;g++){h=f[g].match(Ga);var m=f[g].match(qa);if(h){f[g]=f[g].replace(Ga,"");""!==f[g]&&(d=d[f[g]]);m=[];f.splice(0,g+1);f=f.join(".");if(Array.isArray(d))for(g=0,k=d.length;g<k;g++)m.push(c(d[g],e,f));d=h[0].substring(1,h[0].length-1);d=""===d?m:m.join(d);break}else if(m){f[g]=f[g].replace(qa,
"");d=d[f[g]]();continue}if(null===d||d[f[g]]===q)return q;d=d[f[g]]}}return d};return function(d,e){return c(d,e,a)}}};var S=function(a,b,c){a[b]!==q&&(a[c]=a[b])},Ga=/\[.*?\]$/,qa=/\(\)$/,ma=u.util.get,ha=u.util.set,ob=u.util.escapeRegex,Sa=l("<div>")[0],Bc=Sa.textContent!==q,Cc=/<.*?>/g,mb=u.util.throttle,tc=[],N=Array.prototype,Fc=function(a){var b,c=u.settings,d=l.map(c,function(h,f){return h.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase()){var e=
l.inArray(a,d);return-1!==e?[c[e]]:null}if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?b=l(a):a instanceof l&&(b=a)}else return[];if(b)return b.map(function(h){e=l.inArray(this,d);return-1!==e?c[e]:null}).toArray()};var B=function(a,b){if(!(this instanceof B))return new B(a,b);var c=[],d=function(f){(f=Fc(f))&&c.push.apply(c,f)};if(Array.isArray(a))for(var e=0,h=a.length;e<h;e++)d(a[e]);else d(a);this.context=Oa(c);b&&l.merge(this,b);this.selector={rows:null,
cols:null,opts:null};B.extend(this,this,tc)};u.Api=B;l.extend(B.prototype,{any:function(){return 0!==this.count()},concat:N.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new B(b[a],this[a]):null},filter:function(a){var b=[];if(N.filter)b=N.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);
return new B(this.context,b)},flatten:function(){var a=[];return new B(this.context,a.concat.apply(a,this.toArray()))},join:N.join,indexOf:N.indexOf||function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1},iterator:function(a,b,c,d){var e=[],h,f,g=this.context,k,m=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);var n=0;for(h=g.length;n<h;n++){var p=new B(g[n]);if("table"===b){var t=c.call(p,g[n],n);t!==q&&e.push(t)}else if("columns"===b||"rows"===b)t=c.call(p,g[n],
this[n],n),t!==q&&e.push(t);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){var v=this[n];"column-rows"===b&&(k=ab(g[n],m.opts));var x=0;for(f=v.length;x<f;x++)t=v[x],t="cell"===b?c.call(p,g[n],t.row,t.column,n,x):c.call(p,g[n],t,n,x,k),t!==q&&e.push(t)}}return e.length||d?(a=new B(g,a?e.concat.apply([],e):e),b=a.selector,b.rows=m.rows,b.cols=m.cols,b.opts=m.opts,a):this},lastIndexOf:N.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,
map:function(a){var b=[];if(N.map)b=N.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new B(this.context,b)},pluck:function(a){var b=u.util.get(a);return this.map(function(c){return b(c)})},pop:N.pop,push:N.push,reduce:N.reduce||function(a,b){return Gb(this,a,b,0,this.length,1)},reduceRight:N.reduceRight||function(a,b){return Gb(this,a,b,this.length-1,-1,-1)},reverse:N.reverse,selector:null,shift:N.shift,slice:function(){return new B(this.context,
this)},sort:N.sort,splice:N.splice,toArray:function(){return N.slice.call(this)},to$:function(){return l(this)},toJQuery:function(){return l(this)},unique:function(){return new B(this.context,Oa(this))},unshift:N.unshift});B.extend=function(a,b,c){if(c.length&&b&&(b instanceof B||b.__dt_wrapper)){var d,e=function(g,k,m){return function(){var n=k.apply(g,arguments);B.extend(n,n,m.methodExt);return n}};var h=0;for(d=c.length;h<d;h++){var f=c[h];b[f.name]="function"===f.type?e(a,f.val,f):"object"===f.type?{}:f.val;b[f.name].__dt_wrapper=!0;B.extend(a,b[f.name],f.propExt)}}};B.register=z=function(a,b){if(Array.isArray(a))for(var c=0,d=a.length;c<d;c++)B.register(a[c],b);else{d=a.split(".");var e=tc,h;a=0;for(c=d.length;a<c;a++){var f=(h=-1!==d[a].indexOf("()"))?d[a].replace("()",""):d[a];a:{var g=0;for(var k=e.length;g<k;g++)if(e[g].name===f){g=e[g];break a}g=null}g||(g={name:f,val:{},methodExt:[],propExt:[],type:"object"},e.push(g));a===c-1?(g.val=b,g.type="function"===typeof b?"function":l.isPlainObject(b)?
"object":"other"):e=h?g.methodExt:g.propExt}}};B.registerPlural=J=function(a,b,c){B.register(a,c);B.register(b,function(){var d=c.apply(this,arguments);return d===this?this:d instanceof B?d.length?Array.isArray(d[0])?new B(d.context,d[0]):d[0]:q:d})};var uc=function(a,b){if(Array.isArray(a))return l.map(a,function(d){return uc(d,b)});if("number"===typeof a)return[b[a]];var c=l.map(b,function(d,e){return d.nTable});return l(c).filter(a).map(function(d){d=l.inArray(this,c);return b[d]}).toArray()};
z("tables()",function(a){return a!==q&&null!==a?new B(uc(a,this.context)):this});z("table()",function(a){a=this.tables(a);var b=a.context;return b.length?new B(b[0]):a});J("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});J("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});J("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},
1)});J("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});J("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});z("draw()",function(a){return this.iterator("table",function(b){"page"===a?ja(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),ka(b,!1===a))})});z("page()",function(a){return a===q?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});z("page.info()",
function(a){if(0===this.context.length)return q;a=this.context[0];var b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===Q(a)}});z("page.len()",function(a){return a===q?0!==this.context.length?this.context[0]._iDisplayLength:q:this.iterator("table",function(b){pb(b,a)})});var vc=function(a,b,
c){if(c){var d=new B(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==Q(a))ka(a,b);else{V(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();Qa(a,[],function(h){Ma(a);h=za(a,h);for(var f=0,g=h.length;f<g;f++)ia(a,h[f]);ka(a,b);V(a,!1)})}};z("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});z("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});z("ajax.reload()",function(a,b){return this.iterator("table",function(c){vc(c,!1===b,a)})});
z("ajax.url()",function(a){var b=this.context;if(a===q){if(0===b.length)return q;b=b[0];return b.ajax?l.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(c){l.isPlainObject(c.ajax)?c.ajax.url=a:c.ajax=a})});z("ajax.url().load()",function(a,b){return this.iterator("table",function(c){vc(c,!1===b,a)})});var zb=function(a,b,c,d,e){var h=[],f,g,k;var m=typeof b;b&&"string"!==m&&"function"!==m&&b.length!==q||(b=[b]);m=0;for(g=b.length;m<g;m++){var n=b[m]&&b[m].split&&
!b[m].match(/[\[\(:]/)?b[m].split(","):[b[m]];var p=0;for(k=n.length;p<k;p++)(f=c("string"===typeof n[p]?n[p].trim():n[p]))&&f.length&&(h=h.concat(f))}a=M.selector[a];if(a.length)for(m=0,g=a.length;m<g;m++)h=a[m](d,e,h);return Oa(h)},Ab=function(a){a||(a={});a.filter&&a.search===q&&(a.search=a.filter);return l.extend({search:"none",order:"current",page:"all"},a)},Bb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=
0;return a},ab=function(a,b){var c=[],d=a.aiDisplay;var e=a.aiDisplayMaster;var h=b.search;var f=b.order;b=b.page;if("ssp"==Q(a))return"removed"===h?[]:pa(0,e.length);if("current"==b)for(f=a._iDisplayStart,a=a.fnDisplayEnd();f<a;f++)c.push(d[f]);else if("current"==f||"applied"==f)if("none"==h)c=e.slice();else if("applied"==h)c=d.slice();else{if("removed"==h){var g={};f=0;for(a=d.length;f<a;f++)g[d[f]]=null;c=l.map(e,function(k){return g.hasOwnProperty(k)?null:k})}}else if("index"==f||"original"==f)for(f=0,a=a.aoData.length;f<a;f++)"none"==h?c.push(f):(e=l.inArray(f,d),(-1===e&&"removed"==h||0<=e&&"applied"==h)&&c.push(f));return c},Gc=function(a,b,c){var d;return zb("row",b,function(e){var h=nc(e),f=a.aoData;if(null!==h&&!c)return[h];d||(d=ab(a,c));if(null!==h&&-1!==l.inArray(h,d))return[h];if(null===e||e===q||""===e)return d;if("function"===typeof e)return l.map(d,function(k){var m=f[k];return e(k,m._aData,m.nTr)?k:null});if(e.nodeName){h=e._DT_RowIndex;var g=e._DT_CellIndex;if(h!==q)return f[h]&&
f[h].nTr===e?[h]:[];if(g)return f[g.row]&&f[g.row].nTr===e.parentNode?[g.row]:[];h=l(e).closest("*[data-dt-row]");return h.length?[h.data("dt-row")]:[]}if("string"===typeof e&&"#"===e.charAt(0)&&(h=a.aIds[e.replace(/^#/,"")],h!==q))return[h.idx];h=qc(Fa(a.aoData,d,"nTr"));return l(h).filter(e).map(function(){return this._DT_RowIndex}).toArray()},a,c)};z("rows()",function(a,b){a===q?a="":l.isPlainObject(a)&&(b=a,a="");b=Ab(b);var c=this.iterator("table",function(d){return Gc(d,a,b)},1);c.selector.rows=
a;c.selector.opts=b;return c});z("rows().nodes()",function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||q},1)});z("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return Fa(a.aoData,b,"_aData")},1)});J("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){b=b.aoData[c];return"search"===a?b._aFilterData:b._aSortData},1)});J("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){va(b,
c,a)})});J("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,b){return b},1)});J("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var h=0,f=this[d].length;h<f;h++){var g=c[d].rowIdFn(c[d].aoData[this[d][h]]._aData);b.push((!0===a?"#":"")+g)}return new B(c,b)});J("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,h=e[c],f,g;e.splice(c,1);var k=0;for(f=e.length;k<
f;k++){var m=e[k];var n=m.anCells;null!==m.nTr&&(m.nTr._DT_RowIndex=k);if(null!==n)for(m=0,g=n.length;m<g;m++)n[m]._DT_CellIndex.row=k}Na(b.aiDisplayMaster,c);Na(b.aiDisplay,c);Na(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;qb(b);c=b.rowIdFn(h._aData);c!==q&&delete b.aIds[c]});this.iterator("table",function(b){for(var c=0,d=b.aoData.length;c<d;c++)b.aoData[c].idx=c});return this});z("rows.add()",function(a){var b=this.iterator("table",function(d){var e,h=[];var f=0;for(e=a.length;f<e;f++){var g=
a[f];g.nodeName&&"TR"===g.nodeName.toUpperCase()?h.push(La(d,g)[0]):h.push(ia(d,g))}return h},1),c=this.rows(-1);c.pop();l.merge(c,b);return c});z("row()",function(a,b){return Bb(this.rows(a,b))});z("row().data()",function(a){var b=this.context;if(a===q)return b.length&&this.length?b[0].aoData[this[0]]._aData:q;var c=b[0].aoData[this[0]];c._aData=a;Array.isArray(a)&&c.nTr&&c.nTr.id&&ha(b[0].rowId)(a,c.nTr.id);va(b[0],this[0],"data");return this});z("row().node()",function(){var a=this.context;return a.length&&
this.length?a[0].aoData[this[0]].nTr||null:null});z("row.add()",function(a){a instanceof l&&a.length&&(a=a[0]);var b=this.iterator("table",function(c){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?La(c,a)[0]:ia(c,a)});return this.row(b[0])});l(A).on("plugin-init.dt",function(a,b){a=new B(b);a.on("stateSaveParams",function(d,e,h){d=e.rowIdFn;e=e.aoData;for(var f=[],g=0;g<e.length;g++)e[g]._detailsShow&&f.push("#"+d(e[g]._aData));h.childRows=f});var c=a.state.loaded();c&&c.childRows&&a.rows(l.map(c.childRows,
function(d){return d.replace(/:/g,"\\:")})).every(function(){F(b,null,"requestChild",[this])})});var Hc=function(a,b,c,d){var e=[],h=function(f,g){if(Array.isArray(f)||f instanceof l)for(var k=0,m=f.length;k<m;k++)h(f[k],g);else f.nodeName&&"tr"===f.nodeName.toLowerCase()?e.push(f):(k=l("<tr><td></td></tr>").addClass(g),l("td",k).addClass(g).html(f)[0].colSpan=na(a),e.push(k[0]))};h(c,d);b._details&&b._details.detach();b._details=l(e);b._detailsShow&&b._details.insertAfter(b.nTr)},wc=u.util.throttle(function(a){Da(a[0])},
500),Cb=function(a,b){var c=a.context;c.length&&(a=c[0].aoData[b!==q?b:a[0]])&&a._details&&(a._details.remove(),a._detailsShow=q,a._details=q,l(a.nTr).removeClass("dt-hasChild"),wc(c))},xc=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];d._details&&((d._detailsShow=b)?(d._details.insertAfter(d.nTr),l(d.nTr).addClass("dt-hasChild")):(d._details.detach(),l(d.nTr).removeClass("dt-hasChild")),F(c[0],null,"childRow",[b,a.row(a[0])]),Ic(c[0]),wc(c))}},Ic=function(a){var b=new B(a),
c=a.aoData;b.off("draw.dt.DT_details column-sizing.dt.DT_details destroy.dt.DT_details");0<U(c,"_details").length&&(b.on("draw.dt.DT_details",function(d,e){a===e&&b.rows({page:"current"}).eq(0).each(function(h){h=c[h];h._detailsShow&&h._details.insertAfter(h.nTr)})}),b.on("column-sizing.dt.DT_details",function(d,e,h,f){if(a===e)for(e=na(e),h=0,f=c.length;h<f;h++)d=c[h],d._details&&d._details.children("td[colspan]").attr("colspan",e)}),b.on("destroy.dt.DT_details",function(d,e){if(a===e)for(d=0,e=
c.length;d<e;d++)c[d]._details&&Cb(b,d)}))};z("row().child()",function(a,b){var c=this.context;if(a===q)return c.length&&this.length?c[0].aoData[this[0]]._details:q;!0===a?this.child.show():!1===a?Cb(this):c.length&&this.length&&Hc(c[0],c[0].aoData[this[0]],a,b);return this});z(["row().child.show()","row().child().show()"],function(a){xc(this,!0);return this});z(["row().child.hide()","row().child().hide()"],function(){xc(this,!1);return this});z(["row().child.remove()","row().child().remove()"],function(){Cb(this);
return this});z("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var Jc=/^([^:]+):(name|visIdx|visible)$/,yc=function(a,b,c,d,e){c=[];d=0;for(var h=e.length;d<h;d++)c.push(T(a,e[d],b));return c},Kc=function(a,b,c){var d=a.aoColumns,e=U(d,"sName"),h=U(d,"nTh");return zb("column",b,function(f){var g=nc(f);if(""===f)return pa(d.length);if(null!==g)return[0<=g?g:d.length+g];if("function"===typeof f){var k=ab(a,c);return l.map(d,
function(p,t){return f(t,yc(a,t,0,0,k),h[t])?t:null})}var m="string"===typeof f?f.match(Jc):"";if(m)switch(m[2]){case "visIdx":case "visible":g=parseInt(m[1],10);if(0>g){var n=l.map(d,function(p,t){return p.bVisible?t:null});return[n[n.length+g]]}return[ta(a,g)];case "name":return l.map(e,function(p,t){return p===m[1]?t:null});default:return[]}if(f.nodeName&&f._DT_CellIndex)return[f._DT_CellIndex.column];g=l(h).filter(f).map(function(){return l.inArray(this,h)}).toArray();if(g.length||!f.nodeName)return g;
g=l(f).closest("*[data-dt-column]");return g.length?[g.data("dt-column")]:[]},a,c)};z("columns()",function(a,b){a===q?a="":l.isPlainObject(a)&&(b=a,a="");b=Ab(b);var c=this.iterator("table",function(d){return Kc(d,a,b)},1);c.selector.cols=a;c.selector.opts=b;return c});J("columns().header()","column().header()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTh},1)});J("columns().footer()","column().footer()",function(a,b){return this.iterator("column",function(c,
d){return c.aoColumns[d].nTf},1)});J("columns().data()","column().data()",function(){return this.iterator("column-rows",yc,1)});J("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});J("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,h){return Fa(b.aoData,h,"search"===a?"_aFilterData":"_aSortData",c)},1)});J("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",
function(a,b,c,d,e){return Fa(a.aoData,e,"anCells",b)},1)});J("columns().visible()","column().visible()",function(a,b){var c=this,d=this.iterator("column",function(e,h){if(a===q)return e.aoColumns[h].bVisible;var f=e.aoColumns,g=f[h],k=e.aoData,m;if(a!==q&&g.bVisible!==a){if(a){var n=l.inArray(!0,U(f,"bVisible"),h+1);f=0;for(m=k.length;f<m;f++){var p=k[f].nTr;e=k[f].anCells;p&&p.insertBefore(e[h],e[n]||null)}}else l(U(e.aoData,"anCells",h)).detach();g.bVisible=a}});a!==q&&this.iterator("table",function(e){xa(e,
e.aoHeader);xa(e,e.aoFooter);e.aiDisplay.length||l(e.nTBody).find("td[colspan]").attr("colspan",na(e));Da(e);c.iterator("column",function(h,f){F(h,null,"column-visibility",[h,f,a,b])});(b===q||b)&&c.columns.adjust()});return d});J("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ua(b,c):c},1)});z("columns.adjust()",function(){return this.iterator("table",function(a){sa(a)},1)});z("column.index()",function(a,b){if(0!==this.context.length){var c=
this.context[0];if("fromVisible"===a||"toData"===a)return ta(c,b);if("fromData"===a||"toVisible"===a)return ua(c,b)}});z("column()",function(a,b){return Bb(this.columns(a,b))});var Lc=function(a,b,c){var d=a.aoData,e=ab(a,c),h=qc(Fa(d,e,"anCells")),f=l(rc([],h)),g,k=a.aoColumns.length,m,n,p,t,v,x;return zb("cell",b,function(w){var r="function"===typeof w;if(null===w||w===q||r){m=[];n=0;for(p=e.length;n<p;n++)for(g=e[n],t=0;t<k;t++)v={row:g,column:t},r?(x=d[g],w(v,T(a,g,t),x.anCells?x.anCells[t]:null)&&
m.push(v)):m.push(v);return m}if(l.isPlainObject(w))return w.column!==q&&w.row!==q&&-1!==l.inArray(w.row,e)?[w]:[];r=f.filter(w).map(function(C,G){return{row:G._DT_CellIndex.row,column:G._DT_CellIndex.column}}).toArray();if(r.length||!w.nodeName)return r;x=l(w).closest("*[data-dt-row]");return x.length?[{row:x.data("dt-row"),column:x.data("dt-column")}]:[]},a,c)};z("cells()",function(a,b,c){l.isPlainObject(a)&&(a.row===q?(c=a,a=null):(c=b,b=null));l.isPlainObject(b)&&(c=b,b=null);if(null===b||b===q)return this.iterator("table",function(n){return Lc(n,a,Ab(c))});var d=c?{page:c.page,order:c.order,search:c.search}:{},e=this.columns(b,d),h=this.rows(a,d),f,g,k,m;d=this.iterator("table",function(n,p){n=[];f=0;for(g=h[p].length;f<g;f++)for(k=0,m=e[p].length;k<m;k++)n.push({row:h[p][f],column:e[p][k]});return n},1);d=c&&c.selected?this.cells(d,c):d;l.extend(d.selector,{cols:b,rows:a,opts:c});return d});J("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=
a.aoData[b])&&a.anCells?a.anCells[c]:q},1)});z("cells().data()",function(){return this.iterator("cell",function(a,b,c){return T(a,b,c)},1)});J("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});J("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return T(b,c,d,a)},1)});J("cells().indexes()","cell().index()",function(){return this.iterator("cell",
function(a,b,c){return{row:b,column:c,columnVisible:ua(a,c)}},1)});J("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){va(b,c,a,d)})});z("cell()",function(a,b,c){return Bb(this.cells(a,b,c))});z("cell().data()",function(a){var b=this.context,c=this[0];if(a===q)return b.length&&c.length?T(b[0],c[0].row,c[0].column):q;Ib(b[0],c[0].row,c[0].column,a);va(b[0],c[0].row,"data",c[0].column);return this});z("order()",function(a,b){var c=this.context;if(a===q)return 0!==c.length?c[0].aaSorting:q;"number"===typeof a?a=[[a,b]]:a.length&&!Array.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(d){d.aaSorting=a.slice()})});z("order.listener()",function(a,b,c){return this.iterator("table",function(d){kb(d,a,b,c)})});z("order.fixed()",function(a){if(!a){var b=this.context;b=b.length?b[0].aaSortingFixed:q;return Array.isArray(b)?{pre:b}:b}return this.iterator("table",function(c){c.aaSortingFixed=l.extend(!0,{},a)})});
z(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];l.each(b[d],function(h,f){e.push([f,a])});c.aaSorting=e})});z("search()",function(a,b,c,d){var e=this.context;return a===q?0!==e.length?e[0].oPreviousSearch.sSearch:q:this.iterator("table",function(h){h.oFeatures.bFilter&&ya(h,l.extend({},h.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});J("columns().search()","column().search()",
function(a,b,c,d){return this.iterator("column",function(e,h){var f=e.aoPreSearchCols;if(a===q)return f[h].sSearch;e.oFeatures.bFilter&&(l.extend(f[h],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ya(e,e.oPreviousSearch,1))})});z("state()",function(){return this.context.length?this.context[0].oSavedState:null});z("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});z("state.loaded()",function(){return this.context.length?
this.context[0].oLoadedState:null});z("state.save()",function(){return this.iterator("table",function(a){Da(a)})});u.versionCheck=u.fnVersionCheck=function(a){var b=u.version.split(".");a=a.split(".");for(var c,d,e=0,h=a.length;e<h;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};u.isDataTable=u.fnIsDataTable=function(a){var b=l(a).get(0),c=!1;if(a instanceof u.Api)return!0;l.each(u.settings,function(d,e){d=e.nScrollHead?l("table",e.nScrollHead)[0]:null;var h=e.nScrollFoot?
l("table",e.nScrollFoot)[0]:null;if(e.nTable===b||d===b||h===b)c=!0});return c};u.tables=u.fnTables=function(a){var b=!1;l.isPlainObject(a)&&(b=a.api,a=a.visible);var c=l.map(u.settings,function(d){if(!a||a&&l(d.nTable).is(":visible"))return d.nTable});return b?new B(c):c};u.camelToHungarian=P;z("$()",function(a,b){b=this.rows(b).nodes();b=l(b);return l([].concat(b.filter(a).toArray(),b.find(a).toArray()))});l.each(["on","one","off"],function(a,b){z(b+"()",function(){var c=Array.prototype.slice.call(arguments);
c[0]=l.map(c[0].split(/\s/),function(e){return e.match(/\.dt\b/)?e:e+".dt"}).join(" ");var d=l(this.tables().nodes());d[b].apply(d,c);return this})});z("clear()",function(){return this.iterator("table",function(a){Ma(a)})});z("settings()",function(){return new B(this.context,this.context)});z("init()",function(){var a=this.context;return a.length?a[0].oInit:null});z("data()",function(){return this.iterator("table",function(a){return U(a.aoData,"_aData")}).flatten()});z("destroy()",function(a){a=a||
!1;return this.iterator("table",function(b){var c=b.oClasses,d=b.nTable,e=b.nTBody,h=b.nTHead,f=b.nTFoot,g=l(d);e=l(e);var k=l(b.nTableWrapper),m=l.map(b.aoData,function(p){return p.nTr}),n;b.bDestroying=!0;F(b,"aoDestroyCallback","destroy",[b]);a||(new B(b)).columns().visible(!0);k.off(".DT").find(":not(tbody *)").off(".DT");l(y).off(".DT-"+b.sInstance);d!=h.parentNode&&(g.children("thead").detach(),g.append(h));f&&d!=f.parentNode&&(g.children("tfoot").detach(),g.append(f));b.aaSorting=[];b.aaSortingFixed=
[];Va(b);l(m).removeClass(b.asStripeClasses.join(" "));l("th, td",h).removeClass(c.sSortable+" "+c.sSortableAsc+" "+c.sSortableDesc+" "+c.sSortableNone);e.children().detach();e.append(m);h=b.nTableWrapper.parentNode;f=a?"remove":"detach";g[f]();k[f]();!a&&h&&(h.insertBefore(d,b.nTableReinsertBefore),g.css("width",b.sDestroyWidth).removeClass(c.sTable),(n=b.asDestroyStripes.length)&&e.children().each(function(p){l(this).addClass(b.asDestroyStripes[p%n])}));c=l.inArray(b,u.settings);-1!==c&&u.settings.splice(c,
1)})});l.each(["column","row","cell"],function(a,b){z(b+"s().every()",function(c){var d=this.selector.opts,e=this;return this.iterator(b,function(h,f,g,k,m){c.call(e[b](f,"cell"===b?g:d,"cell"===b?d:q),f,g,k,m)})})});z("i18n()",function(a,b,c){var d=this.context[0];a=ma(a)(d.oLanguage);a===q&&(a=b);c!==q&&l.isPlainObject(a)&&(a=a[c]!==q?a[c]:a._);return a.replace("%d",c)});u.version="1.12.1";u.settings=[];u.models={};u.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0,"return":!1};
u.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};u.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,
sWidth:null,sWidthOrig:null};u.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+
a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",
sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:l.extend({},u.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};E(u.defaults);
u.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};E(u.defaults.column);u.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,
bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],
aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,jqXHR:null,json:q,oAjaxData:q,fnServerData:null,aoServerParams:[],sServerMethod:null,
fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Q(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Q(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+
a,d=this.aiDisplay.length,e=this.oFeatures,h=e.bPaginate;return e.bServerSide?!1===h||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!h||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};u.ext=M={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],
search:{},order:{}},_unique:0,fnVersionCheck:u.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:u.version};l.extend(M,{afnFiltering:M.search,aTypes:M.type.detect,ofnSearch:M.type.search,oSort:M.type.order,afnSortData:M.order,aoFeatures:M.feature,oApi:M.internal,oStdClasses:M.classes,oPagination:M.pager});l.extend(u.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",
sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_desc_disabled",sSortableDesc:"sorting_asc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",
sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var ic=u.ext.pager;l.extend(ic,{simple:function(a,b){return["previous","next"]},full:function(a,b){return["first","previous","next","last"]},numbers:function(a,b){return[Ea(a,b)]},simple_numbers:function(a,b){return["previous",
Ea(a,b),"next"]},full_numbers:function(a,b){return["first","previous",Ea(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",Ea(a,b),"last"]},_numbers:Ea,numbers_length:7});l.extend(!0,u.ext.renderer,{pageButton:{_:function(a,b,c,d,e,h){var f=a.oClasses,g=a.oLanguage.oPaginate,k=a.oLanguage.oAria.paginate||{},m,n,p=0,t=function(x,w){var r,C=f.sPageButtonDisabled,G=function(I){Ta(a,I.data.action,!0)};var ba=0;for(r=w.length;ba<r;ba++){var L=w[ba];if(Array.isArray(L)){var O=l("<"+(L.DT_el||
"div")+"/>").appendTo(x);t(O,L)}else{m=null;n=L;O=a.iTabIndex;switch(L){case "ellipsis":x.append('<span class="ellipsis">&#x2026;</span>');break;case "first":m=g.sFirst;0===e&&(O=-1,n+=" "+C);break;case "previous":m=g.sPrevious;0===e&&(O=-1,n+=" "+C);break;case "next":m=g.sNext;if(0===h||e===h-1)O=-1,n+=" "+C;break;case "last":m=g.sLast;if(0===h||e===h-1)O=-1,n+=" "+C;break;default:m=a.fnFormatNumber(L+1),n=e===L?f.sPageButtonActive:""}null!==m&&(O=l("<a>",{"class":f.sPageButton+" "+n,"aria-controls":a.sTableId,
"aria-label":k[L],"data-dt-idx":p,tabindex:O,id:0===c&&"string"===typeof L?a.sTableId+"_"+L:null}).html(m).appendTo(x),sb(O,{action:L},G),p++)}}};try{var v=l(b).find(A.activeElement).data("dt-idx")}catch(x){}t(l(b).empty(),d);v!==q&&l(b).find("[data-dt-idx="+v+"]").trigger("focus")}}});l.extend(u.ext.type.detect,[function(a,b){b=b.oLanguage.sDecimal;return yb(a,b)?"num"+b:null},function(a,b){if(a&&!(a instanceof Date)&&!Dc.test(a))return null;b=Date.parse(a);return null!==b&&!isNaN(b)||aa(a)?"date":
null},function(a,b){b=b.oLanguage.sDecimal;return yb(a,b,!0)?"num-fmt"+b:null},function(a,b){b=b.oLanguage.sDecimal;return pc(a,b)?"html-num"+b:null},function(a,b){b=b.oLanguage.sDecimal;return pc(a,b,!0)?"html-num-fmt"+b:null},function(a,b){return aa(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);l.extend(u.ext.type.search,{html:function(a){return aa(a)?a:"string"===typeof a?a.replace(mc," ").replace(Ya,""):""},string:function(a){return aa(a)?a:"string"===typeof a?a.replace(mc," "):
a}});var Xa=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=oc(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};l.extend(M.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return aa(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return aa(a)?"":"string"===typeof a?a.toLowerCase():a.toString?a.toString():""},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,
b){return a<b?1:a>b?-1:0}});bb("");l.extend(!0,u.ext.renderer,{header:{_:function(a,b,c,d){l(a.nTable).on("order.dt.DT",function(e,h,f,g){a===h&&(e=c.idx,b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==g[e]?d.sSortAsc:"desc"==g[e]?d.sSortDesc:c.sSortingClass))})},jqueryui:function(a,b,c,d){l("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(l("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);l(a.nTable).on("order.dt.DT",function(e,h,f,g){a===h&&(e=c.idx,
b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==g[e]?d.sSortAsc:"desc"==g[e]?d.sSortDesc:c.sSortingClass),b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass("asc"==g[e]?d.sSortJUIAsc:"desc"==g[e]?d.sSortJUIDesc:c.sSortingClassJUI))})}}});var $a=function(a){Array.isArray(a)&&(a=a.join(","));return"string"===typeof a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,
"&quot;"):a},kc=!1,zc=",",Ac=".";if(Intl)try{for(var Ha=(new Intl.NumberFormat).formatToParts(100000.1),ra=0;ra<Ha.length;ra++)"group"===Ha[ra].type?zc=Ha[ra].value:"decimal"===Ha[ra].type&&(Ac=Ha[ra].value)}catch(a){}u.datetime=function(a,b){var c="datetime-detect-"+a;b||(b="en");u.ext.type.order[c]||(u.ext.type.detect.unshift(function(d){var e=Za(d,a,b);return""===d||e?c:!1}),u.ext.type.order[c+"-pre"]=function(d){return Za(d,a,b)||0})};u.render={date:wb("toLocaleDateString"),datetime:wb("toLocaleString"),
time:wb("toLocaleTimeString"),number:function(a,b,c,d,e){if(null===a||a===q)a=zc;if(null===b||b===q)b=Ac;return{display:function(h){if("number"!==typeof h&&"string"!==typeof h||""===h||null===h)return h;var f=0>h?"-":"",g=parseFloat(h);if(isNaN(g))return $a(h);g=g.toFixed(c);h=Math.abs(g);g=parseInt(h,10);h=c?b+(h-g).toFixed(c).substring(2):"";0===g&&0===parseFloat(h)&&(f="");return f+(d||"")+g.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+h+(e||"")}}},text:function(){return{display:$a,filter:$a}}};
l.extend(u.ext.internal,{_fnExternApiFunc:lc,_fnBuildAjax:Qa,_fnAjaxUpdate:Kb,_fnAjaxParameters:Tb,_fnAjaxUpdateDraw:Ub,_fnAjaxDataSrc:za,_fnAddColumn:cb,_fnColumnOptions:Ia,_fnAdjustColumnSizing:sa,_fnVisibleToColumnIndex:ta,_fnColumnIndexToVisible:ua,_fnVisbleColumns:na,_fnGetColumns:Ka,_fnColumnTypes:eb,_fnApplyColumnDefs:Hb,_fnHungarianMap:E,_fnCamelToHungarian:P,_fnLanguageCompat:la,_fnBrowserDetect:Fb,_fnAddData:ia,_fnAddTr:La,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==q?b._DT_RowIndex:
null},_fnNodeToColumnIndex:function(a,b,c){return l.inArray(c,a.aoData[b].anCells)},_fnGetCellData:T,_fnSetCellData:Ib,_fnSplitObjNotation:hb,_fnGetObjectDataFn:ma,_fnSetObjectDataFn:ha,_fnGetDataMaster:ib,_fnClearTable:Ma,_fnDeleteIndex:Na,_fnInvalidate:va,_fnGetRowElements:gb,_fnCreateTr:fb,_fnBuildHead:Jb,_fnDrawHead:xa,_fnDraw:ja,_fnReDraw:ka,_fnAddOptionsHtml:Mb,_fnDetectHeader:wa,_fnGetUniqueThs:Pa,_fnFeatureHtmlFilter:Ob,_fnFilterComplete:ya,_fnFilterCustom:Xb,_fnFilterColumn:Wb,_fnFilter:Vb,
_fnFilterCreateSearch:nb,_fnEscapeRegex:ob,_fnFilterData:Yb,_fnFeatureHtmlInfo:Rb,_fnUpdateInfo:ac,_fnInfoMacros:bc,_fnInitialise:Aa,_fnInitComplete:Ra,_fnLengthChange:pb,_fnFeatureHtmlLength:Nb,_fnFeatureHtmlPaginate:Sb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:Pb,_fnProcessingDisplay:V,_fnFeatureHtmlTable:Qb,_fnScrollDraw:Ja,_fnApplyToChildren:da,_fnCalculateColumnWidths:db,_fnThrottle:mb,_fnConvertToWidth:cc,_fnGetWidestNode:dc,_fnGetMaxLenString:ec,_fnStringToCss:K,_fnSortFlatten:oa,_fnSort:Lb,
_fnSortAria:gc,_fnSortListener:rb,_fnSortAttachListener:kb,_fnSortingClasses:Va,_fnSortData:fc,_fnSaveState:Da,_fnLoadState:hc,_fnImplementState:tb,_fnSettingsFromNode:Wa,_fnLog:ea,_fnMap:Y,_fnBindAction:sb,_fnCallbackReg:R,_fnCallbackFire:F,_fnLengthOverflow:qb,_fnRenderer:lb,_fnDataSource:Q,_fnRowAttributes:jb,_fnExtend:ub,_fnCalculateEnd:function(){}});l.fn.dataTable=u;u.$=l;l.fn.dataTableSettings=u.settings;l.fn.dataTableExt=u.ext;l.fn.DataTable=function(a){return l(this).dataTable(a).api()};
l.each(u,function(a,b){l.fn.DataTable[a]=b});return u});
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,k,m){b instanceof String&&(b=String(b));for(var n=b.length,p=0;p<n;p++){var y=b[p];if(k.call(m,y,p,b))return{i:p,v:y}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,k,m){if(b==Array.prototype||b==Object.prototype)return b;b[k]=m.value;return b};$jscomp.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var k=0;k<b.length;++k){var m=b[k];if(m&&m.Math==Math)return m}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(b,k){var m=$jscomp.propertyToPolyfillSymbol[k];if(null==m)return b[k];m=b[m];return void 0!==m?m:b[k]};
$jscomp.polyfill=function(b,k,m,n){k&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,k,m,n):$jscomp.polyfillUnisolated(b,k,m,n))};$jscomp.polyfillUnisolated=function(b,k,m,n){m=$jscomp.global;b=b.split(".");for(n=0;n<b.length-1;n++){var p=b[n];if(!(p in m))return;m=m[p]}b=b[b.length-1];n=m[b];k=k(n);k!=n&&null!=k&&$jscomp.defineProperty(m,b,{configurable:!0,writable:!0,value:k})};
$jscomp.polyfillIsolated=function(b,k,m,n){var p=b.split(".");b=1===p.length;n=p[0];n=!b&&n in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var y=0;y<p.length-1;y++){var z=p[y];if(!(z in n))return;n=n[z]}p=p[p.length-1];m=$jscomp.IS_SYMBOL_NATIVE&&"es6"===m?n[p]:null;k=k(m);null!=k&&(b?$jscomp.defineProperty($jscomp.polyfills,p,{configurable:!0,writable:!0,value:k}):k!==m&&($jscomp.propertyToPolyfillSymbol[p]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(p):$jscomp.POLYFILL_PREFIX+p,p=
$jscomp.propertyToPolyfillSymbol[p],$jscomp.defineProperty(n,p,{configurable:!0,writable:!0,value:k})))};$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(k,m){return $jscomp.findInternal(this,k,m).v}},"es6","es3");
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(k){return b(k,window,document)}):"object"===typeof exports?module.exports=function(k,m){k||(k=window);m&&m.fn.dataTable||(m=require("datatables.net")(k,m).$);return b(m,k,k.document)}:b(jQuery,window,document)})(function(b,k,m,n){function p(a,c,d){var g=c+"-"+d;if(A[g])return A[g];var f=[];a=a.cell(c,d).node().childNodes;c=0;for(d=a.length;c<d;c++)f.push(a[c]);return A[g]=f}function y(a,c,d){var g=c+"-"+
d;if(A[g]){a=a.cell(c,d).node();d=A[g][0].parentNode.childNodes;c=[];for(var f=0,l=d.length;f<l;f++)c.push(d[f]);d=0;for(f=c.length;d<f;d++)a.appendChild(c[d]);A[g]=n}}var z=b.fn.dataTable,u=function(a,c){if(!z.versionCheck||!z.versionCheck("1.10.10"))throw"DataTables Responsive requires DataTables 1.10.10 or newer";this.s={dt:new z.Api(a),columns:[],current:[]};this.s.dt.settings()[0].responsive||(c&&"string"===typeof c.details?c.details={type:c.details}:c&&!1===c.details?c.details={type:!1}:c&&
!0===c.details&&(c.details={type:"inline"}),this.c=b.extend(!0,{},u.defaults,z.defaults.responsive,c),a.responsive=this,this._constructor())};b.extend(u.prototype,{_constructor:function(){var a=this,c=this.s.dt,d=c.settings()[0],g=b(k).innerWidth();c.settings()[0]._responsive=this;b(k).on("resize.dtr orientationchange.dtr",z.util.throttle(function(){var f=b(k).innerWidth();f!==g&&(a._resize(),g=f)}));d.oApi._fnCallbackReg(d,"aoRowCreatedCallback",function(f,l,h){-1!==b.inArray(!1,a.s.current)&&b(">td, >th",
f).each(function(e){e=c.column.index("toData",e);!1===a.s.current[e]&&b(this).css("display","none")})});c.on("destroy.dtr",function(){c.off(".dtr");b(c.table().body()).off(".dtr");b(k).off("resize.dtr orientationchange.dtr");c.cells(".dtr-control").nodes().to$().removeClass("dtr-control");b.each(a.s.current,function(f,l){!1===l&&a._setColumnVis(f,!0)})});this.c.breakpoints.sort(function(f,l){return f.width<l.width?1:f.width>l.width?-1:0});this._classLogic();this._resizeAuto();d=this.c.details;!1!==d.type&&(a._detailsInit(),c.on("column-visibility.dtr",function(){a._timer&&clearTimeout(a._timer);a._timer=setTimeout(function(){a._timer=null;a._classLogic();a._resizeAuto();a._resize(!0);a._redrawChildren()},100)}),c.on("draw.dtr",function(){a._redrawChildren()}),b(c.table().node()).addClass("dtr-"+d.type));c.on("column-reorder.dtr",function(f,l,h){a._classLogic();a._resizeAuto();a._resize(!0)});c.on("column-sizing.dtr",function(){a._resizeAuto();a._resize()});c.on("column-calc.dt",function(f,
l){f=a.s.current;for(var h=0;h<f.length;h++){var e=l.visible.indexOf(h);!1===f[h]&&0<=e&&l.visible.splice(e,1)}});c.on("preXhr.dtr",function(){var f=[];c.rows().every(function(){this.child.isShown()&&f.push(this.id(!0))});c.one("draw.dtr",function(){a._resizeAuto();a._resize();c.rows(f).every(function(){a._detailsDisplay(this,!1)})})});c.on("draw.dtr",function(){a._controlClass()}).on("init.dtr",function(f,l,h){"dt"===f.namespace&&(a._resizeAuto(),a._resize(),b.inArray(!1,a.s.current)&&c.columns.adjust())});
this._resize()},_columnsVisiblity:function(a){var c=this.s.dt,d=this.s.columns,g,f=d.map(function(t,v){return{columnIdx:v,priority:t.priority}}).sort(function(t,v){return t.priority!==v.priority?t.priority-v.priority:t.columnIdx-v.columnIdx}),l=b.map(d,function(t,v){return!1===c.column(v).visible()?"not-visible":t.auto&&null===t.minWidth?!1:!0===t.auto?"-":-1!==b.inArray(a,t.includeIn)}),h=0;var e=0;for(g=l.length;e<g;e++)!0===l[e]&&(h+=d[e].minWidth);e=c.settings()[0].oScroll;e=e.sY||e.sX?e.iBarWidth:
0;h=c.table().container().offsetWidth-e-h;e=0;for(g=l.length;e<g;e++)d[e].control&&(h-=d[e].minWidth);var r=!1;e=0;for(g=f.length;e<g;e++){var q=f[e].columnIdx;"-"===l[q]&&!d[q].control&&d[q].minWidth&&(r||0>h-d[q].minWidth?(r=!0,l[q]=!1):l[q]=!0,h-=d[q].minWidth)}f=!1;e=0;for(g=d.length;e<g;e++)if(!d[e].control&&!d[e].never&&!1===l[e]){f=!0;break}e=0;for(g=d.length;e<g;e++)d[e].control&&(l[e]=f),"not-visible"===l[e]&&(l[e]=!1);-1===b.inArray(!0,l)&&(l[0]=!0);return l},_classLogic:function(){var a=
this,c=this.c.breakpoints,d=this.s.dt,g=d.columns().eq(0).map(function(h){var e=this.column(h),r=e.header().className;h=d.settings()[0].aoColumns[h].responsivePriority;e=e.header().getAttribute("data-priority");h===n&&(h=e===n||null===e?1E4:1*e);return{className:r,includeIn:[],auto:!1,control:!1,never:r.match(/\b(dtr\-)?never\b/)?!0:!1,priority:h}}),f=function(h,e){h=g[h].includeIn;-1===b.inArray(e,h)&&h.push(e)},l=function(h,e,r,q){if(!r)g[h].includeIn.push(e);else if("max-"===r)for(q=a._find(e).width,
e=0,r=c.length;e<r;e++)c[e].width<=q&&f(h,c[e].name);else if("min-"===r)for(q=a._find(e).width,e=0,r=c.length;e<r;e++)c[e].width>=q&&f(h,c[e].name);else if("not-"===r)for(e=0,r=c.length;e<r;e++)-1===c[e].name.indexOf(q)&&f(h,c[e].name)};g.each(function(h,e){for(var r=h.className.split(" "),q=!1,t=0,v=r.length;t<v;t++){var B=r[t].trim();if("all"===B||"dtr-all"===B){q=!0;h.includeIn=b.map(c,function(w){return w.name});return}if("none"===B||"dtr-none"===B||h.never){q=!0;return}if("control"===B||"dtr-control"===B){q=!0;h.control=!0;return}b.each(c,function(w,D){w=D.name.split("-");var x=B.match(new RegExp("(min\\-|max\\-|not\\-)?("+w[0]+")(\\-[_a-zA-Z0-9])?"));x&&(q=!0,x[2]===w[0]&&x[3]==="-"+w[1]?l(e,D.name,x[1],x[2]+x[3]):x[2]!==w[0]||x[3]||l(e,D.name,x[1],x[2]))})}q||(h.auto=!0)});this.s.columns=g},_controlClass:function(){if("inline"===this.c.details.type){var a=this.s.dt,c=b.inArray(!0,this.s.current);a.cells(null,function(d){return d!==c},{page:"current"}).nodes().to$().filter(".dtr-control").removeClass("dtr-control");
a.cells(null,c,{page:"current"}).nodes().to$().addClass("dtr-control")}},_detailsDisplay:function(a,c){var d=this,g=this.s.dt,f=this.c.details;if(f&&!1!==f.type){var l="string"===typeof f.renderer?u.renderer[f.renderer]():f.renderer;f=f.display(a,c,function(){return l(g,a[0],d._detailsObj(a[0]))});!0!==f&&!1!==f||b(g.table().node()).triggerHandler("responsive-display.dt",[g,a,f,c])}},_detailsInit:function(){var a=this,c=this.s.dt,d=this.c.details;"inline"===d.type&&(d.target="td.dtr-control, th.dtr-control");
c.on("draw.dtr",function(){a._tabIndexes()});a._tabIndexes();b(c.table().body()).on("keyup.dtr","td, th",function(f){13===f.keyCode&&b(this).data("dtr-keyboard")&&b(this).click()});var g=d.target;d="string"===typeof g?g:"td, th";if(g!==n||null!==g)b(c.table().body()).on("click.dtr mousedown.dtr mouseup.dtr",d,function(f){if(b(c.table().node()).hasClass("collapsed")&&-1!==b.inArray(b(this).closest("tr").get(0),c.rows().nodes().toArray())){if("number"===typeof g){var l=0>g?c.columns().eq(0).length+
g:g;if(c.cell(this).index().column!==l)return}l=c.row(b(this).closest("tr"));"click"===f.type?a._detailsDisplay(l,!1):"mousedown"===f.type?b(this).css("outline","none"):"mouseup"===f.type&&b(this).trigger("blur").css("outline","")}})},_detailsObj:function(a){var c=this,d=this.s.dt;return b.map(this.s.columns,function(g,f){if(!g.never&&!g.control)return g=d.settings()[0].aoColumns[f],{className:g.sClass,columnIndex:f,data:d.cell(a,f).render(c.c.orthogonal),hidden:d.column(f).visible()&&!c.s.current[f],
rowIndex:a,title:null!==g.sTitle?g.sTitle:b(d.column(f).header()).text()}})},_find:function(a){for(var c=this.c.breakpoints,d=0,g=c.length;d<g;d++)if(c[d].name===a)return c[d]},_redrawChildren:function(){var a=this,c=this.s.dt;c.rows({page:"current"}).iterator("row",function(d,g){c.row(g);a._detailsDisplay(c.row(g),!0)})},_resize:function(a){var c=this,d=this.s.dt,g=b(k).innerWidth(),f=this.c.breakpoints,l=f[0].name,h=this.s.columns,e,r=this.s.current.slice();for(e=f.length-1;0<=e;e--)if(g<=f[e].width){l=
f[e].name;break}var q=this._columnsVisiblity(l);this.s.current=q;f=!1;e=0;for(g=h.length;e<g;e++)if(!1===q[e]&&!h[e].never&&!h[e].control&&!1===!d.column(e).visible()){f=!0;break}b(d.table().node()).toggleClass("collapsed",f);var t=!1,v=0;d.columns().eq(0).each(function(B,w){!0===q[w]&&v++;if(a||q[w]!==r[w])t=!0,c._setColumnVis(B,q[w])});t&&(this._redrawChildren(),b(d.table().node()).trigger("responsive-resize.dt",[d,this.s.current]),0===d.page.info().recordsDisplay&&b("td",d.table().body()).eq(0).attr("colspan",
v));c._controlClass()},_resizeAuto:function(){var a=this.s.dt,c=this.s.columns;if(this.c.auto&&-1!==b.inArray(!0,b.map(c,function(e){return e.auto}))){b.isEmptyObject(A)||b.each(A,function(e){e=e.split("-");y(a,1*e[0],1*e[1])});a.table().node();var d=a.table().node().cloneNode(!1),g=b(a.table().header().cloneNode(!1)).appendTo(d),f=b(a.table().body()).clone(!1,!1).empty().appendTo(d);d.style.width="auto";var l=a.columns().header().filter(function(e){return a.column(e).visible()}).to$().clone(!1).css("display",
"table-cell").css("width","auto").css("min-width",0);b(f).append(b(a.rows({page:"current"}).nodes()).clone(!1)).find("th, td").css("display","");if(f=a.table().footer()){f=b(f.cloneNode(!1)).appendTo(d);var h=a.columns().footer().filter(function(e){return a.column(e).visible()}).to$().clone(!1).css("display","table-cell");b("<tr/>").append(h).appendTo(f)}b("<tr/>").append(l).appendTo(g);"inline"===this.c.details.type&&b(d).addClass("dtr-inline collapsed");b(d).find("[name]").removeAttr("name");b(d).css("position",
"relative");d=b("<div/>").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(d);d.insertBefore(a.table().node());l.each(function(e){e=a.column.index("fromVisible",e);c[e].minWidth=this.offsetWidth||0});d.remove()}},_responsiveOnlyHidden:function(){var a=this.s.dt;return b.map(this.s.current,function(c,d){return!1===a.column(d).visible()?!0:c})},_setColumnVis:function(a,c){var d=this.s.dt,g=c?"":"none";b(d.column(a).header()).css("display",g).toggleClass("dtr-hidden",!c);b(d.column(a).footer()).css("display",
g).toggleClass("dtr-hidden",!c);d.column(a).nodes().to$().css("display",g).toggleClass("dtr-hidden",!c);b.isEmptyObject(A)||d.cells(null,a).indexes().each(function(f){y(d,f.row,f.column)})},_tabIndexes:function(){var a=this.s.dt,c=a.cells({page:"current"}).nodes().to$(),d=a.settings()[0],g=this.c.details.target;c.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]");"number"===typeof g?a.cells(null,g,{page:"current"}).nodes().to$().attr("tabIndex",d.iTabIndex).data("dtr-keyboard",1):("td:first-child, th:first-child"===g&&(g=">td:first-child, >th:first-child"),b(g,a.rows({page:"current"}).nodes()).attr("tabIndex",d.iTabIndex).data("dtr-keyboard",1))}});u.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];u.display={childRow:function(a,c,d){if(c){if(b(a.node()).hasClass("parent"))return a.child(d(),"child").show(),!0}else{if(a.child.isShown())return a.child(!1),b(a.node()).removeClass("parent"),!1;a.child(d(),
"child").show();b(a.node()).addClass("parent");return!0}},childRowImmediate:function(a,c,d){if(!c&&a.child.isShown()||!a.responsive.hasHidden())return a.child(!1),b(a.node()).removeClass("parent"),!1;a.child(d(),"child").show();b(a.node()).addClass("parent");return!0},modal:function(a){return function(c,d,g){if(d)b("div.dtr-modal-content").empty().append(g());else{var f=function(){l.remove();b(m).off("keypress.dtr")},l=b('<div class="dtr-modal"/>').append(b('<div class="dtr-modal-display"/>').append(b('<div class="dtr-modal-content"/>').append(g())).append(b('<div class="dtr-modal-close">&times;</div>').click(function(){f()}))).append(b('<div class="dtr-modal-background"/>').click(function(){f()})).appendTo("body");
b(m).on("keyup.dtr",function(h){27===h.keyCode&&(h.stopPropagation(),f())})}a&&a.header&&b("div.dtr-modal-content").prepend("<h2>"+a.header(c)+"</h2>")}}};var A={};u.renderer={listHiddenNodes:function(){return function(a,c,d){var g=b('<ul data-dtr-index="'+c+'" class="dtr-details"/>'),f=!1;b.each(d,function(l,h){h.hidden&&(b("<li "+(h.className?'class="'+h.className+'"':"")+' data-dtr-index="'+h.columnIndex+'" data-dt-row="'+h.rowIndex+'" data-dt-column="'+h.columnIndex+'"><span class="dtr-title">'+
h.title+"</span> </li>").append(b('<span class="dtr-data"/>').append(p(a,h.rowIndex,h.columnIndex))).appendTo(g),f=!0)});return f?g:!1}},listHidden:function(){return function(a,c,d){return(a=b.map(d,function(g){var f=g.className?'class="'+g.className+'"':"";return g.hidden?"<li "+f+' data-dtr-index="'+g.columnIndex+'" data-dt-row="'+g.rowIndex+'" data-dt-column="'+g.columnIndex+'"><span class="dtr-title">'+g.title+'</span> <span class="dtr-data">'+g.data+"</span></li>":""}).join(""))?b('<ul data-dtr-index="'+
c+'" class="dtr-details"/>').append(a):!1}},tableAll:function(a){a=b.extend({tableClass:""},a);return function(c,d,g){c=b.map(g,function(f){return"<tr "+(f.className?'class="'+f.className+'"':"")+' data-dt-row="'+f.rowIndex+'" data-dt-column="'+f.columnIndex+'"><td>'+f.title+":</td> <td>"+f.data+"</td></tr>"}).join("");return b('<table class="'+a.tableClass+' dtr-details" width="100%"/>').append(c)}}};u.defaults={breakpoints:u.breakpoints,auto:!0,details:{display:u.display.childRow,renderer:u.renderer.listHidden(),
target:0,type:"inline"},orthogonal:"display"};var C=b.fn.dataTable.Api;C.register("responsive()",function(){return this});C.register("responsive.index()",function(a){a=b(a);return{column:a.data("dtr-index"),row:a.parent().data("dtr-index")}});C.register("responsive.rebuild()",function(){return this.iterator("table",function(a){a._responsive&&a._responsive._classLogic()})});C.register("responsive.recalc()",function(){return this.iterator("table",function(a){a._responsive&&(a._responsive._resizeAuto(),
a._responsive._resize())})});C.register("responsive.hasHidden()",function(){var a=this.context[0];return a._responsive?-1!==b.inArray(!1,a._responsive._responsiveOnlyHidden()):!1});C.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",function(){return this.iterator("column",function(a,c){return a._responsive?a._responsive._responsiveOnlyHidden()[c]:!1},1)});u.version="2.3.0";b.fn.dataTable.Responsive=u;b.fn.DataTable.Responsive=u;b(m).on("preInit.dt.dtr",function(a,c,d){"dt"===a.namespace&&(b(c.nTable).hasClass("responsive")||b(c.nTable).hasClass("dt-responsive")||c.oInit.responsive||z.defaults.responsive)&&(a=c.oInit.responsive,!1!==a&&new u(c,b.isPlainObject(a)?a:{}))});return u});
;(function (factory){
var registeredInModuleLoader=false;
if(typeof define==='function'&&define.amd){
define(factory);
registeredInModuleLoader=true;
}
if(typeof exports==='object'){
module.exports=factory();
registeredInModuleLoader=true;
}
if(!registeredInModuleLoader){
var OldCookies=window.Cookies;
var api=window.Cookies=factory();
api.noConflict=function (){
window.Cookies=OldCookies;
return api;
};}}(function (){
function extend (){
var i=0;
var result={};
for (; i < arguments.length; i++){
var attributes=arguments[ i ];
for (var key in attributes){
result[key]=attributes[key];
}}
return result;
}
function init (converter){
function api (key, value, attributes){
var result;
if(typeof document==='undefined'){
return;
}
if(arguments.length > 1){
attributes=extend({
path: '/'
}, api.defaults, attributes);
if(typeof attributes.expires==='number'){
var expires=new Date();
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
attributes.expires=expires;
}
attributes.expires=attributes.expires ? attributes.expires.toUTCString():'';
try {
result=JSON.stringify(value);
if(/^[\{\[]/.test(result)){
value=result;
}} catch (e){}
if(!converter.write){
value=encodeURIComponent(String(value))
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
}else{
value=converter.write(value, key);
}
key=encodeURIComponent(String(key));
key=key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key=key.replace(/[\(\)]/g, escape);
var stringifiedAttributes='';
for (var attributeName in attributes){
if(!attributes[attributeName]){
continue;
}
stringifiedAttributes +='; ' + attributeName;
if(attributes[attributeName]===true){
continue;
}
stringifiedAttributes +='=' + attributes[attributeName];
}
return (document.cookie=key + '=' + value + stringifiedAttributes);
}
if(!key){
result={};}
var cookies=document.cookie ? document.cookie.split('; '):[];
var rdecode=/(%[0-9A-Z]{2})+/g;
var i=0;
for (; i < cookies.length; i++){
var parts=cookies[i].split('=');
var cookie=parts.slice(1).join('=');
if(cookie.charAt(0)==='"'){
cookie=cookie.slice(1, -1);
}
try {
var name=parts[0].replace(rdecode, decodeURIComponent);
cookie=converter.read ?
converter.read(cookie, name):converter(cookie, name) ||
cookie.replace(rdecode, decodeURIComponent);
if(this.json){
try {
cookie=JSON.parse(cookie);
} catch (e){}}
if(key===name){
result=cookie;
break;
}
if(!key){
result[name]=cookie;
}} catch (e){}}
return result;
}
api.set=api;
api.get=function (key){
return api.call(api, key);
};
api.getJSON=function (){
return api.apply({
json: true
}, [].slice.call(arguments));
};
api.defaults={};
api.remove=function (key, attributes){
api(key, '', extend(attributes, {
expires: -1
}));
};
api.withConverter=init;
return api;
}
return init(function (){});
}));
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof exports?b(a,require("jquery")):b(a,a.jQuery||a.Zepto)}(this,function(a,b){"use strict";function c(a){if(w&&"none"===a.css("animation-name")&&"none"===a.css("-webkit-animation-name")&&"none"===a.css("-moz-animation-name")&&"none"===a.css("-o-animation-name")&&"none"===a.css("-ms-animation-name"))return 0;var b,c,d,e,f=a.css("animation-duration")||a.css("-webkit-animation-duration")||a.css("-moz-animation-duration")||a.css("-o-animation-duration")||a.css("-ms-animation-duration")||"0s",g=a.css("animation-delay")||a.css("-webkit-animation-delay")||a.css("-moz-animation-delay")||a.css("-o-animation-delay")||a.css("-ms-animation-delay")||"0s",h=a.css("animation-iteration-count")||a.css("-webkit-animation-iteration-count")||a.css("-moz-animation-iteration-count")||a.css("-o-animation-iteration-count")||a.css("-ms-animation-iteration-count")||"1";for(f=f.split(", "),g=g.split(", "),h=h.split(", "),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;e<c;e++)d=parseFloat(f[e])*parseInt(h[e],10)+parseFloat(g[e]),d>b&&(b=d);return b}function d(){if(b(document).height()<=b(window).height())return 0;var a,c,d=document.createElement("div"),e=document.createElement("div");return d.style.visibility="hidden",d.style.width="100px",document.body.appendChild(d),a=d.offsetWidth,d.style.overflow="scroll",e.style.width="100%",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),a-c}function e(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)||(c=b(document.body),a=parseInt(c.css("padding-right"),10)+d(),c.css("padding-right",a+"px"),e.addClass(f))}}function f(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)&&(c=b(document.body),a=parseInt(c.css("padding-right"),10)-d(),c.css("padding-right",a+"px"),e.removeClass(f))}}function g(a,b,c,d){var e=k("is",b),f=[k("is",u.CLOSING),k("is",u.OPENING),k("is",u.CLOSED),k("is",u.OPENED)].join(" ");a.$bg.removeClass(f).addClass(e),a.$overlay.removeClass(f).addClass(e),a.$wrapper.removeClass(f).addClass(e),a.$modal.removeClass(f).addClass(e),a.state=b,!c&&a.$modal.trigger({type:b,reason:d},[{reason:d}])}function h(a,d,e){var f=0,g=function(a){a.target===this&&f++},h=function(a){a.target===this&&0===--f&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())};b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].on(r,g).on(s,h)}),a(),0===c(e.$bg)&&0===c(e.$overlay)&&0===c(e.$wrapper)&&0===c(e.$modal)&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())}function i(a){a.state!==u.CLOSED&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(b,c){a[c].off(r+" "+s)}),a.$bg.removeClass(a.settings.modifier),a.$overlay.removeClass(a.settings.modifier).hide(),a.$wrapper.hide(),f(),g(a,u.CLOSED,!0))}function j(a){var b,c,d,e,f={};for(a=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),b=a.split(","),e=0,c=b.length;e<c;e++)b[e]=b[e].split(":"),d=b[e][1],("string"==typeof d||d instanceof String)&&(d="true"===d||"false"!==d&&d),("string"==typeof d||d instanceof String)&&(d=isNaN(d)?d:+d),f[b[e][0]]=d;return f}function k(){for(var a=q,b=0;b<arguments.length;++b)a+="-"+arguments[b];return a}function l(){var a,c,d=location.hash.replace("#","");if(d){try{c=b('[data-remodal-id="'+d+'"]')}catch(e){}c&&c.length&&(a=b[p].lookup[c.data(p)],a&&a.settings.hashTracking&&a.open())}else n&&n.state===u.OPENED&&n.settings.hashTracking&&n.close()}function m(a,c){var d=b(document.body),e=d,f=this;f.settings=b.extend({},t,c),f.index=b[p].lookup.push(f)-1,f.state=u.CLOSED,f.$overlay=b("."+k("overlay")),null!==f.settings.appendTo&&f.settings.appendTo.length&&(e=b(f.settings.appendTo)),f.$overlay.length||(f.$overlay=b("<div>").addClass(k("overlay")+" "+k("is",u.CLOSED)).hide(),e.append(f.$overlay)),f.$bg=b("."+k("bg")).addClass(k("is",u.CLOSED)),f.$modal=a.addClass(q+" "+k("is-initialized")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).attr("tabindex","-1"),f.$wrapper=b("<div>").addClass(k("wrapper")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).hide().append(f.$modal),e.append(f.$wrapper),f.$wrapper.on("click."+q,'[data-remodal-action="close"]',function(a){a.preventDefault(),f.close()}),f.$wrapper.on("click."+q,'[data-remodal-action="cancel"]',function(a){a.preventDefault(),f.$modal.trigger(v.CANCELLATION),f.settings.closeOnCancel&&f.close(v.CANCELLATION)}),f.$wrapper.on("click."+q,'[data-remodal-action="confirm"]',function(a){a.preventDefault(),f.$modal.trigger(v.CONFIRMATION),f.settings.closeOnConfirm&&f.close(v.CONFIRMATION)}),f.$wrapper.on("click."+q,function(a){var c=b(a.target);c.hasClass(k("wrapper"))&&f.settings.closeOnOutsideClick&&f.close()})}var n,o,p="remodal",q=a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.NAMESPACE||p,r=b.map(["animationstart","webkitAnimationStart","MSAnimationStart","oAnimationStart"],function(a){return a+"."+q}).join(" "),s=b.map(["animationend","webkitAnimationEnd","MSAnimationEnd","oAnimationEnd"],function(a){return a+"."+q}).join(" "),t=b.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnOutsideClick:!0,modifier:"",appendTo:null},a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.DEFAULTS),u={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened"},v={CONFIRMATION:"confirmation",CANCELLATION:"cancellation"},w=function(){var a=document.createElement("div").style;return void 0!==a.animationName||void 0!==a.WebkitAnimationName||void 0!==a.MozAnimationName||void 0!==a.msAnimationName||void 0!==a.OAnimationName}(),x=/iPad|iPhone|iPod/.test(navigator.platform);m.prototype.open=function(){var a,c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&(a=c.$modal.attr("data-remodal-id"),a&&c.settings.hashTracking&&(o=b(window).scrollTop(),location.hash=a),n&&n!==c&&i(n),n=c,e(),c.$bg.addClass(c.settings.modifier),c.$overlay.addClass(c.settings.modifier).show(),c.$wrapper.show().scrollTop(0),c.$modal.focus(),h(function(){g(c,u.OPENING)},function(){g(c,u.OPENED)},c))},m.prototype.close=function(a){var c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&c.state!==u.CLOSED&&(c.settings.hashTracking&&c.$modal.attr("data-remodal-id")===location.hash.substr(1)&&(location.hash="",b(window).scrollTop(o)),h(function(){g(c,u.CLOSING,!1,a)},function(){c.$bg.removeClass(c.settings.modifier),c.$overlay.removeClass(c.settings.modifier).hide(),c.$wrapper.hide(),f(),g(c,u.CLOSED,!1,a)},c))},m.prototype.getState=function(){return this.state},m.prototype.destroy=function(){var a,c=b[p].lookup;i(this),this.$wrapper.remove(),delete c[this.index],a=b.grep(c,function(a){return!!a}).length,0===a&&(this.$overlay.remove(),this.$bg.removeClass(k("is",u.CLOSING)+" "+k("is",u.OPENING)+" "+k("is",u.CLOSED)+" "+k("is",u.OPENED)))},b[p]={lookup:[]},b.fn[p]=function(a){var c,d;return this.each(function(e,f){d=b(f),null==d.data(p)?(c=new m(d,a),d.data(p,c.index),c.settings.hashTracking&&d.attr("data-remodal-id")===location.hash.substr(1)&&c.open()):c=b[p].lookup[d.data(p)]}),c},b(document).ready(function(){b(document).on("click","[data-remodal-target]",function(a){a.preventDefault();var c=a.currentTarget,d=c.getAttribute("data-remodal-target"),e=b('[data-remodal-id="'+d+'"]');b[p].lookup[e.data(p)].open()}),b(document).find("."+q).each(function(a,c){var d=b(c),e=d.data("remodal-options");e?("string"==typeof e||e instanceof String)&&(e=j(e)):e={},d[p](e)}),b(document).on("keydown."+q,function(a){n&&n.settings.closeOnEscape&&n.state===u.OPENED&&27===a.keyCode&&n.close()}),b(window).on("hashchange."+q,l)})});
(function (global, factory){
typeof exports==='object'&&typeof module!=='undefined' ? module.exports=factory() :
typeof define==='function'&&define.amd ? define(factory) :
(global.PointerEventsPolyfill=factory());
}(this, function (){ 'use strict';
var MOUSE_PROPS=[
'bubbles',
'cancelable',
'view',
'detail',
'screenX',
'screenY',
'clientX',
'clientY',
'ctrlKey',
'altKey',
'shiftKey',
'metaKey',
'button',
'relatedTarget',
'pageX',
'pageY'
];
var MOUSE_DEFAULTS=[
false,
false,
null,
null,
0,
0,
0,
0,
false,
false,
false,
false,
0,
null,
0,
0
];
function PointerEvent(inType, inDict){
inDict=inDict||Object.create(null);
var e=document.createEvent('Event');
e.initEvent(inType, inDict.bubbles||false, inDict.cancelable||false);
for (var i=2, p; i < MOUSE_PROPS.length; i++){
p=MOUSE_PROPS[i];
e[p]=inDict[p]||MOUSE_DEFAULTS[i];
}
e.buttons=inDict.buttons||0;
var pressure=0;
if(inDict.pressure&&e.buttons){
pressure=inDict.pressure;
}else{
pressure=e.buttons ? 0.5:0;
}
e.x=e.clientX;
e.y=e.clientY;
e.pointerId=inDict.pointerId||0;
e.width=inDict.width||0;
e.height=inDict.height||0;
e.pressure=pressure;
e.tiltX=inDict.tiltX||0;
e.tiltY=inDict.tiltY||0;
e.twist=inDict.twist||0;
e.tangentialPressure=inDict.tangentialPressure||0;
e.pointerType=inDict.pointerType||'';
e.hwTimestamp=inDict.hwTimestamp||0;
e.isPrimary=inDict.isPrimary||false;
return e;
}
var USE_MAP=window.Map&&window.Map.prototype.forEach;
var PointerMap=USE_MAP ? Map:SparseArrayMap;
function SparseArrayMap(){
this.array=[];
this.size=0;
}
SparseArrayMap.prototype={
set: function(k, v){
if(v===undefined){
return this.delete(k);
}
if(!this.has(k)){
this.size++;
}
this.array[k]=v;
},
has: function(k){
return this.array[k]!==undefined;
},
delete: function(k){
if(this.has(k)){
delete this.array[k];
this.size--;
}},
get: function(k){
return this.array[k];
},
clear: function(){
this.array.length=0;
this.size=0;
},
forEach: function(callback, thisArg){
return this.array.forEach(function(v, k){
callback.call(thisArg, v, k, this);
}, this);
}};
var CLONE_PROPS=[
'bubbles',
'cancelable',
'view',
'detail',
'screenX',
'screenY',
'clientX',
'clientY',
'ctrlKey',
'altKey',
'shiftKey',
'metaKey',
'button',
'relatedTarget',
'buttons',
'pointerId',
'width',
'height',
'pressure',
'tiltX',
'tiltY',
'pointerType',
'hwTimestamp',
'isPrimary',
'type',
'target',
'currentTarget',
'which',
'pageX',
'pageY',
'timeStamp'
];
var CLONE_DEFAULTS=[
false,
false,
null,
null,
0,
0,
0,
0,
false,
false,
false,
false,
0,
null,
0,
0,
0,
0,
0,
0,
0,
'',
0,
false,
'',
null,
null,
0,
0,
0,
0
];
var BOUNDARY_EVENTS={
'pointerover': 1,
'pointerout': 1,
'pointerenter': 1,
'pointerleave': 1
};
var HAS_SVG_INSTANCE=(typeof SVGElementInstance!=='undefined');
var dispatcher={
pointermap: new PointerMap(),
eventMap: Object.create(null),
captureInfo: Object.create(null),
eventSources: Object.create(null),
eventSourceList: [],
registerSource: function(name, source){
var s=source;
var newEvents=s.events;
if(newEvents){
newEvents.forEach(function(e){
if(s[e]){
this.eventMap[e]=s[e].bind(s);
}}, this);
this.eventSources[name]=s;
this.eventSourceList.push(s);
}},
register: function(element){
var l=this.eventSourceList.length;
for (var i=0, es; (i < l)&&(es=this.eventSourceList[i]); i++){
es.register.call(es, element);
}},
unregister: function(element){
var l=this.eventSourceList.length;
for (var i=0, es; (i < l)&&(es=this.eventSourceList[i]); i++){
es.unregister.call(es, element);
}},
contains: function(container, contained){
try {
return container.contains(contained);
} catch (ex){
return false;
}},
down: function(inEvent){
inEvent.bubbles=true;
this.fireEvent('pointerdown', inEvent);
},
move: function(inEvent){
inEvent.bubbles=true;
this.fireEvent('pointermove', inEvent);
},
up: function(inEvent){
inEvent.bubbles=true;
this.fireEvent('pointerup', inEvent);
},
enter: function(inEvent){
inEvent.bubbles=false;
this.fireEvent('pointerenter', inEvent);
},
leave: function(inEvent){
inEvent.bubbles=false;
this.fireEvent('pointerleave', inEvent);
},
over: function(inEvent){
inEvent.bubbles=true;
this.fireEvent('pointerover', inEvent);
},
out: function(inEvent){
inEvent.bubbles=true;
this.fireEvent('pointerout', inEvent);
},
cancel: function(inEvent){
inEvent.bubbles=true;
this.fireEvent('pointercancel', inEvent);
},
leaveOut: function(event){
this.out(event);
this.propagate(event, this.leave, false);
},
enterOver: function(event){
this.over(event);
this.propagate(event, this.enter, true);
},
eventHandler: function(inEvent){
if(inEvent._handledByPE){
return;
}
var type=inEvent.type;
var fn=this.eventMap&&this.eventMap[type];
if(fn){
fn(inEvent);
}
inEvent._handledByPE=true;
},
listen: function(target, events){
events.forEach(function(e){
this.addEvent(target, e);
}, this);
},
unlisten: function(target, events){
events.forEach(function(e){
this.removeEvent(target, e);
}, this);
},
addEvent: function(target, eventName){
target.addEventListener(eventName, this.boundHandler);
},
removeEvent: function(target, eventName){
target.removeEventListener(eventName, this.boundHandler);
},
makeEvent: function(inType, inEvent){
if(this.captureInfo[inEvent.pointerId]){
inEvent.relatedTarget=null;
}
var e=new PointerEvent(inType, inEvent);
if(inEvent.preventDefault){
e.preventDefault=inEvent.preventDefault;
}
e._target=e._target||inEvent.target;
return e;
},
fireEvent: function(inType, inEvent){
var e=this.makeEvent(inType, inEvent);
return this.dispatchEvent(e);
},
cloneEvent: function(inEvent){
var eventCopy=Object.create(null);
var p;
for (var i=0; i < CLONE_PROPS.length; i++){
p=CLONE_PROPS[i];
eventCopy[p]=inEvent[p]||CLONE_DEFAULTS[i];
if(HAS_SVG_INSTANCE&&(p==='target'||p==='relatedTarget')){
if(eventCopy[p] instanceof SVGElementInstance){
eventCopy[p]=eventCopy[p].correspondingUseElement;
}}
}
if(inEvent.preventDefault){
eventCopy.preventDefault=function(){
inEvent.preventDefault();
};}
return eventCopy;
},
getTarget: function(inEvent){
var capture=this.captureInfo[inEvent.pointerId];
if(!capture){
return inEvent._target;
}
if(inEvent._target===capture||!(inEvent.type in BOUNDARY_EVENTS)){
return capture;
}},
propagate: function(event, fn, propagateDown){
var target=event.target;
var targets=[];
while (target!==document&&!target.contains(event.relatedTarget)){
targets.push(target);
target=target.parentNode;
if(!target){
return;
}}
if(propagateDown){
targets.reverse();
}
targets.forEach(function(target){
event.target=target;
fn.call(this, event);
}, this);
},
setCapture: function(inPointerId, inTarget, skipDispatch){
if(this.captureInfo[inPointerId]){
this.releaseCapture(inPointerId, skipDispatch);
}
this.captureInfo[inPointerId]=inTarget;
this.implicitRelease=this.releaseCapture.bind(this, inPointerId, skipDispatch);
document.addEventListener('pointerup', this.implicitRelease);
document.addEventListener('pointercancel', this.implicitRelease);
var e=new PointerEvent('gotpointercapture');
e.pointerId=inPointerId;
e._target=inTarget;
if(!skipDispatch){
this.asyncDispatchEvent(e);
}},
releaseCapture: function(inPointerId, skipDispatch){
var t=this.captureInfo[inPointerId];
if(!t){
return;
}
this.captureInfo[inPointerId]=undefined;
document.removeEventListener('pointerup', this.implicitRelease);
document.removeEventListener('pointercancel', this.implicitRelease);
var e=new PointerEvent('lostpointercapture');
e.pointerId=inPointerId;
e._target=t;
if(!skipDispatch){
this.asyncDispatchEvent(e);
}},
dispatchEvent: function(inEvent){
var t=this.getTarget(inEvent);
if(t){
return t.dispatchEvent(inEvent);
}},
asyncDispatchEvent: function(inEvent){
requestAnimationFrame(this.dispatchEvent.bind(this, inEvent));
}};
dispatcher.boundHandler=dispatcher.eventHandler.bind(dispatcher);
var targeting={
shadow: function(inEl){
if(inEl){
return inEl.shadowRoot||inEl.webkitShadowRoot;
}},
canTarget: function(shadow){
return shadow&&Boolean(shadow.elementFromPoint);
},
targetingShadow: function(inEl){
var s=this.shadow(inEl);
if(this.canTarget(s)){
return s;
}},
olderShadow: function(shadow){
var os=shadow.olderShadowRoot;
if(!os){
var se=shadow.querySelector('shadow');
if(se){
os=se.olderShadowRoot;
}}
return os;
},
allShadows: function(element){
var shadows=[];
var s=this.shadow(element);
while (s){
shadows.push(s);
s=this.olderShadow(s);
}
return shadows;
},
searchRoot: function(inRoot, x, y){
if(inRoot){
var t=inRoot.elementFromPoint(x, y);
var st, sr;
sr=this.targetingShadow(t);
while (sr){
st=sr.elementFromPoint(x, y);
if(!st){
sr=this.olderShadow(sr);
}else{
var ssr=this.targetingShadow(st);
return this.searchRoot(ssr, x, y)||st;
}}
return t;
}},
owner: function(element){
var s=element;
while (s.parentNode){
s=s.parentNode;
}
if(s.nodeType!==Node.DOCUMENT_NODE&&s.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){
s=document;
}
return s;
},
findTarget: function(inEvent){
var x=inEvent.clientX;
var y=inEvent.clientY;
var s=this.owner(inEvent.target);
if(!s.elementFromPoint(x, y)){
s=document;
}
return this.searchRoot(s, x, y);
}};
var forEach=Array.prototype.forEach.call.bind(Array.prototype.forEach);
var map=Array.prototype.map.call.bind(Array.prototype.map);
var toArray=Array.prototype.slice.call.bind(Array.prototype.slice);
var filter=Array.prototype.filter.call.bind(Array.prototype.filter);
var MO=window.MutationObserver||window.WebKitMutationObserver;
var SELECTOR='[touch-action]';
var OBSERVER_INIT={
subtree: true,
childList: true,
attributes: true,
attributeOldValue: true,
attributeFilter: ['touch-action']
};
function Installer(add, remove, changed, binder){
this.addCallback=add.bind(binder);
this.removeCallback=remove.bind(binder);
this.changedCallback=changed.bind(binder);
if(MO){
this.observer=new MO(this.mutationWatcher.bind(this));
}}
Installer.prototype={
watchSubtree: function(target){
if(this.observer&&targeting.canTarget(target)){
this.observer.observe(target, OBSERVER_INIT);
}},
enableOnSubtree: function(target){
this.watchSubtree(target);
if(target===document&&document.readyState!=='complete'){
this.installOnLoad();
}else{
this.installNewSubtree(target);
}},
installNewSubtree: function(target){
forEach(this.findElements(target), this.addElement, this);
},
findElements: function(target){
if(target.querySelectorAll){
return target.querySelectorAll(SELECTOR);
}
return [];
},
removeElement: function(el){
this.removeCallback(el);
},
addElement: function(el){
this.addCallback(el);
},
elementChanged: function(el, oldValue){
this.changedCallback(el, oldValue);
},
concatLists: function(accum, list){
return accum.concat(toArray(list));
},
installOnLoad: function(){
document.addEventListener('readystatechange', function(){
if(document.readyState==='complete'){
this.installNewSubtree(document);
}}.bind(this));
},
isElement: function(n){
return n.nodeType===Node.ELEMENT_NODE;
},
flattenMutationTree: function(inNodes){
var tree=map(inNodes, this.findElements, this);
tree.push(filter(inNodes, this.isElement));
return tree.reduce(this.concatLists, []);
},
mutationWatcher: function(mutations){
mutations.forEach(this.mutationHandler, this);
},
mutationHandler: function(m){
if(m.type==='childList'){
var added=this.flattenMutationTree(m.addedNodes);
added.forEach(this.addElement, this);
var removed=this.flattenMutationTree(m.removedNodes);
removed.forEach(this.removeElement, this);
}else if(m.type==='attributes'){
this.elementChanged(m.target, m.oldValue);
}}
};
function shadowSelector(v){
return 'body /shadow-deep/ ' + selector(v);
}
function selector(v){
return '[touch-action="' + v + '"]';
}
function rule(v){
return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; }';
}
var attrib2css=[
'none',
'auto',
'pan-x',
'pan-y',
{
rule: 'pan-x pan-y',
selectors: [
'pan-x pan-y',
'pan-y pan-x'
]
}
];
var styles='';
var hasNativePE=window.PointerEvent||window.MSPointerEvent;
var hasShadowRoot = !window.ShadowDOMPolyfill&&document.head.createShadowRoot;
function applyAttributeStyles(){
if(hasNativePE){
attrib2css.forEach(function(r){
if(String(r)===r){
styles +=selector(r) + rule(r) + '\n';
if(hasShadowRoot){
styles +=shadowSelector(r) + rule(r) + '\n';
}}else{
styles +=r.selectors.map(selector) + rule(r.rule) + '\n';
if(hasShadowRoot){
styles +=r.selectors.map(shadowSelector) + rule(r.rule) + '\n';
}}
});
var el=document.createElement('style');
el.textContent=styles;
document.head.appendChild(el);
}}
var pointermap=dispatcher.pointermap;
var DEDUP_DIST=25;
var BUTTON_TO_BUTTONS=[1, 4, 2, 8, 16];
var HAS_BUTTONS=false;
try {
HAS_BUTTONS=new MouseEvent('test', { buttons: 1 }).buttons===1;
} catch (e){}
var mouseEvents={
POINTER_ID: 1,
POINTER_TYPE: 'mouse',
events: [
'mousedown',
'mousemove',
'mouseup',
'mouseover',
'mouseout'
],
register: function(target){
dispatcher.listen(target, this.events);
},
unregister: function(target){
dispatcher.unlisten(target, this.events);
},
lastTouches: [],
isEventSimulatedFromTouch: function(inEvent){
var lts=this.lastTouches;
var x=inEvent.clientX;
var y=inEvent.clientY;
for (var i=0, l=lts.length, t; i < l&&(t=lts[i]); i++){
var dx=Math.abs(x - t.x);
var dy=Math.abs(y - t.y);
if(dx <=DEDUP_DIST&&dy <=DEDUP_DIST){
return true;
}}
},
prepareEvent: function(inEvent){
var e=dispatcher.cloneEvent(inEvent);
var pd=e.preventDefault;
e.preventDefault=function(){
inEvent.preventDefault();
pd();
};
e.pointerId=this.POINTER_ID;
e.isPrimary=true;
e.pointerType=this.POINTER_TYPE;
return e;
},
prepareButtonsForMove: function(e, inEvent){
var p=pointermap.get(this.POINTER_ID);
if(inEvent.which===0||!p){
e.buttons=0;
}else{
e.buttons=p.buttons;
}
inEvent.buttons=e.buttons;
},
mousedown: function(inEvent){
if(!this.isEventSimulatedFromTouch(inEvent)){
var p=pointermap.get(this.POINTER_ID);
var e=this.prepareEvent(inEvent);
if(!HAS_BUTTONS){
e.buttons=BUTTON_TO_BUTTONS[e.button];
if(p){ e.buttons |=p.buttons; }
inEvent.buttons=e.buttons;
}
pointermap.set(this.POINTER_ID, inEvent);
if(!p||p.buttons===0){
dispatcher.down(e);
}else{
dispatcher.move(e);
}}
},
mousemove: function(inEvent){
if(!this.isEventSimulatedFromTouch(inEvent)){
var e=this.prepareEvent(inEvent);
if(!HAS_BUTTONS){ this.prepareButtonsForMove(e, inEvent); }
e.button=-1;
pointermap.set(this.POINTER_ID, inEvent);
dispatcher.move(e);
}},
mouseup: function(inEvent){
if(!this.isEventSimulatedFromTouch(inEvent)){
var p=pointermap.get(this.POINTER_ID);
var e=this.prepareEvent(inEvent);
if(!HAS_BUTTONS){
var up=BUTTON_TO_BUTTONS[e.button];
e.buttons=p ? p.buttons & ~up:0;
inEvent.buttons=e.buttons;
}
pointermap.set(this.POINTER_ID, inEvent);
e.buttons &=~BUTTON_TO_BUTTONS[e.button];
if(e.buttons===0){
dispatcher.up(e);
}else{
dispatcher.move(e);
}}
},
mouseover: function(inEvent){
if(!this.isEventSimulatedFromTouch(inEvent)){
var e=this.prepareEvent(inEvent);
if(!HAS_BUTTONS){ this.prepareButtonsForMove(e, inEvent); }
e.button=-1;
pointermap.set(this.POINTER_ID, inEvent);
dispatcher.enterOver(e);
}},
mouseout: function(inEvent){
if(!this.isEventSimulatedFromTouch(inEvent)){
var e=this.prepareEvent(inEvent);
if(!HAS_BUTTONS){ this.prepareButtonsForMove(e, inEvent); }
e.button=-1;
dispatcher.leaveOut(e);
}},
cancel: function(inEvent){
var e=this.prepareEvent(inEvent);
dispatcher.cancel(e);
this.deactivateMouse();
},
deactivateMouse: function(){
pointermap.delete(this.POINTER_ID);
}};
var captureInfo=dispatcher.captureInfo;
var findTarget=targeting.findTarget.bind(targeting);
var allShadows=targeting.allShadows.bind(targeting);
var pointermap$1=dispatcher.pointermap;
var DEDUP_TIMEOUT=2500;
var CLICK_COUNT_TIMEOUT=200;
var ATTRIB='touch-action';
var INSTALLER;
var touchEvents={
events: [
'touchstart',
'touchmove',
'touchend',
'touchcancel'
],
register: function(target){
INSTALLER.enableOnSubtree(target);
},
unregister: function(){
},
elementAdded: function(el){
var a=el.getAttribute(ATTRIB);
var st=this.touchActionToScrollType(a);
if(st){
el._scrollType=st;
dispatcher.listen(el, this.events);
allShadows(el).forEach(function(s){
s._scrollType=st;
dispatcher.listen(s, this.events);
}, this);
}},
elementRemoved: function(el){
el._scrollType=undefined;
dispatcher.unlisten(el, this.events);
allShadows(el).forEach(function(s){
s._scrollType=undefined;
dispatcher.unlisten(s, this.events);
}, this);
},
elementChanged: function(el, oldValue){
var a=el.getAttribute(ATTRIB);
var st=this.touchActionToScrollType(a);
var oldSt=this.touchActionToScrollType(oldValue);
if(st&&oldSt){
el._scrollType=st;
allShadows(el).forEach(function(s){
s._scrollType=st;
}, this);
}else if(oldSt){
this.elementRemoved(el);
}else if(st){
this.elementAdded(el);
}},
scrollTypes: {
EMITTER: 'none',
XSCROLLER: 'pan-x',
YSCROLLER: 'pan-y',
SCROLLER: /^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/
},
touchActionToScrollType: function(touchAction){
var t=touchAction;
var st=this.scrollTypes;
if(t==='none'){
return 'none';
}else if(t===st.XSCROLLER){
return 'X';
}else if(t===st.YSCROLLER){
return 'Y';
}else if(st.SCROLLER.exec(t)){
return 'XY';
}},
POINTER_TYPE: 'touch',
firstTouch: null,
isPrimaryTouch: function(inTouch){
return this.firstTouch===inTouch.identifier;
},
setPrimaryTouch: function(inTouch){
if(pointermap$1.size===0||(pointermap$1.size===1&&pointermap$1.has(1))){
this.firstTouch=inTouch.identifier;
this.firstXY={ X: inTouch.clientX, Y: inTouch.clientY };
this.scrolling=false;
this.cancelResetClickCount();
}},
removePrimaryPointer: function(inPointer){
if(inPointer.isPrimary){
this.firstTouch=null;
this.firstXY=null;
this.resetClickCount();
}},
clickCount: 0,
resetId: null,
resetClickCount: function(){
var fn=function(){
this.clickCount=0;
this.resetId=null;
}.bind(this);
this.resetId=setTimeout(fn, CLICK_COUNT_TIMEOUT);
},
cancelResetClickCount: function(){
if(this.resetId){
clearTimeout(this.resetId);
}},
typeToButtons: function(type){
var ret=0;
if(type==='touchstart'||type==='touchmove'){
ret=1;
}
return ret;
},
touchToPointer: function(inTouch){
var cte=this.currentTouchEvent;
var e=dispatcher.cloneEvent(inTouch);
var id=e.pointerId=inTouch.identifier + 2;
e.target=captureInfo[id]||findTarget(e);
e.bubbles=true;
e.cancelable=true;
e.detail=this.clickCount;
e.button=0;
e.buttons=this.typeToButtons(cte.type);
e.width=(inTouch.radiusX||inTouch.webkitRadiusX||0) * 2;
e.height=(inTouch.radiusY||inTouch.webkitRadiusY||0) * 2;
e.pressure=inTouch.force||inTouch.webkitForce||0.5;
e.isPrimary=this.isPrimaryTouch(inTouch);
e.pointerType=this.POINTER_TYPE;
e.altKey=cte.altKey;
e.ctrlKey=cte.ctrlKey;
e.metaKey=cte.metaKey;
e.shiftKey=cte.shiftKey;
var self=this;
e.preventDefault=function(){
self.scrolling=false;
self.firstXY=null;
cte.preventDefault();
};
return e;
},
processTouches: function(inEvent, inFunction){
var tl=inEvent.changedTouches;
this.currentTouchEvent=inEvent;
for (var i=0, t; i < tl.length; i++){
t=tl[i];
inFunction.call(this, this.touchToPointer(t));
}},
shouldScroll: function(inEvent){
if(this.firstXY){
var ret;
var scrollAxis=inEvent.currentTarget._scrollType;
if(scrollAxis==='none'){
ret=false;
}else if(scrollAxis==='XY'){
ret=true;
}else{
var t=inEvent.changedTouches[0];
var a=scrollAxis;
var oa=scrollAxis==='Y' ? 'X':'Y';
var da=Math.abs(t['client' + a] - this.firstXY[a]);
var doa=Math.abs(t['client' + oa] - this.firstXY[oa]);
ret=da >=doa;
}
this.firstXY=null;
return ret;
}},
findTouch: function(inTL, inId){
for (var i=0, l=inTL.length, t; i < l&&(t=inTL[i]); i++){
if(t.identifier===inId){
return true;
}}
},
vacuumTouches: function(inEvent){
var tl=inEvent.touches;
if(pointermap$1.size >=tl.length){
var d=[];
pointermap$1.forEach(function(value, key){
if(key!==1&&!this.findTouch(tl, key - 2)){
var p=value.out;
d.push(p);
}}, this);
d.forEach(this.cancelOut, this);
}},
touchstart: function(inEvent){
this.vacuumTouches(inEvent);
this.setPrimaryTouch(inEvent.changedTouches[0]);
this.dedupSynthMouse(inEvent);
if(!this.scrolling){
this.clickCount++;
this.processTouches(inEvent, this.overDown);
}},
overDown: function(inPointer){
pointermap$1.set(inPointer.pointerId, {
target: inPointer.target,
out: inPointer,
outTarget: inPointer.target
});
dispatcher.enterOver(inPointer);
dispatcher.down(inPointer);
},
touchmove: function(inEvent){
if(!this.scrolling){
if(this.shouldScroll(inEvent)){
this.scrolling=true;
this.touchcancel(inEvent);
}else{
inEvent.preventDefault();
this.processTouches(inEvent, this.moveOverOut);
}}
},
moveOverOut: function(inPointer){
var event=inPointer;
var pointer=pointermap$1.get(event.pointerId);
if(!pointer){
return;
}
var outEvent=pointer.out;
var outTarget=pointer.outTarget;
dispatcher.move(event);
if(outEvent&&outTarget!==event.target){
outEvent.relatedTarget=event.target;
event.relatedTarget=outTarget;
outEvent.target=outTarget;
if(event.target){
dispatcher.leaveOut(outEvent);
dispatcher.enterOver(event);
}else{
event.target=outTarget;
event.relatedTarget=null;
this.cancelOut(event);
}}
pointer.out=event;
pointer.outTarget=event.target;
},
touchend: function(inEvent){
this.dedupSynthMouse(inEvent);
this.processTouches(inEvent, this.upOut);
},
upOut: function(inPointer){
if(!this.scrolling){
dispatcher.up(inPointer);
dispatcher.leaveOut(inPointer);
}
this.cleanUpPointer(inPointer);
},
touchcancel: function(inEvent){
this.processTouches(inEvent, this.cancelOut);
},
cancelOut: function(inPointer){
dispatcher.cancel(inPointer);
dispatcher.leaveOut(inPointer);
this.cleanUpPointer(inPointer);
},
cleanUpPointer: function(inPointer){
pointermap$1.delete(inPointer.pointerId);
this.removePrimaryPointer(inPointer);
},
dedupSynthMouse: function(inEvent){
var lts=mouseEvents.lastTouches;
var t=inEvent.changedTouches[0];
if(this.isPrimaryTouch(t)){
var lt={ x: t.clientX, y: t.clientY };
lts.push(lt);
var fn=(function(lts, lt){
var i=lts.indexOf(lt);
if(i > -1){
lts.splice(i, 1);
}}).bind(null, lts, lt);
setTimeout(fn, DEDUP_TIMEOUT);
}}
};
INSTALLER=new Installer(touchEvents.elementAdded, touchEvents.elementRemoved,
touchEvents.elementChanged, touchEvents);
var pointermap$2=dispatcher.pointermap;
var HAS_BITMAP_TYPE=window.MSPointerEvent &&
typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE==='number';
var msEvents={
events: [
'MSPointerDown',
'MSPointerMove',
'MSPointerUp',
'MSPointerOut',
'MSPointerOver',
'MSPointerCancel',
'MSGotPointerCapture',
'MSLostPointerCapture'
],
register: function(target){
dispatcher.listen(target, this.events);
},
unregister: function(target){
dispatcher.unlisten(target, this.events);
},
POINTER_TYPES: [
'',
'unavailable',
'touch',
'pen',
'mouse'
],
prepareEvent: function(inEvent){
var e=inEvent;
if(HAS_BITMAP_TYPE){
e=dispatcher.cloneEvent(inEvent);
e.pointerType=this.POINTER_TYPES[inEvent.pointerType];
}
return e;
},
cleanup: function(id){
pointermap$2.delete(id);
},
MSPointerDown: function(inEvent){
pointermap$2.set(inEvent.pointerId, inEvent);
var e=this.prepareEvent(inEvent);
dispatcher.down(e);
},
MSPointerMove: function(inEvent){
var e=this.prepareEvent(inEvent);
dispatcher.move(e);
},
MSPointerUp: function(inEvent){
var e=this.prepareEvent(inEvent);
dispatcher.up(e);
this.cleanup(inEvent.pointerId);
},
MSPointerOut: function(inEvent){
var e=this.prepareEvent(inEvent);
dispatcher.leaveOut(e);
},
MSPointerOver: function(inEvent){
var e=this.prepareEvent(inEvent);
dispatcher.enterOver(e);
},
MSPointerCancel: function(inEvent){
var e=this.prepareEvent(inEvent);
dispatcher.cancel(e);
this.cleanup(inEvent.pointerId);
},
MSLostPointerCapture: function(inEvent){
var e=dispatcher.makeEvent('lostpointercapture', inEvent);
dispatcher.dispatchEvent(e);
},
MSGotPointerCapture: function(inEvent){
var e=dispatcher.makeEvent('gotpointercapture', inEvent);
dispatcher.dispatchEvent(e);
}};
function applyPolyfill(){
if(!window.PointerEvent){
window.PointerEvent=PointerEvent;
if(window.navigator.msPointerEnabled){
var tp=window.navigator.msMaxTouchPoints;
Object.defineProperty(window.navigator, 'maxTouchPoints', {
value: tp,
enumerable: true
});
dispatcher.registerSource('ms', msEvents);
}else{
Object.defineProperty(window.navigator, 'maxTouchPoints', {
value: 0,
enumerable: true
});
dispatcher.registerSource('mouse', mouseEvents);
if(window.ontouchstart!==undefined){
dispatcher.registerSource('touch', touchEvents);
}}
dispatcher.register(document);
}}
var n=window.navigator;
var s;
var r;
var h;
function assertActive(id){
if(!dispatcher.pointermap.has(id)){
var error=new Error('InvalidPointerId');
error.name='InvalidPointerId';
throw error;
}}
function assertConnected(elem){
var parent=elem.parentNode;
while (parent&&parent!==elem.ownerDocument){
parent=parent.parentNode;
}
if(!parent){
var error=new Error('InvalidStateError');
error.name='InvalidStateError';
throw error;
}}
function inActiveButtonState(id){
var p=dispatcher.pointermap.get(id);
return p.buttons!==0;
}
if(n.msPointerEnabled){
s=function(pointerId){
assertActive(pointerId);
assertConnected(this);
if(inActiveButtonState(pointerId)){
dispatcher.setCapture(pointerId, this, true);
this.msSetPointerCapture(pointerId);
}};
r=function(pointerId){
assertActive(pointerId);
dispatcher.releaseCapture(pointerId, true);
this.msReleasePointerCapture(pointerId);
};}else{
s=function setPointerCapture(pointerId){
assertActive(pointerId);
assertConnected(this);
if(inActiveButtonState(pointerId)){
dispatcher.setCapture(pointerId, this);
}};
r=function releasePointerCapture(pointerId){
assertActive(pointerId);
dispatcher.releaseCapture(pointerId);
};}
h=function hasPointerCapture(pointerId){
return !!dispatcher.captureInfo[pointerId];
};
function applyPolyfill$1(){
if(window.Element&&!Element.prototype.setPointerCapture){
Object.defineProperties(Element.prototype, {
'setPointerCapture': {
value: s
},
'releasePointerCapture': {
value: r
},
'hasPointerCapture': {
value: h
}});
}}
applyAttributeStyles();
applyPolyfill();
applyPolyfill$1();
var pointerevents={
dispatcher: dispatcher,
Installer: Installer,
PointerEvent: PointerEvent,
PointerMap: PointerMap,
targetFinding: targeting
};
return pointerevents;
}));
(function(scope){
'use strict';
if(scope['TextEncoder']&&scope['TextDecoder']){
return false;
}
function FastTextEncoder(utfLabel='utf-8'){
if(utfLabel!=='utf-8'){
throw new RangeError(
`Failed to construct 'TextEncoder': The encoding label provided ('${utfLabel}') is invalid.`);
}}
Object.defineProperty(FastTextEncoder.prototype, 'encoding', {value: 'utf-8'});
FastTextEncoder.prototype.encode=function(string, options={stream: false}){
if(options.stream){
throw new Error(`Failed to encode: the 'stream' option is unsupported.`);
}
let pos=0;
const len=string.length;
const out=[];
let at=0;
let tlen=Math.max(32, len + (len >> 1) + 7);
let target=new Uint8Array((tlen >> 3) << 3);
while (pos < len){
let value=string.charCodeAt(pos++);
if(value >=0xd800&&value <=0xdbff){
if(pos < len){
const extra=string.charCodeAt(pos);
if((extra & 0xfc00)===0xdc00){
++pos;
value=((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;
}}
if(value >=0xd800&&value <=0xdbff){
continue;
}}
if(at + 4 > target.length){
tlen +=8;
tlen *=(1.0 + (pos / string.length) * 2);
tlen=(tlen >> 3) << 3;
const update=new Uint8Array(tlen);
update.set(target);
target=update;
}
if((value & 0xffffff80)===0){
target[at++]=value;
continue;
}else if((value & 0xfffff800)===0){
target[at++]=((value >>  6) & 0x1f) | 0xc0;
}else if((value & 0xffff0000)===0){
target[at++]=((value >> 12) & 0x0f) | 0xe0;
target[at++]=((value >>  6) & 0x3f) | 0x80;
}else if((value & 0xffe00000)===0){
target[at++]=((value >> 18) & 0x07) | 0xf0;
target[at++]=((value >> 12) & 0x3f) | 0x80;
target[at++]=((value >>  6) & 0x3f) | 0x80;
}else{
continue;
}
target[at++]=(value & 0x3f) | 0x80;
}
return target.slice(0, at);
}
function FastTextDecoder(utfLabel='utf-8', options={fatal: false}){
if(utfLabel!=='utf-8'){
throw new RangeError(
`Failed to construct 'TextDecoder': The encoding label provided ('${utfLabel}') is invalid.`);
}
if(options.fatal){
throw new Error(`Failed to construct 'TextDecoder': the 'fatal' option is unsupported.`);
}}
Object.defineProperty(FastTextDecoder.prototype, 'encoding', {value: 'utf-8'});
Object.defineProperty(FastTextDecoder.prototype, 'fatal', {value: false});
Object.defineProperty(FastTextDecoder.prototype, 'ignoreBOM', {value: false});
FastTextDecoder.prototype.decode=function(buffer, options={stream: false}){
if(options['stream']){
throw new Error(`Failed to decode: the 'stream' option is unsupported.`);
}
const bytes=new Uint8Array(buffer);
let pos=0;
const len=bytes.length;
const out=[];
while (pos < len){
const byte1=bytes[pos++];
if(byte1===0){
break;
}
if((byte1 & 0x80)===0){
out.push(byte1);
}else if((byte1 & 0xe0)===0xc0){
const byte2=bytes[pos++] & 0x3f;
out.push(((byte1 & 0x1f) << 6) | byte2);
}else if((byte1 & 0xf0)===0xe0){
const byte2=bytes[pos++] & 0x3f;
const byte3=bytes[pos++] & 0x3f;
out.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);
}else if((byte1 & 0xf8)===0xf0){
const byte2=bytes[pos++] & 0x3f;
const byte3=bytes[pos++] & 0x3f;
const byte4=bytes[pos++] & 0x3f;
let codepoint=((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;
if(codepoint > 0xffff){
codepoint -=0x10000;
out.push((codepoint >>> 10) & 0x3ff | 0xd800)
codepoint=0xdc00 | codepoint & 0x3ff;
}
out.push(codepoint);
}else{
}}
return String.fromCharCode.apply(null, out);
}
scope['TextEncoder']=FastTextEncoder;
scope['TextDecoder']=FastTextDecoder;
}(typeof window!=='undefined' ? window:(typeof global!=='undefined' ? global:this)));
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=t()}}(function(){return function i(s,h,l){function o(e,t){if(!h[e]){if(!s[e]){var a="function"==typeof require&&require;if(!t&&a)return a(e,!0);if(_)return _(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var r=h[e]={exports:{}};s[e][0].call(r.exports,function(t){return o(s[e][1][t]||t)},r,r.exports,i,s,h,l)}return h[e].exports}for(var _="function"==typeof require&&require,t=0;t<l.length;t++)o(l[t]);return o}({1:[function(t,e,a){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e,a,n=Array.prototype.slice.call(arguments,1);n.length;){var r=n.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)e=r,a=i,Object.prototype.hasOwnProperty.call(e,a)&&(t[i]=r[i])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,a,n,r){if(e.subarray&&t.subarray)t.set(e.subarray(a,a+n),r);else for(var i=0;i<n;i++)t[r+i]=e[a+i]},flattenChunks:function(t){var e,a,n,r,i,s;for(e=n=0,a=t.length;e<a;e++)n+=t[e].length;for(s=new Uint8Array(n),e=r=0,a=t.length;e<a;e++)i=t[e],s.set(i,r),r+=i.length;return s}},i={arraySet:function(t,e,a,n,r){for(var i=0;i<n;i++)t[r+i]=e[a+i]},flattenChunks:function(t){return[].concat.apply([],t)}};a.setTyped=function(t){t?(a.Buf8=Uint8Array,a.Buf16=Uint16Array,a.Buf32=Int32Array,a.assign(a,r)):(a.Buf8=Array,a.Buf16=Array,a.Buf32=Array,a.assign(a,i))},a.setTyped(n)},{}],2:[function(t,e,a){"use strict";var l=t("./common"),r=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){i=!1}for(var o=new l.Buf8(256),n=0;n<256;n++)o[n]=252<=n?6:248<=n?5:240<=n?4:224<=n?3:192<=n?2:1;function _(t,e){if(e<65534&&(t.subarray&&i||!t.subarray&&r))return String.fromCharCode.apply(null,l.shrinkBuf(t,e));for(var a="",n=0;n<e;n++)a+=String.fromCharCode(t[n]);return a}o[254]=o[254]=1,a.string2buf=function(t){var e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new l.Buf8(h),r=i=0;i<h;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:(a<2048?e[i++]=192|a>>>6:(a<65536?e[i++]=224|a>>>12:(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63),e[i++]=128|a>>>6&63),e[i++]=128|63&a);return e},a.buf2binstring=function(t){return _(t,t.length)},a.binstring2buf=function(t){for(var e=new l.Buf8(t.length),a=0,n=e.length;a<n;a++)e[a]=t.charCodeAt(a);return e},a.buf2string=function(t,e){var a,n,r,i,s=e||t.length,h=new Array(2*s);for(a=n=0;a<s;)if((r=t[a++])<128)h[n++]=r;else if(4<(i=o[r]))h[n++]=65533,a+=i-1;else{for(r&=2===i?31:3===i?15:7;1<i&&a<s;)r=r<<6|63&t[a++],i--;1<i?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return _(h,n)},a.utf8border=function(t,e){var a;for((e=e||t.length)>t.length&&(e=t.length),a=e-1;0<=a&&128==(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":1}],3:[function(t,e,a){"use strict";e.exports=function(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){for(a-=s=2e3<a?2e3:a;i=i+(r=r+e[n++]|0)|0,--s;);r%=65521,i%=65521}return r|i<<16|0}},{}],4:[function(t,e,a){"use strict";var h=function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}();e.exports=function(t,e,a,n){var r=h,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t}},{}],5:[function(t,e,a){"use strict";var l,u=t("../utils/common"),o=t("./trees"),f=t("./adler32"),c=t("./crc32"),n=t("./messages"),_=0,d=4,p=0,g=-2,m=-1,b=4,r=2,v=8,w=9,i=286,s=30,h=19,y=2*i+1,k=15,z=3,x=258,B=x+z+1,A=42,C=113,S=1,j=2,E=3,U=4;function D(t,e){return t.msg=n[e],e}function I(t){return(t<<1)-(4<t?9:0)}function O(t){for(var e=t.length;0<=--e;)t[e]=0}function q(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(u.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function T(t,e){o._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,q(t.strm)}function L(t,e){t.pending_buf[t.pending++]=e}function N(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function R(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-B?t.strstart-(t.w_size-B):0,o=t.window,_=t.w_mask,d=t.prev,u=t.strstart+x,f=o[i+s-1],c=o[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(o[(a=e)+s]===c&&o[a+s-1]===f&&o[a]===o[i]&&o[++a]===o[i+1]){i+=2,a++;do{}while(o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&i<u);if(n=x-(u-i),i=u-x,s<n){if(t.match_start=e,h<=(s=n))break;f=o[i+s-1],c=o[i+s]}}}while((e=d[e&_])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead}function H(t){var e,a,n,r,i,s,h,l,o,_,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-B)){for(u.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;n=t.head[--e],t.head[e]=d<=n?n-d:0,--a;);for(e=a=d;n=t.prev[--e],t.prev[e]=d<=n?n-d:0,--a;);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,o=r,_=void 0,_=s.avail_in,o<_&&(_=o),a=0===_?0:(s.avail_in-=_,u.arraySet(h,s.input,s.next_in,_,l),1===s.state.wrap?s.adler=f(s.adler,h,_,l):2===s.state.wrap&&(s.adler=c(s.adler,h,_,l)),s.next_in+=_,s.total_in+=_,_),t.lookahead+=a,t.lookahead+t.insert>=z)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+z-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<z)););}while(t.lookahead<B&&0!==t.strm.avail_in)}function F(t,e){for(var a,n;;){if(t.lookahead<B){if(H(t),t.lookahead<B&&e===_)return S;if(0===t.lookahead)break}if(a=0,t.lookahead>=z&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-B&&(t.match_length=R(t,a)),t.match_length>=z)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-z),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=z){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(T(t,!1),0===t.strm.avail_out))return S}return t.insert=t.strstart<z-1?t.strstart:z-1,e===d?(T(t,!0),0===t.strm.avail_out?E:U):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?S:j}function K(t,e){for(var a,n,r;;){if(t.lookahead<B){if(H(t),t.lookahead<B&&e===_)return S;if(0===t.lookahead)break}if(a=0,t.lookahead>=z&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=z-1,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-B&&(t.match_length=R(t,a),t.match_length<=5&&(1===t.strategy||t.match_length===z&&4096<t.strstart-t.match_start)&&(t.match_length=z-1)),t.prev_length>=z&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-z,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-z),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=z-1,t.strstart++,n&&(T(t,!1),0===t.strm.avail_out))return S}else if(t.match_available){if((n=o._tr_tally(t,0,t.window[t.strstart-1]))&&T(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return S}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<z-1?t.strstart:z-1,e===d?(T(t,!0),0===t.strm.avail_out?E:U):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?S:j}function M(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}function P(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new u.Buf16(2*y),this.dyn_dtree=new u.Buf16(2*(2*s+1)),this.bl_tree=new u.Buf16(2*(2*h+1)),O(this.dyn_ltree),O(this.dyn_dtree),O(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new u.Buf16(k+1),this.heap=new u.Buf16(2*i+1),O(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new u.Buf16(2*i+1),O(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function G(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=r,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?A:C,t.adler=2===e.wrap?0:1,e.last_flush=_,o._tr_init(e),p):D(t,g)}function J(t){var e,a=G(t);return a===p&&((e=t.state).window_size=2*e.w_size,O(e.head),e.max_lazy_match=l[e.level].max_lazy,e.good_match=l[e.level].good_length,e.nice_match=l[e.level].nice_length,e.max_chain_length=l[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=z-1,e.match_available=0,e.ins_h=0),a}function Q(t,e,a,n,r,i){if(!t)return g;var s=1;if(e===m&&(e=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),r<1||w<r||a!==v||n<8||15<n||e<0||9<e||i<0||b<i)return D(t,g);8===n&&(n=9);var h=new P;return(t.state=h).strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+z-1)/z),h.window=new u.Buf8(2*h.w_size),h.head=new u.Buf16(h.hash_size),h.prev=new u.Buf16(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new u.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,J(t)}l=[new M(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(H(t),0===t.lookahead&&e===_)return S;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,T(t,!1),0===t.strm.avail_out))return S;if(t.strstart-t.block_start>=t.w_size-B&&(T(t,!1),0===t.strm.avail_out))return S}return t.insert=0,e===d?(T(t,!0),0===t.strm.avail_out?E:U):(t.strstart>t.block_start&&(T(t,!1),t.strm.avail_out),S)}),new M(4,4,8,4,F),new M(4,5,16,8,F),new M(4,6,32,32,F),new M(4,4,16,16,K),new M(8,16,32,32,K),new M(8,16,128,128,K),new M(8,32,128,256,K),new M(32,128,258,1024,K),new M(32,258,258,4096,K)],a.deflateInit=function(t,e){return Q(t,e,v,15,8,0)},a.deflateInit2=Q,a.deflateReset=J,a.deflateResetKeep=G,a.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?g:(t.state.gzhead=e,p):g},a.deflate=function(t,e){var a,n,r,i;if(!t||!t.state||5<e||e<0)return t?D(t,g):g;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&e!==d)return D(t,0===t.avail_out?-5:g);if(n.strm=t,a=n.last_flush,n.last_flush=e,n.status===A)if(2===n.wrap)t.adler=0,L(n,31),L(n,139),L(n,8),n.gzhead?(L(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),L(n,255&n.gzhead.time),L(n,n.gzhead.time>>8&255),L(n,n.gzhead.time>>16&255),L(n,n.gzhead.time>>24&255),L(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),L(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(L(n,255&n.gzhead.extra.length),L(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=c(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(L(n,0),L(n,0),L(n,0),L(n,0),L(n,0),L(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),L(n,3),n.status=C);else{var s=v+(n.w_bits-8<<4)<<8;s|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=C,N(n,s),0!==n.strstart&&(N(n,t.adler>>>16),N(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(r=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>r&&(t.adler=c(t.adler,n.pending_buf,n.pending-r,r)),q(t),r=n.pending,n.pending!==n.pending_buf_size));)L(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>r&&(t.adler=c(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(t.adler=c(t.adler,n.pending_buf,n.pending-r,r)),q(t),r=n.pending,n.pending===n.pending_buf_size)){i=1;break}L(n,i=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0)}while(0!==i);n.gzhead.hcrc&&n.pending>r&&(t.adler=c(t.adler,n.pending_buf,n.pending-r,r)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(t.adler=c(t.adler,n.pending_buf,n.pending-r,r)),q(t),r=n.pending,n.pending===n.pending_buf_size)){i=1;break}L(n,i=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0)}while(0!==i);n.gzhead.hcrc&&n.pending>r&&(t.adler=c(t.adler,n.pending_buf,n.pending-r,r)),0===i&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&q(t),n.pending+2<=n.pending_buf_size&&(L(n,255&t.adler),L(n,t.adler>>8&255),t.adler=0,n.status=C)):n.status=C),0!==n.pending){if(q(t),0===t.avail_out)return n.last_flush=-1,p}else if(0===t.avail_in&&I(e)<=I(a)&&e!==d)return D(t,-5);if(666===n.status&&0!==t.avail_in)return D(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==_&&666!==n.status){var h=2===n.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(H(t),0===t.lookahead)){if(e===_)return S;break}if(t.match_length=0,a=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(T(t,!1),0===t.strm.avail_out))return S}return t.insert=0,e===d?(T(t,!0),0===t.strm.avail_out?E:U):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?S:j}(n,e):3===n.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=x){if(H(t),t.lookahead<=x&&e===_)return S;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=z&&0<t.strstart&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+x;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=x-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=z?(a=o._tr_tally(t,1,t.match_length-z),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(T(t,!1),0===t.strm.avail_out))return S}return t.insert=0,e===d?(T(t,!0),0===t.strm.avail_out?E:U):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?S:j}(n,e):l[n.level].func(n,e);if(h!==E&&h!==U||(n.status=666),h===S||h===E)return 0===t.avail_out&&(n.last_flush=-1),p;if(h===j&&(1===e?o._tr_align(n):5!==e&&(o._tr_stored_block(n,0,0,!1),3===e&&(O(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),q(t),0===t.avail_out))return n.last_flush=-1,p}return e!==d?p:n.wrap<=0?1:(2===n.wrap?(L(n,255&t.adler),L(n,t.adler>>8&255),L(n,t.adler>>16&255),L(n,t.adler>>24&255),L(n,255&t.total_in),L(n,t.total_in>>8&255),L(n,t.total_in>>16&255),L(n,t.total_in>>24&255)):(N(n,t.adler>>>16),N(n,65535&t.adler)),q(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?p:1)},a.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==A&&69!==e&&73!==e&&91!==e&&103!==e&&e!==C&&666!==e?D(t,g):(t.state=null,e===C?D(t,-3):p):g},a.deflateSetDictionary=function(t,e){var a,n,r,i,s,h,l,o,_=e.length;if(!t||!t.state)return g;if(2===(i=(a=t.state).wrap)||1===i&&a.status!==A||a.lookahead)return g;for(1===i&&(t.adler=f(t.adler,e,_,0)),a.wrap=0,_>=a.w_size&&(0===i&&(O(a.head),a.strstart=0,a.block_start=0,a.insert=0),o=new u.Buf8(a.w_size),u.arraySet(o,e,_-a.w_size,a.w_size,0),e=o,_=a.w_size),s=t.avail_in,h=t.next_in,l=t.input,t.avail_in=_,t.next_in=0,t.input=e,H(a);a.lookahead>=z;){for(n=a.strstart,r=a.lookahead-(z-1);a.ins_h=(a.ins_h<<a.hash_shift^a.window[n+z-1])&a.hash_mask,a.prev[n&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=n,n++,--r;);a.strstart=n,a.lookahead=z-1,H(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=z-1,a.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,a.wrap=i,p},a.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":4,"./messages":6,"./trees":7}],6:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],7:[function(t,e,a){"use strict";var l=t("../utils/common"),h=0,o=1;function n(t){for(var e=t.length;0<=--e;)t[e]=0}var _=0,s=29,d=256,u=d+1+s,f=30,c=19,g=2*u+1,m=15,r=16,p=7,b=256,v=16,w=17,y=18,k=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],A=new Array(2*(u+2));n(A);var C=new Array(2*f);n(C);var S=new Array(512);n(S);var j=new Array(256);n(j);var E=new Array(s);n(E);var U,D,I,O=new Array(f);function q(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function i(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function T(t){return t<256?S[t]:S[256+(t>>>7)]}function L(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function N(t,e,a){t.bi_valid>r-a?(t.bi_buf|=e<<t.bi_valid&65535,L(t,t.bi_buf),t.bi_buf=e>>r-t.bi_valid,t.bi_valid+=a-r):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function R(t,e,a){N(t,a[2*e],a[2*e+1])}function H(t,e){for(var a=0;a|=1&t,t>>>=1,a<<=1,0<--e;);return a>>>1}function F(t,e,a){var n,r,i=new Array(m+1),s=0;for(n=1;n<=m;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=H(i[h]++,h))}}function K(t){var e;for(e=0;e<u;e++)t.dyn_ltree[2*e]=0;for(e=0;e<f;e++)t.dyn_dtree[2*e]=0;for(e=0;e<c;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*b]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function M(t){8<t.bi_valid?L(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function P(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]}function G(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&P(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!P(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n}function J(t,e,a){var n,r,i,s,h=0;if(0!==t.last_lit)for(;n=t.pending_buf[t.d_buf+2*h]<<8|t.pending_buf[t.d_buf+2*h+1],r=t.pending_buf[t.l_buf+h],h++,0===n?R(t,r,e):(R(t,(i=j[r])+d+1,e),0!==(s=k[i])&&N(t,r-=E[i],s),R(t,i=T(--n),a),0!==(s=z[i])&&N(t,n-=O[i],s)),h<t.last_lit;);R(t,b,e)}function Q(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=g,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;1<=a;a--)G(t,i,a);for(r=l;a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],G(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,G(t,i,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,o=e.max_code,_=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=m;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<g;a++)c<(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)&&(i=c,p++),l[2*n+1]=i,o<n||(t.bl_count[i]++,s=0,f<=n&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(_[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(0<p);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)o<(r=t.heap[--a])||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),F(i,o,t.bl_count)}function V(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,o=4;for(0===s&&(l=138,o=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<o?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[2*v]++):h<=10?t.bl_tree[2*w]++:t.bl_tree[2*y]++,i=r,(h=0)===s?(l=138,o=3):r===s?(l=6,o=3):(l=7,o=4))}function W(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,o=4;for(0===s&&(l=138,o=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<o)for(;R(t,r,t.bl_tree),0!=--h;);else 0!==r?(r!==i&&(R(t,r,t.bl_tree),h--),R(t,v,t.bl_tree),N(t,h-3,2)):h<=10?(R(t,w,t.bl_tree),N(t,h-3,3)):(R(t,y,t.bl_tree),N(t,h-11,7));i=r,(h=0)===s?(l=138,o=3):r===s?(l=6,o=3):(l=7,o=4)}}n(O);var X=!1;function Y(t,e,a,n){var r,i,s,h;N(t,(_<<1)+(n?1:0),3),i=e,s=a,h=!0,M(r=t),h&&(L(r,s),L(r,~s)),l.arraySet(r.pending_buf,r.window,i,s,r.pending),r.pending+=s}a._tr_init=function(t){X||(function(){var t,e,a,n,r,i=new Array(m+1);for(n=a=0;n<s-1;n++)for(E[n]=a,t=0;t<1<<k[n];t++)j[a++]=n;for(j[a-1]=n,n=r=0;n<16;n++)for(O[n]=r,t=0;t<1<<z[n];t++)S[r++]=n;for(r>>=7;n<f;n++)for(O[n]=r<<7,t=0;t<1<<z[n]-7;t++)S[256+r++]=n;for(e=0;e<=m;e++)i[e]=0;for(t=0;t<=143;)A[2*t+1]=8,t++,i[8]++;for(;t<=255;)A[2*t+1]=9,t++,i[9]++;for(;t<=279;)A[2*t+1]=7,t++,i[7]++;for(;t<=287;)A[2*t+1]=8,t++,i[8]++;for(F(A,u+1,i),t=0;t<f;t++)C[2*t+1]=5,C[2*t]=H(t,5);U=new q(A,k,d+1,u,m),D=new q(C,z,0,f,m),I=new q(new Array(0),x,0,c,p)}(),X=!0),t.l_desc=new i(t.dyn_ltree,U),t.d_desc=new i(t.dyn_dtree,D),t.bl_desc=new i(t.bl_tree,I),t.bi_buf=0,t.bi_valid=0,K(t)},a._tr_stored_block=Y,a._tr_flush_block=function(t,e,a,n){var r,i,s=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return h;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return o;for(e=32;e<d;e++)if(0!==t.dyn_ltree[2*e])return o;return h}(t)),Q(t,t.l_desc),Q(t,t.d_desc),s=function(t){var e;for(V(t,t.dyn_ltree,t.l_desc.max_code),V(t,t.dyn_dtree,t.d_desc.max_code),Q(t,t.bl_desc),e=c-1;3<=e&&0===t.bl_tree[2*B[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(i=t.static_len+3+7>>>3)<=r&&(r=i)):r=i=a+5,a+4<=r&&-1!==e?Y(t,e,a,n):4===t.strategy||i===r?(N(t,2+(n?1:0),3),J(t,A,C)):(N(t,4+(n?1:0),3),function(t,e,a,n){var r;for(N(t,e-257,5),N(t,a-1,5),N(t,n-4,4),r=0;r<n;r++)N(t,t.bl_tree[2*B[r]+1],3);W(t,t.dyn_ltree,e-1),W(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),J(t,t.dyn_ltree,t.dyn_dtree)),K(t),n&&M(t)},a._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(j[a]+d+1)]++,t.dyn_dtree[2*T(e)]++),t.last_lit===t.lit_bufsize-1},a._tr_align=function(t){var e;N(t,2,3),R(t,b,A),16===(e=t).bi_valid?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":1}],8:[function(t,e,a){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/deflate.js":[function(t,e,a){"use strict";var s=t("./zlib/deflate"),h=t("./utils/common"),l=t("./utils/strings"),r=t("./zlib/messages"),i=t("./zlib/zstream"),o=Object.prototype.toString,_=0,d=-1,u=0,f=8;function c(t){if(!(this instanceof c))return new c(t);this.options=h.assign({level:d,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var a=s.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==_)throw new Error(r[a]);if(e.header&&s.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?l.string2buf(e.dictionary):"[object ArrayBuffer]"===o.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=s.deflateSetDictionary(this.strm,n))!==_)throw new Error(r[a]);this._dict_set=!0}}function n(t,e){var a=new c(e);if(a.push(t,!0),a.err)throw a.msg||r[a.err];return a.result}c.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;n=e===~~e?e:!0===e?4:0,"string"==typeof t?r.input=l.string2buf(t):"[object ArrayBuffer]"===o.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new h.Buf8(i),r.next_out=0,r.avail_out=i),1!==(a=s.deflate(r,n))&&a!==_)return this.onEnd(a),!(this.ended=!0);0!==r.avail_out&&(0!==r.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(l.buf2binstring(h.shrinkBuf(r.output,r.next_out))):this.onData(h.shrinkBuf(r.output,r.next_out)))}while((0<r.avail_in||0===r.avail_out)&&1!==a);return 4===n?(a=s.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===_):2!==n||(this.onEnd(_),!(r.avail_out=0))},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===_&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=c,a.deflate=n,a.deflateRaw=function(t,e){return(e=e||{}).raw=!0,n(t,e)},a.gzip=function(t,e){return(e=e||{}).gzip=!0,n(t,e)}},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js")});
jQuery(function($){var key,core={MARKER_PULL_DATABASE:"0",MARKER_PULL_XML:"1",PAGE_MAP_LIST:"map-list",PAGE_MAP_EDIT:"map-edit",PAGE_SETTINGS:"map-settings",PAGE_SUPPORT:"map-support",PAGE_CATEGORIES:"categories",PAGE_ADVANCED:"advanced",PAGE_CUSTOM_FIELDS:"custom-fields",maps:[],events:null,settings:null,restAPI:null,localized_strings:null,loadingHTML:'<div class="wpgmza-preloader"><div class="wpgmza-loader">...</div></div>',preloaderHTML:"<div class='wpgmza-preloader'><div></div><div></div><div></div><div></div></div>",getCurrentPage:function(){switch(WPGMZA.getQueryParamValue("page")){case"wp-google-maps-menu":return window.location.href.match(/action=edit/)&&window.location.href.match(/map_id=\d+/)?WPGMZA.PAGE_MAP_EDIT:WPGMZA.PAGE_MAP_LIST;case"wp-google-maps-menu-settings":return WPGMZA.PAGE_SETTINGS;case"wp-google-maps-menu-support":return WPGMZA.PAGE_SUPPORT;case"wp-google-maps-menu-categories":return WPGMZA.PAGE_CATEGORIES;case"wp-google-maps-menu-advanced":return WPGMZA.PAGE_ADVANCED;case"wp-google-maps-menu-custom-fields":return WPGMZA.PAGE_CUSTOM_FIELDS;default:return null}},getScrollAnimationOffset:function(){return(WPGMZA.settings.scroll_animation_offset||0)+($("#wpadminbar").height()||0)},getScrollAnimationDuration:function(){return WPGMZA.settings.scroll_animation_milliseconds||500},animateScroll:function(element,milliseconds){var offset=WPGMZA.getScrollAnimationOffset();milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$("html, body").animate({scrollTop:$(element).offset().top-offset},milliseconds)},extend:function(child,parent){var constructor=child;child.prototype=Object.create(parent.prototype),child.prototype.constructor=constructor},guid:function(){var d=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(d+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)})},hexOpacityToRGBA:function(hex,opacity){hex=parseInt(hex.replace(/^#/,""),16);return[(16711680&hex)>>16,(65280&hex)>>8,255&hex,parseFloat(opacity)]},hexOpacityToString:function(colour,arr){arr=WPGMZA.hexOpacityToRGBA(colour,arr);return"rgba("+arr[0]+", "+arr[1]+", "+arr[2]+", "+arr[3]+")"},hexToRgba:function(c){return/^#([A-Fa-f0-9]{3}){1,2}$/.test(c)?(3==(c=c.substring(1).split("")).length&&(c=[c[0],c[0],c[1],c[1],c[2],c[2]]),{r:(c="0x"+c.join(""))>>16&255,g:c>>8&255,b:255&c,a:1}):0},rgbaToString:function(rgba){return"rgba("+rgba.r+", "+rgba.g+", "+rgba.b+", "+rgba.a+")"},latLngRegexp:/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,isLatLngString:function(m){if("string"!=typeof m)return null;m.match(/^\(.+\)$/)&&(m=m.replace(/^\(|\)$/,""));m=m.match(WPGMZA.latLngRegexp);return m?new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])}):null},stringToLatLng:function(result){result=WPGMZA.isLatLngString(result);if(!result)throw new Error("Not a valid latLng");return result},isHexColorString:function(str){return"string"==typeof str&&!!str.match(/#[0-9A-F]{6}/i)},imageDimensionsCache:{},getImageDimensions:function(src,callback){var img;WPGMZA.imageDimensionsCache[src]?callback(WPGMZA.imageDimensionsCache[src]):((img=document.createElement("img")).onload=function(event){var result={width:img.width,height:img.height};WPGMZA.imageDimensionsCache[src]=result,callback(result)},img.src=src)},decodeEntities:function(input){return input.replace(/&(nbsp|amp|quot|lt|gt);/g,function(m,e){return m[e]}).replace(/&#(\d+);/gi,function(m,e){return String.fromCharCode(parseInt(e,10))})},isDeveloperMode:function(){return this.settings.developer_mode||window.Cookies&&window.Cookies.get("wpgmza-developer-mode")},isProVersion:function(){return"1"==this._isProVersion},openMediaDialog:function(callback){var file_frame;if(file_frame)return file_frame.uploader.uploader.param("post_id",set_to_post_id),void file_frame.open();(file_frame=wp.media.frames.file_frame=wp.media({title:"Select a image to upload",button:{text:"Use this image"},multiple:!1})).on("select",function(){attachment=file_frame.state().get("selection").first().toJSON(),callback(attachment.id,attachment.url)}),file_frame.open()},getCurrentPosition:function(callback,error,watch){var options,nativeFunction="getCurrentPosition";WPGMZA.userLocationDenied?error&&error({code:1,message:"Location unavailable"}):(watch&&(nativeFunction="watchPosition"),navigator.geolocation?(options={enableHighAccuracy:!0},navigator.geolocation[nativeFunction]?navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){options.enableHighAccuracy=!1,navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){console.warn(err.code,err.message),1==err.code&&(WPGMZA.userLocationDenied=!0),error&&error(err)},options)},options):console.warn(nativeFunction+" is not available")):console.warn("No geolocation available on this device"))},watchPosition:function(callback,error){return WPGMZA.getCurrentPosition(callback,error,!0)},runCatchableTask:function(callback,friendlyErrorContainer){if(WPGMZA.isDeveloperMode())callback();else try{callback()}catch(e){var friendlyError=new WPGMZA.FriendlyError(e);$(friendlyErrorContainer).html(""),$(friendlyErrorContainer).append(friendlyError.element),$(friendlyErrorContainer).show()}},capitalizeWords:function(string){return(string+"").replace(/^(.)|\s+(.)/g,function(m){return m.toUpperCase()})},pluralize:function(string){return WPGMZA.singularize(string)+"s"},singularize:function(string){return string.replace(/s$/,"")},assertInstanceOf:function(instance,fullInstanceName){var pro=WPGMZA.isProVersion()?"Pro":"",engine="open-layers"===WPGMZA.settings.engine?"OL":"Google",fullInstanceName=WPGMZA[engine+pro+fullInstanceName]&&engine+fullInstanceName!="OLFeature"?engine+pro+fullInstanceName:WPGMZA[pro+fullInstanceName]?pro+fullInstanceName:WPGMZA[engine+fullInstanceName]&&WPGMZA[engine+fullInstanceName].prototype?engine+fullInstanceName:fullInstanceName;if("OLFeature"!=fullInstanceName&&!(instance instanceof WPGMZA[fullInstanceName]))throw new Error("Object must be an instance of "+fullInstanceName+" (did you call a constructor directly, rather than createInstance?)")},getMapByID:function(id){for(var i=0;i<WPGMZA.maps.length;i++)if(WPGMZA.maps[i].id==id)return WPGMZA.maps[i];return null},isGoogleAutocompleteSupported:function(){return!!window.google&&(!!google.maps&&(!!google.maps.places&&(!!google.maps.places.Autocomplete&&(!WPGMZA.CloudAPI||!WPGMZA.CloudAPI.isBeingUsed))))},googleAPIStatus:window.wpgmza_google_api_status,isSafari:function(){var ua=navigator.userAgent.toLowerCase();return ua.match(/safari/i)&&!ua.match(/chrome/i)},isTouchDevice:function(){return"ontouchstart"in window},isDeviceiOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},isModernComponentStyleAllowed:function(){return!WPGMZA.settings.user_interface_style||"legacy"==WPGMZA.settings.user_interface_style||"modern"==WPGMZA.settings.user_interface_style},isElementInView:function(elementBottom){var pageTop=$(window).scrollTop(),pageBottom=pageTop+$(window).height(),elementTop=$(elementBottom).offset().top,elementBottom=elementTop+$(elementBottom).height();return elementTop<pageTop&&pageBottom<elementBottom||(pageTop<=elementTop&&elementTop<=pageBottom||pageTop<=elementBottom&&elementBottom<=pageBottom)},isFullScreen:function(){return wpgmzaisFullScreen},getQueryParamValue:function(m){m=new RegExp(m+"=([^&#]*)");return(m=window.location.href.match(m))?decodeURIComponent(m[1]):null},notification:function(text,time){switch(arguments.length){case 0:text="",time=4e3;break;case 1:time=4e3}var html='<div class="wpgmza-popup-notification">'+text+"</div>";jQuery("body").append(html),setTimeout(function(){jQuery("body").find(".wpgmza-popup-notification").remove()},time)},initMaps:function(){$(document.body).find(".wpgmza_map:not(.wpgmza-initialized)").each(function(index,el){if(el.wpgmzaMap)console.warn("Element missing class wpgmza-initialized but does have wpgmzaMap property. No new instance will be created");else try{el.wpgmzaMap=WPGMZA.Map.createInstance(el)}catch(ex){console.warn("Map initalization: "+ex)}}),WPGMZA.Map.nextInitTimeoutID=setTimeout(WPGMZA.initMaps,3e3)},onScroll:function(){$(".wpgmza_map").each(function(index,el){var isInView=WPGMZA.isElementInView(el);el.wpgmzaScrollIntoViewTriggerFlag?isInView||(el.wpgmzaScrollIntoViewTriggerFlag=!1):isInView&&($(el).trigger("mapscrolledintoview.wpgmza"),el.wpgmzaScrollIntoViewTriggerFlag=!0)})}},wpgmzaisFullScreen=!1;for(key in[]){console.warn("It appears that the built in JavaScript Array has been extended, this can create issues with for ... in loops, which may cause failure.");break}for(key in window.WPGMZA?window.WPGMZA=$.extend(window.WPGMZA,core):window.WPGMZA=core,window.uc&&window.uc.reloadOnOptIn&&(window.uc.reloadOnOptIn("S1pcEj_jZX"),window.uc.reloadOnOptOut("S1pcEj_jZX")),WPGMZA_localized_data){var value=WPGMZA_localized_data[key];WPGMZA[key]=value}WPGMZA.settings.useLegacyGlobals=!0,$(document).on("fullscreenchange",function(){wpgmzaisFullScreen=!!document.fullscreenElement}),$("body").on("click","#wpgmzaCloseChat",function(e){e.preventDefault(),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_hide_chat",nonce:WPGMZA_localized_data.ajaxnonce}}),$(".wpgmza-chat-help").remove()}),$(window).on("scroll",WPGMZA.onScroll),$(document.body).on("click","button.wpgmza-api-consent",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()}),$(document.body).on("keydown",function(event){event.altKey&&(WPGMZA.altKeyDown=!0)}),$(document.body).on("keyup",function(event){event.altKey||(WPGMZA.altKeyDown=!1)}),$(document.body).on("preinit.wpgmza",function(){$(window).trigger("ready.wpgmza"),$("script[src*='wp-google-maps.combined.js'], script[src*='wp-google-maps-pro.combined.js']").length&&console.warn("Minified script is out of date, using combined script instead.");var warning=$("script[src]").filter(function(){return this.src.match(/(^|\/)jquery\.(min\.)?js(\?|$)/i)});1<warning.length&&console.warn("Multiple jQuery versions detected: ",warning);for(var key in[]){console.warn("The Array object has been extended incorrectly by your theme or another plugin. This can cause issues with functionality.");break}"https:"!=window.location.protocol&&(warning='<div class="notice notice-warning"><p>'+WPGMZA.localized_strings.unsecure_geolocation+"</p></div>",$(".wpgmza-geolocation-setting").first().after($(warning))),WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code&&jQuery(".wpgmza-gdpr-compliance").length<=0&&$("button.wpgmza-api-consent").on("click",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()})}),function($){$(function(){WPGMZA.restAPI=WPGMZA.RestAPI.createInstance(),WPGMZA.CloudAPI&&(WPGMZA.cloudAPI=WPGMZA.CloudAPI.createInstance()),$(document.body).trigger("preinit.wpgmza"),WPGMZA.initMaps(),WPGMZA.onScroll()})}($)}),jQuery(function($){WPGMZA.Compatibility=function(){this.preventDocumentWriteGoogleMapsAPI()},WPGMZA.Compatibility.prototype.preventDocumentWriteGoogleMapsAPI=function(){var old=document.write;document.write=function(content){content.match&&content.match(/maps\.google/)||old.call(document,content)}},WPGMZA.compatiblityModule=new WPGMZA.Compatibility}),function(root,factory){"object"==typeof exports?module.exports=factory(root):"function"==typeof define&&define.amd?define([],factory.bind(root,root)):factory(root)}("undefined"!=typeof global?global:this,function(root){if(root.CSS&&root.CSS.escape)return root.CSS.escape;function cssEscape(value){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var codeUnit,string=String(value),length=string.length,index=-1,result="",firstCodeUnit=string.charCodeAt(0);++index<length;)0!=(codeUnit=string.charCodeAt(index))?result+=1<=codeUnit&&codeUnit<=31||127==codeUnit||0==index&&48<=codeUnit&&codeUnit<=57||1==index&&48<=codeUnit&&codeUnit<=57&&45==firstCodeUnit?"\\"+codeUnit.toString(16)+" ":(0!=index||1!=length||45!=codeUnit)&&(128<=codeUnit||45==codeUnit||95==codeUnit||48<=codeUnit&&codeUnit<=57||65<=codeUnit&&codeUnit<=90||97<=codeUnit&&codeUnit<=122)?string.charAt(index):"\\"+string.charAt(index):result+="�";return result}return root.CSS||(root.CSS={}),root.CSS.escape=cssEscape}),jQuery(function($){Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Distance={MILES:!0,KILOMETERS:!1,MILES_PER_KILOMETER:.621371,KILOMETERS_PER_MILE:1.60934,uiToMeters:function(uiDistance){return parseFloat(uiDistance)/(WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?WPGMZA.Distance.MILES_PER_KILOMETER:1)*1e3},uiToKilometers:function(uiDistance){return.001*WPGMZA.Distance.uiToMeters(uiDistance)},uiToMiles:function(uiDistance){return WPGMZA.Distance.uiToKilometers(uiDistance)*WPGMZA.Distance.MILES_PER_KILOMETER},kilometersToUI:function(km){return WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?km*WPGMZA.Distance.MILES_PER_KILOMETER:km},between:function(a,dLat){if(!(a instanceof WPGMZA.LatLng||"lat"in a&&"lng"in a))throw new Error("First argument must be an instance of WPGMZA.LatLng or a literal");if(!(dLat instanceof WPGMZA.LatLng||"lat"in dLat&&"lng"in dLat))throw new Error("Second argument must be an instance of WPGMZA.LatLng or a literal");if(a===dLat)return 0;var lat1=a.lat,dLon=a.lng,lat2=dLat.lat,lon2=dLat.lng,dLat=deg2rad(lat2-lat1),dLon=deg2rad(lon2-dLon),a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(dLon/2)*Math.sin(dLon/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}}),jQuery(function($){WPGMZA.EliasFano=function(){if(!WPGMZA.EliasFano.isSupported)throw new Error("Elias Fano encoding is not supported on browsers without Uint8Array");WPGMZA.EliasFano.decodingTablesInitialised||WPGMZA.EliasFano.createDecodingTable()},WPGMZA.EliasFano.isSupported="Uint8Array"in window,WPGMZA.EliasFano.decodingTableHighBits=[],WPGMZA.EliasFano.decodingTableDocIDNumber=null,WPGMZA.EliasFano.decodingTableHighBitsCarryover=null,WPGMZA.EliasFano.createDecodingTable=function(){WPGMZA.EliasFano.decodingTableDocIDNumber=new Uint8Array(256),WPGMZA.EliasFano.decodingTableHighBitsCarryover=new Uint8Array(256);for(var decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,i=0;i<256;i++){var zeroCount=0;decodingTableHighBits[i]=[];for(var j=7;0<=j;j--)zeroCount=0<(i&1<<j)?(decodingTableHighBits[i][decodingTableDocIDNumber[i]]=zeroCount,decodingTableDocIDNumber[i]++,0):(zeroCount+1)%255;decodingTableHighBitsCarryover[i]=zeroCount}WPGMZA.EliasFano.decodingTablesInitialised=!0},WPGMZA.EliasFano.prototype.encode=function(list){var lastDocID=0,buffer1=0,bufferLength1=0,buffer2=0,bufferLength2=0;if(0==list.length)return result;var compressedBufferPointer1=0,compressedBufferPointer2=0,maxCompressedSize=list[list.length-1]/list.length,averageDeltaLog=Math.log2(maxCompressedSize),lowBitsLength=Math.floor(averageDeltaLog),lowBitsMask=(1<<lowBitsLength)-1,prev=null,maxCompressedSize=Math.floor((2+Math.ceil(Math.log2(maxCompressedSize)))*list.length/8)+6,compressedBuffer=new Uint8Array(maxCompressedSize);lowBitsLength<0&&(lowBitsLength=0),compressedBufferPointer2=Math.floor(lowBitsLength*list.length/8+6),compressedBuffer[compressedBufferPointer1++]=255&list.length,compressedBuffer[compressedBufferPointer1++]=255&list.length>>8,compressedBuffer[compressedBufferPointer1++]=255&list.length>>16,compressedBuffer[compressedBufferPointer1++]=255&list.length>>24,compressedBuffer[compressedBufferPointer1++]=255&lowBitsLength,list.forEach(function(docID){var unaryCodeLength=docID-lastDocID-1;if(!$.isNumeric(docID))throw new Error("Value is not numeric");if(docID=parseInt(docID),null!==prev&&docID<=prev)throw new Error("Elias Fano encoding can only be used on a sorted, ascending list of unique integers.");for(prev=docID,buffer1<<=lowBitsLength,buffer1|=unaryCodeLength&lowBitsMask,bufferLength1+=lowBitsLength;7<bufferLength1;)bufferLength1-=8,compressedBuffer[compressedBufferPointer1++]=255&buffer1>>bufferLength1;unaryCodeLength=1+(unaryCodeLength>>lowBitsLength);for(buffer2<<=unaryCodeLength,buffer2|=1,bufferLength2+=unaryCodeLength;7<bufferLength2;)bufferLength2-=8,compressedBuffer[compressedBufferPointer2++]=255&buffer2>>bufferLength2;lastDocID=docID}),0<bufferLength1&&(compressedBuffer[compressedBufferPointer1++]=255&buffer1<<8-bufferLength1),0<bufferLength2&&(compressedBuffer[compressedBufferPointer2++]=255&buffer2<<8-bufferLength2);var result=new Uint8Array(compressedBuffer);return result.pointer=compressedBufferPointer2,result},WPGMZA.EliasFano.prototype.decode=function(compressedBuffer){var docIDNumber,resultPointer=0,list=[],decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,lowBitsPointer=0,lastDocID=0,docID=0,listCount=compressedBuffer[lowBitsPointer++];listCount|=compressedBuffer[lowBitsPointer++]<<8,listCount|=compressedBuffer[lowBitsPointer++]<<16,listCount|=compressedBuffer[lowBitsPointer++]<<24;for(var lowBitsLength=compressedBuffer[lowBitsPointer++],lowBitsCount=0,lowBits=0,cb=1,highBitsPointer=Math.floor(lowBitsLength*listCount/8+6);highBitsPointer<compressedBuffer.pointer;highBitsPointer++){docID+=decodingTableHighBitsCarryover[cb],docIDNumber=decodingTableDocIDNumber[cb=compressedBuffer[highBitsPointer]];for(var i=0;i<docIDNumber;i++){for(docID<<=lowBitsCount,docID|=lowBits&(1<<lowBitsCount)-1;lowBitsCount<lowBitsLength;)docID<<=8,docID|=lowBits=compressedBuffer[lowBitsPointer++],lowBitsCount+=8;docID>>=lowBitsCount-=lowBitsLength,docID+=(decodingTableHighBits[cb][i]<<lowBitsLength)+lastDocID+1,lastDocID=list[resultPointer++]=docID,docID=0}}return list}}),jQuery(function($){WPGMZA.EventDispatcher=function(){WPGMZA.assertInstanceOf(this,"EventDispatcher"),this._listenersByType={}},WPGMZA.EventDispatcher.prototype.addEventListener=function(obj,listener,thisObject,useCapture){var types=obj.split(/\s+/);if(1<types.length)for(var i=0;i<types.length;i++)this.addEventListener(types[i],listener,thisObject,useCapture);else{if(!(listener instanceof Function))throw new Error("Listener must be a function");var target=this._listenersByType.hasOwnProperty(obj)?this._listenersByType[obj]:this._listenersByType[obj]=[],obj={listener:listener,thisObject:thisObject||this,useCapture:!!useCapture};target.push(obj)}},WPGMZA.EventDispatcher.prototype.on=WPGMZA.EventDispatcher.prototype.addEventListener,WPGMZA.EventDispatcher.prototype.removeEventListener=function(type,listener,thisObject,useCapture){var arr,obj;if(arr=this._listenersByType[type]){thisObject=thisObject||this,useCapture=!!useCapture;for(var i=0;i<arr.length;i++)if(obj=arr[i],(1==arguments.length||obj.listener==listener)&&obj.thisObject==thisObject&&obj.useCapture==useCapture)return void arr.splice(i,1)}},WPGMZA.EventDispatcher.prototype.off=WPGMZA.EventDispatcher.prototype.removeEventListener,WPGMZA.EventDispatcher.prototype.hasEventListener=function(type){return!!_listenersByType[type]},WPGMZA.EventDispatcher.prototype.dispatchEvent=function(event){if(!(event instanceof WPGMZA.Event))if("string"==typeof event)event=new WPGMZA.Event(event);else{var name,src=event;for(name in event=new WPGMZA.Event,src)event[name]=src[name]}for(var path=[],obj=(event.target=this).parent;null!=obj;obj=obj.parent)path.unshift(obj);event.phase=WPGMZA.Event.CAPTURING_PHASE;for(var i=0;i<path.length&&!event._cancelled;i++)path[i]._triggerListeners(event);if(!event._cancelled){for(event.phase=WPGMZA.Event.AT_TARGET,this._triggerListeners(event),event.phase=WPGMZA.Event.BUBBLING_PHASE,i=path.length-1;0<=i&&!event._cancelled;i--)path[i]._triggerListeners(event);for(var topMostElement=this.element,obj=this.parent;null!=obj;obj=obj.parent)obj.element&&(topMostElement=obj.element);if(topMostElement){var key,customEvent={};for(key in event){var value=event[key];"type"==key&&(value+=".wpgmza"),customEvent[key]=value}$(topMostElement).trigger(customEvent)}}},WPGMZA.EventDispatcher.prototype.trigger=WPGMZA.EventDispatcher.prototype.dispatchEvent,WPGMZA.EventDispatcher.prototype._triggerListeners=function(event){var arr,obj;if(arr=this._listenersByType[event.type])for(var i=0;i<arr.length;i++)obj=arr[i],event.phase==WPGMZA.Event.CAPTURING_PHASE&&!obj.useCapture||obj.listener.call(arr[i].thisObject,event)},WPGMZA.events=new WPGMZA.EventDispatcher}),jQuery(function($){WPGMZA.AddressInput=function(element,map){if(!(element instanceof HTMLInputElement))throw new Error("Element is not an instance of HTMLInputElement");var json;this.element=element;var options={fields:["name","formatted_address"],types:["geocode","establishment"]};(json=$(element).attr("data-autocomplete-options"))&&(options=$.extend(options,JSON.parse(json))),map&&map.settings.wpgmza_store_locator_restrict&&(options.country=map.settings.wpgmza_store_locator_restrict),WPGMZA.isGoogleAutocompleteSupported()?"wpgmza_add_address_map_editor"!=this.id&&WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey&&(element.googleAutoComplete=new google.maps.places.Autocomplete(element,options),options.country&&element.googleAutoComplete.setComponentRestrictions({country:options.country})):WPGMZA.CloudAPI&&WPGMZA.CloudAPI.isBeingUsed&&(element.cloudAutoComplete=new WPGMZA.CloudAutocomplete(element,options))},WPGMZA.extend(WPGMZA.AddressInput,WPGMZA.EventDispatcher),WPGMZA.AddressInput.createInstance=function(element,map){return new WPGMZA.AddressInput(element,map)}}),jQuery(function($){WPGMZA.DrawingManager=function(map){WPGMZA.assertInstanceOf(this,"DrawingManager"),WPGMZA.EventDispatcher.call(this),this.map=map,this.mode=WPGMZA.DrawingManager.MODE_NONE},WPGMZA.DrawingManager.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.DrawingManager.prototype.constructor=WPGMZA.DrawingManager,WPGMZA.DrawingManager.MODE_NONE=null,WPGMZA.DrawingManager.MODE_MARKER="marker",WPGMZA.DrawingManager.MODE_POLYGON="polygon",WPGMZA.DrawingManager.MODE_POLYLINE="polyline",WPGMZA.DrawingManager.MODE_CIRCLE="circle",WPGMZA.DrawingManager.MODE_RECTANGLE="rectangle",WPGMZA.DrawingManager.MODE_HEATMAP="heatmap",WPGMZA.DrawingManager.getConstructor=function(){return"google-maps"!==WPGMZA.settings.engine?WPGMZA.OLDrawingManager:WPGMZA.GoogleDrawingManager},WPGMZA.DrawingManager.createInstance=function(map){return new(WPGMZA.DrawingManager.getConstructor())(map)},WPGMZA.DrawingManager.prototype.setDrawingMode=function(mode){this.mode=mode,this.trigger("drawingmodechanged")}}),jQuery(function($){WPGMZA.Event=function(options){if("string"==typeof options&&(this.type=options),this.bubbles=!0,this.cancelable=!0,this.phase=WPGMZA.Event.PHASE_CAPTURE,this.target=null,this._cancelled=!1,"object"==typeof options)for(var name in options)this[name]=options[name]},WPGMZA.Event.CAPTURING_PHASE=0,WPGMZA.Event.AT_TARGET=1,WPGMZA.Event.BUBBLING_PHASE=2,WPGMZA.Event.prototype.stopPropagation=function(){this._cancelled=!0}}),jQuery(function($){WPGMZA.FancyControls={formatToggleSwitch:function(label){var div=$("<div class='switch'></div>"),input=label,container=label.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-round-flat"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)},formatToggleButton:function(label){var div=$("<div class='switch'></div>"),input=label,container=label.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-yes-no"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(label).attr("data-on",WPGMZA.localized_strings.yes),$(label).attr("data-off",WPGMZA.localized_strings.no),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)}},$(".wpgmza-fancy-toggle-switch").each(function(index,el){WPGMZA.FancyControls.formatToggleSwitch(el)}),$(".wpgmza-fancy-toggle-button").each(function(index,el){WPGMZA.FancyControls.formatToggleButton(el)})}),jQuery(function($){WPGMZA.Feature=function(options){for(var key in WPGMZA.assertInstanceOf(this,"Feature"),WPGMZA.EventDispatcher.call(this),this.id=-1,options)this[key]=options[key]},WPGMZA.extend(WPGMZA.Feature,WPGMZA.EventDispatcher),WPGMZA.MapObject=WPGMZA.Feature,WPGMZA.Feature.prototype.parseGeometry=function(subject){if("string"==typeof subject&&subject.match(/^\[/))try{subject=JSON.parse(subject)}catch(e){}if("object"==typeof subject){for(var arr=subject,i=0;i<arr.length;i++)arr[i].lat=parseFloat(arr[i].lat),arr[i].lng=parseFloat(arr[i].lng);return arr}if("string"!=typeof subject)throw new Error("Invalid geometry");for(var coords,results=[],pairs=subject.replace(/[^ ,\d\.\-+e]/g,"").split(","),i=0;i<pairs.length;i++)coords=pairs[i].split(" "),results.push({lat:parseFloat(coords[1]),lng:parseFloat(coords[0])});return results},WPGMZA.Feature.prototype.setOptions=function(options){for(var key in options)this[key]=options[key];this.updateNativeFeature()},WPGMZA.Feature.prototype.setEditable=function(editable){this.setOptions({editable:editable})},WPGMZA.Feature.prototype.setDraggable=function(draggable){this.setOptions({draggable:draggable})},WPGMZA.Feature.prototype.getScalarProperties=function(){var key,options={};for(key in this)switch(typeof this[key]){case"number":options[key]=parseFloat(this[key]);break;case"boolean":case"string":options[key]=this[key]}return options},WPGMZA.Feature.prototype.updateNativeFeature=function(){var props=this.getScalarProperties();"open-layers"===WPGMZA.settings.engine?this.layer&&this.layer.setStyle(WPGMZA.OLFeature.getOLStyle(props)):this.googleFeature.setOptions(props)}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Circle=function(options,engineCircle){WPGMZA.assertInstanceOf(this,"Circle"),this.center=new WPGMZA.LatLng,this.radius=100,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Circle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Circle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeColor",{enumerable:!0,get:function(){return this.lineColor||"#000000"},set:function(a){this.lineColor=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineOpacity||0==this.lineOpacity?parseFloat(this.lineOpacity):0},set:function(a){this.lineOpacity=a}}),WPGMZA.Circle.createInstance=function(options,engineCircle){var constructor="open-layers"===WPGMZA.settings.engine?WPGMZA.OLCircle:WPGMZA.GoogleCircle;return new constructor(options,engineCircle)},WPGMZA.Circle.prototype.getCenter=function(){return this.center.clone()},WPGMZA.Circle.prototype.setCenter=function(latLng){this.center.lat=latLng.lat,this.center.lng=latLng.lng},WPGMZA.Circle.prototype.getRadius=function(){return this.radius},WPGMZA.Circle.prototype.setRadius=function(radius){this.radius=radius},WPGMZA.Circle.prototype.getMap=function(){return this.map},WPGMZA.Circle.prototype.setMap=function(map){this.map&&this.map.removeCircle(this),map&&map.addCircle(this)}}),jQuery(function($){WPGMZA.FriendlyError=function(){}}),jQuery(function($){WPGMZA.Geocoder=function(){WPGMZA.assertInstanceOf(this,"Geocoder")},WPGMZA.Geocoder.SUCCESS="success",WPGMZA.Geocoder.ZERO_RESULTS="zero-results",WPGMZA.Geocoder.FAIL="fail",WPGMZA.Geocoder.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleGeocoder:WPGMZA.OLGeocoder},WPGMZA.Geocoder.createInstance=function(){return new(WPGMZA.Geocoder.getConstructor())},WPGMZA.Geocoder.prototype.getLatLngFromAddress=function(latLng,callback){WPGMZA.isLatLngString(latLng.address)&&(latLng=latLng.address.split(/,\s*/),callback([(latLng=new WPGMZA.LatLng({lat:parseFloat(latLng[0]),lng:parseFloat(latLng[1])})).latLng=latLng],WPGMZA.Geocoder.SUCCESS))},WPGMZA.Geocoder.prototype.getAddressFromLatLng=function(options,callback){callback([new WPGMZA.LatLng(options.latLng).toString()],WPGMZA.Geocoder.SUCCESS)},WPGMZA.Geocoder.prototype.geocode=function(options,callback){if("address"in options)return this.getLatLngFromAddress(options,callback);if("latLng"in options)return this.getAddressFromLatLng(options,callback);throw new Error("You must supply either a latLng or address")}}),jQuery(function($){WPGMZA.GoogleAPIErrorHandler=function(){var _error,self=this;"google-maps"==WPGMZA.settings.engine&&("map-edit"==WPGMZA.currentPage||0==WPGMZA.is_admin&&1==WPGMZA.userCanAdministrator)&&(this.element=$(WPGMZA.html.googleMapsAPIErrorDialog),1==WPGMZA.is_admin&&this.element.find(".wpgmza-front-end-only").remove(),this.errorMessageList=this.element.find(".wpgmza-google-api-error-list"),this.templateListItem=this.element.find("li.template").remove(),this.messagesAlreadyDisplayed={},_error=console.error,console.error=function(message){self.onErrorMessage(message),_error.apply(this,arguments)},"google-maps"!=WPGMZA.settings.engine||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT||this.addErrorMessage(WPGMZA.localized_strings.no_google_maps_api_key,["https://www.wpgmaps.com/documentation/creating-a-google-maps-api-key/"]))},WPGMZA.GoogleAPIErrorHandler.prototype.onErrorMessage=function(message){var m,urls;message&&((m=message.match(/You have exceeded your (daily )?request quota for this API/))||(m=message.match(/This API project is not authorized to use this API/))||(m=message.match(/^Geocoding Service: .+/))?(urls=message.match(/http(s)?:\/\/[^\s]+/gm),this.addErrorMessage(m[0],urls)):(m=message.match(/^Google Maps.+error: (.+)\s+(http(s?):\/\/.+)/m))&&this.addErrorMessage(m[1].replace(/([A-Z])/g," $1"),[m[2]]))},WPGMZA.GoogleAPIErrorHandler.prototype.addErrorMessage=function(message,urls){var self=this;if(!this.messagesAlreadyDisplayed[message]){var li=this.templateListItem.clone();$(li).find(".wpgmza-message").html(message);var buttonContainer=$(li).find(".wpgmza-documentation-buttons"),buttonTemplate=$(li).find(".wpgmza-documentation-buttons>a");if(buttonTemplate.remove(),urls&&urls.length){for(var i=0;i<urls.length;i++){urls[i];var button=buttonTemplate.clone(),text=WPGMZA.localized_strings.documentation;button.attr("href",urls[i]),$(button).find("i").addClass("fa-external-link"),$(button).append(text)}buttonContainer.append(button)}$(this.errorMessageList).append(li),$("#wpgmza_map, .wpgmza_map").each(function(index,el){var container=$(el).find(".wpgmza-google-maps-api-error-overlay");0==container.length&&(container=$("<div class='wpgmza-google-maps-api-error-overlay'></div>")).html(self.element.html()),setTimeout(function(){$(el).append(container)},1e3)}),$(".gm-err-container").parent().css({"z-index":1}),this.messagesAlreadyDisplayed[message]=!0}},WPGMZA.googleAPIErrorHandler=new WPGMZA.GoogleAPIErrorHandler}),jQuery(function($){WPGMZA.InfoWindow=function(feature){var self=this;WPGMZA.EventDispatcher.call(this),WPGMZA.assertInstanceOf(this,"InfoWindow"),this.on("infowindowopen",function(event){self.onOpen(event)}),feature&&(this.feature=feature,this.state=WPGMZA.InfoWindow.STATE_CLOSED,feature.map?setTimeout(function(){self.onFeatureAdded(event)},100):feature.addEventListener("added",function(event){self.onFeatureAdded(event)}))},WPGMZA.InfoWindow.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.InfoWindow.prototype.constructor=WPGMZA.InfoWindow,WPGMZA.InfoWindow.OPEN_BY_CLICK=1,WPGMZA.InfoWindow.OPEN_BY_HOVER=2,WPGMZA.InfoWindow.STATE_OPEN="open",WPGMZA.InfoWindow.STATE_CLOSED="closed",WPGMZA.InfoWindow.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProInfoWindow:WPGMZA.GoogleInfoWindow:WPGMZA.isProVersion()?WPGMZA.OLProInfoWindow:WPGMZA.OLInfoWindow},WPGMZA.InfoWindow.createInstance=function(feature){return new(this.getConstructor())(feature)},Object.defineProperty(WPGMZA.InfoWindow.prototype,"content",{get:function(){return this.getContent()},set:function(value){this.contentHtml=value}}),WPGMZA.InfoWindow.prototype.addEditButton=function(){return"map-edit"==WPGMZA.currentPage&&this.feature instanceof WPGMZA.Marker?' <a title="Edit this marker" style="width:15px;" class="wpgmza_edit_btn" data-edit-marker-id="'+this.feature.id+'"><i class="fa fa-edit"></i></a>':""},WPGMZA.InfoWindow.prototype.workOutDistanceBetweenTwoMarkers=function(location1,distanceToDisplay){if(location1&&distanceToDisplay){distanceToDisplay=WPGMZA.Distance.between(location1,distanceToDisplay);return this.distanceUnits==WPGMZA.Distance.MILES&&(distanceToDisplay/=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(distanceToDisplay,2)}},WPGMZA.InfoWindow.prototype.getContent=function(callback){var distance,html="",extra_html="";return this.feature instanceof WPGMZA.Marker&&(this.feature.map.settings.store_locator_show_distance&&this.feature.map.storeLocator&&this.feature.map.storeLocator.state==WPGMZA.StoreLocator.STATE_APPLIED&&(distance=this.feature.getPosition(),distance=this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center,distance),extra_html+="<p>"+(this.feature.map.settings.store_locator_distance==WPGMZA.Distance.KILOMETERS?distance+WPGMZA.localized_strings.kilometers_away:distance+" "+WPGMZA.localized_strings.miles_away)+"</p>"),html=this.feature.address+extra_html),this.contentHtml&&(html=this.contentHtml),callback&&callback(html),html},WPGMZA.InfoWindow.prototype.open=function(map,feature){return this.feature=feature,!WPGMZA.settings.disable_infowindows&&"1"!=WPGMZA.settings.wpgmza_settings_disable_infowindows&&(!this.feature.disableInfoWindow&&(this.state=WPGMZA.InfoWindow.STATE_OPEN,!0))},WPGMZA.InfoWindow.prototype.close=function(){this.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(this.state=WPGMZA.InfoWindow.STATE_CLOSED,this.trigger("infowindowclose"))},WPGMZA.InfoWindow.prototype.setContent=function(options){},WPGMZA.InfoWindow.prototype.setOptions=function(options){},WPGMZA.InfoWindow.prototype.onFeatureAdded=function(){1==this.feature.settings.infoopen&&this.open()},WPGMZA.InfoWindow.prototype.onOpen=function(){}}),jQuery(function($){WPGMZA.LatLng=function(arg,lng){if(this._lat=0,(this._lng=0)!=arguments.length)if(1==arguments.length){if("string"==typeof arg){var m;if(!(m=arg.match(WPGMZA.LatLng.REGEXP)))throw new Error("Invalid LatLng string");arg={lat:m[1],lng:m[3]}}if("object"!=typeof arg||!("lat"in arg&&"lng"in arg))throw new Error("Argument must be a LatLng literal");this.lat=arg.lat,this.lng=arg.lng}else this.lat=arg,this.lng=lng},WPGMZA.LatLng.REGEXP=/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,WPGMZA.LatLng.isValid=function(obj){return"object"==typeof obj&&("lat"in obj&&"lng"in obj)},WPGMZA.LatLng.isLatLngString=function(str){return"string"==typeof str&&!!str.match(WPGMZA.LatLng.REGEXP)},Object.defineProperty(WPGMZA.LatLng.prototype,"lat",{get:function(){return this._lat},set:function(val){if(!$.isNumeric(val))throw new Error("Latitude must be numeric");this._lat=parseFloat(val)}}),Object.defineProperty(WPGMZA.LatLng.prototype,"lng",{get:function(){return this._lng},set:function(val){if(!$.isNumeric(val))throw new Error("Longitude must be numeric");this._lng=parseFloat(val)}}),WPGMZA.LatLng.fromString=function(m){if(!WPGMZA.LatLng.isLatLngString(m))throw new Error("Not a valid latlng string");m=m.match(WPGMZA.LatLng.REGEXP);return new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])})},WPGMZA.LatLng.prototype.toString=function(){return this._lat+", "+this._lng},WPGMZA.LatLng.fromCurrentPosition=function(callback,options){options=options||{},callback&&WPGMZA.getCurrentPosition(function(position){var latLng=new WPGMZA.LatLng({lat:position.coords.latitude,lng:position.coords.longitude});options.geocodeAddress?WPGMZA.Geocoder.createInstance().getAddressFromLatLng({latLng:latLng},function(results){results.length&&(latLng.address=results[0]),callback(latLng)}):callback(latLng)})},WPGMZA.LatLng.fromGoogleLatLng=function(googleLatLng){return new WPGMZA.LatLng(googleLatLng.lat(),googleLatLng.lng())},WPGMZA.LatLng.toGoogleLatLngArray=function(arr){var result=[];return arr.forEach(function(nativeLatLng){if(!(nativeLatLng instanceof WPGMZA.LatLng||"lat"in nativeLatLng&&"lng"in nativeLatLng))throw new Error("Unexpected input");result.push(new google.maps.LatLng({lat:parseFloat(nativeLatLng.lat),lng:parseFloat(nativeLatLng.lng)}))}),result},WPGMZA.LatLng.prototype.toGoogleLatLng=function(){return new google.maps.LatLng({lat:this.lat,lng:this.lng})},WPGMZA.LatLng.prototype.toLatLngLiteral=function(){return{lat:this.lat,lng:this.lng}},WPGMZA.LatLng.prototype.moveByDistance=function(sinDelta,cosDelta){var lambda2=parseFloat(sinDelta)/6371,phi2=parseFloat(cosDelta)/180*Math.PI,sinTheta=this.lat/180*Math.PI,lambda1=this.lng/180*Math.PI,sinPhi1=Math.sin(sinTheta),y=Math.cos(sinTheta),sinDelta=Math.sin(lambda2),cosDelta=Math.cos(lambda2),sinTheta=Math.sin(phi2),lambda2=sinPhi1*cosDelta+y*sinDelta*Math.cos(phi2),phi2=Math.asin(lambda2),y=sinTheta*sinDelta*y,lambda2=cosDelta-sinPhi1*lambda2,lambda2=lambda1+Math.atan2(y,lambda2);this.lat=180*phi2/Math.PI,this.lng=180*lambda2/Math.PI},WPGMZA.LatLng.prototype.getGreatCircleDistance=function(arg1,arg2){var deltaPhi=this.lat,a=this.lng;if(1==arguments.length)phi2=new WPGMZA.LatLng(arg1);else{if(2!=arguments.length)throw new Error("Invalid number of arguments");phi2=new WPGMZA.LatLng(arg1,arg2)}var lat2=phi2.lat,lon2=phi2.lng,phi1=deltaPhi.toRadians(),phi2=lat2.toRadians(),deltaPhi=(lat2-deltaPhi).toRadians(),a=(lon2-a).toRadians(),a=Math.sin(deltaPhi/2)*Math.sin(deltaPhi/2)+Math.cos(phi1)*Math.cos(phi2)*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}),jQuery(function($){WPGMZA.LatLngBounds=function(southWest,northEast){var other;southWest instanceof WPGMZA.LatLngBounds?(other=southWest,this.south=other.south,this.north=other.north,this.west=other.west,this.east=other.east):southWest&&northEast&&(this.south=southWest.lat,this.north=northEast.lat,this.west=southWest.lng,this.east=northEast.lng)},WPGMZA.LatLngBounds.fromGoogleLatLngBounds=function(northEast){if(!(northEast instanceof google.maps.LatLngBounds))throw new Error("Argument must be an instance of google.maps.LatLngBounds");var result=new WPGMZA.LatLngBounds,southWest=northEast.getSouthWest(),northEast=northEast.getNorthEast();return result.north=northEast.lat(),result.south=southWest.lat(),result.west=southWest.lng(),result.east=northEast.lng(),result},WPGMZA.LatLngBounds.fromGoogleLatLngBoundsLiteral=function(northEast){var result=new WPGMZA.LatLngBounds,southWest=northEast.southwest,northEast=northEast.northeast;return result.north=northEast.lat,result.south=southWest.lat,result.west=southWest.lng,result.east=northEast.lng,result},WPGMZA.LatLngBounds.prototype.isInInitialState=function(){return null==this.north&&null==this.south&&null==this.west&&null==this.east},WPGMZA.LatLngBounds.prototype.extend=function(latLng){if(latLng instanceof WPGMZA.LatLng||(latLng=new WPGMZA.LatLng(latLng)),this.isInInitialState())return this.north=this.south=latLng.lat,void(this.west=this.east=latLng.lng);latLng.lat<this.north&&(this.north=latLng.lat),latLng.lat>this.south&&(this.south=latLng.lat),latLng.lng<this.west&&(this.west=latLng.lng),latLng.lng>this.east&&(this.east=latLng.lng)},WPGMZA.LatLngBounds.prototype.extendByPixelMargin=function(map,x,arg){var y=x;if(!(map instanceof WPGMZA.Map))throw new Error("First argument must be an instance of WPGMZA.Map");if(this.isInInitialState())throw new Error("Cannot extend by pixels in initial state");3<=arguments.length&&(y=arg);var southWest=new WPGMZA.LatLng(this.south,this.west),northEast=new WPGMZA.LatLng(this.north,this.east),southWest=map.latLngToPixels(southWest),northEast=map.latLngToPixels(northEast);southWest.x-=x,southWest.y+=y,northEast.x+=x,northEast.y-=y,southWest=map.pixelsToLatLng(southWest.x,southWest.y),northEast=map.pixelsToLatLng(northEast.x,northEast.y);this.toString();this.north=northEast.lat,this.south=southWest.lat,this.west=southWest.lng,this.east=northEast.lng},WPGMZA.LatLngBounds.prototype.contains=function(latLng){if(!(latLng instanceof WPGMZA.LatLng))throw new Error("Argument must be an instance of WPGMZA.LatLng");return!(latLng.lat<Math.min(this.north,this.south))&&(!(latLng.lat>Math.max(this.north,this.south))&&(this.west<this.east?latLng.lng>=this.west&&latLng.lng<=this.east:latLng.lng<=this.west||latLng.lng>=this.east))},WPGMZA.LatLngBounds.prototype.toString=function(){return this.north+"N "+this.south+"S "+this.west+"W "+this.east+"E"},WPGMZA.LatLngBounds.prototype.toLiteral=function(){return{north:this.north,south:this.south,west:this.west,east:this.east}}}),jQuery(function($){var key,legacyGlobals={marker_pull:"0",marker_array:[],MYMAP:[],infoWindow_poly:[],markerClusterer:[],heatmap:[],WPGM_Path:[],WPGM_Path_Polygon:[],WPGM_PathLine:[],WPGM_PathLineData:[],WPGM_PathData:[],original_iw:null,wpgmza_user_marker:null,wpgmaps_localize_marker_data:[],wpgmaps_localize_polygon_settings:[],wpgmaps_localize_heatmap_settings:[],wpgmaps_localize_polyline_settings:[],wpgmza_cirtcle_data_array:[],wpgmza_rectangle_data_array:[],wpgmzaForceLegacyMarkerClusterer:!1};for(key in legacyGlobals)!function(key){key in window?console.warn("Cannot redefine legacy global "+key):Object.defineProperty(window,key,{get:function(){return console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]},set:function(value){console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]=value}})}(key);WPGMZA.legacyGlobals=legacyGlobals,window.InitMap=window.resetLocations=window.searchLocations=window.fillInAddress=window.searchLocationsNear=function(){console.warn("This function is deprecated and should no longer be used")}}),jQuery(function($){WPGMZA.MapListPage=function(){$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand ("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")})},WPGMZA.MapListPage.createInstance=function(){return new WPGMZA.MapListPage},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_LIST&&(WPGMZA.mapListPage=WPGMZA.MapListPage.createInstance())})}),jQuery(function($){WPGMZA.MapSettings=function(element){var json,self=this,str=element.getAttribute("data-settings");try{json=JSON.parse(str)}catch(e){str=(str=str.replace(/\\%/g,"%")).replace(/\\\\"/g,'\\"');try{json=JSON.parse(str)}catch(e){json={},console.warn("Failed to parse map settings JSON")}}function addSettings(input){if(input)for(var key in input){var value;"other_settings"!=key&&(value=input[key],String(value).match(/^-?\d+$/)&&(value=parseInt(value)),self[key]=value)}}WPGMZA.assertInstanceOf(this,"MapSettings"),addSettings(WPGMZA.settings),addSettings(json),json&&json.other_settings&&addSettings(json.other_settings)},WPGMZA.MapSettings.prototype.toOLViewOptions=function(){var coords,self=this,options={center:ol.proj.fromLonLat([-119.4179,36.7783]),zoom:4};function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}return"string"==typeof this.start_location&&(coords=this.start_location.replace(/^\(|\)$/g,"").split(","),WPGMZA.isLatLngString(this.start_location)?options.center=ol.proj.fromLonLat([parseFloat(coords[1]),parseFloat(coords[0])]):console.warn("Invalid start location")),this.center&&(options.center=ol.proj.fromLonLat([parseFloat(this.center.lng),parseFloat(this.center.lat)])),empty("map_start_lat")||empty("map_start_lng")||(options.center=ol.proj.fromLonLat([parseFloat(this.map_start_lng),parseFloat(this.map_start_lat)])),this.zoom&&(options.zoom=parseInt(this.zoom)),this.start_zoom&&(options.zoom=parseInt(this.start_zoom)),this.map_start_zoom&&(options.zoom=parseInt(this.map_start_zoom)),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options},WPGMZA.MapSettings.prototype.toGoogleMapsOptions=function(){var self=this,zoom=this.start_location&&this.start_location.length?this.start_location.split(","):[36.7783,-119.4179];function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}function formatCoord(coord){return $.isNumeric(coord)?coord:parseFloat(String(coord).replace(/[\(\)\s]/,""))}var latLng=new google.maps.LatLng(formatCoord(zoom[0]),formatCoord(zoom[1])),zoom=this.start_zoom?parseInt(this.start_zoom):4;!this.start_zoom&&this.zoom&&(zoom=parseInt(this.zoom)),this.map_start_zoom&&(zoom=parseInt(this.map_start_zoom));var options={zoom:zoom,center:latLng};function isSettingDisabled(value){return"yes"===value||!!value}switch(empty("center")||(options.center=new google.maps.LatLng({lat:parseFloat(this.center.lat),lng:parseFloat(this.center.lng)})),empty("map_start_lat")||empty("map_start_lng")||(options.center=new google.maps.LatLng({lat:parseFloat(this.map_start_lat),lng:parseFloat(this.map_start_lng)})),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options.zoomControl=!isSettingDisabled(this.wpgmza_settings_map_zoom),options.panControl=!isSettingDisabled(this.wpgmza_settings_map_pan),options.mapTypeControl=!isSettingDisabled(this.wpgmza_settings_map_type),options.streetViewControl=!isSettingDisabled(this.wpgmza_settings_map_streetview),options.fullscreenControl=!isSettingDisabled(this.wpgmza_settings_map_full_screen_control),options.draggable=!isSettingDisabled(this.wpgmza_settings_map_draggable),options.disableDoubleClickZoom=isSettingDisabled(this.wpgmza_settings_map_clickzoom),isSettingDisabled(this.wpgmza_settings_map_tilt_controls)&&(options.rotateControl=!1,options.tilt=0),this.wpgmza_settings_map_scroll&&(options.scrollwheel=!1),"greedy"==this.wpgmza_force_greedy_gestures||"yes"==this.wpgmza_force_greedy_gestures||1==this.wpgmza_force_greedy_gestures?(options.gestureHandling="greedy",!this.wpgmza_settings_map_scroll&&"scrollwheel"in options&&delete options.scrollwheel):options.gestureHandling="cooperative",parseInt(this.type)){case 2:options.mapTypeId=google.maps.MapTypeId.SATELLITE;break;case 3:options.mapTypeId=google.maps.MapTypeId.HYBRID;break;case 4:options.mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:options.mapTypeId=google.maps.MapTypeId.ROADMAP}return this.wpgmza_theme_data&&this.wpgmza_theme_data.length&&(options.styles=WPGMZA.GoogleMap.parseThemeData(this.wpgmza_theme_data)),options}}),jQuery(function($){WPGMZA.Map=function(element,options){var self=this;if(WPGMZA.assertInstanceOf(this,"Map"),WPGMZA.EventDispatcher.call(this),!(element instanceof HTMLElement||window.elementor))throw new Error("Argument must be a HTMLElement");if(element.hasAttribute("data-map-id")?this.id=element.getAttribute("data-map-id"):this.id=1,!/\d+/.test(this.id))throw new Error("Map ID must be an integer");if(WPGMZA.maps.push(this),this.element=element,this.element.wpgmzaMap=this,$(this.element).addClass("wpgmza-initialized"),this.engineElement=element,this.markers=[],this.polygons=[],this.polylines=[],this.circles=[],this.rectangles=[],WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code)return $(element).append($(WPGMZA.api_consent_html)),void $(element).css({height:"auto"});if(this.loadSettings(options),this.shortcodeAttributes={},$(this.element).attr("data-shortcode-attributes"))try{this.shortcodeAttributes=JSON.parse($(this.element).attr("data-shortcode-attributes")),this.shortcodeAttributes.zoom&&(this.settings.map_start_zoom=parseInt(this.shortcodeAttributes.zoom))}catch(e){console.warn("Error parsing shortcode attributes")}WPGMZA.getCurrentPage()!=WPGMZA.PAGE_MAP_EDIT&&this.initStoreLocator(),this.setDimensions(),this.setAlignment(),this.markerFilter=WPGMZA.MarkerFilter.createInstance(this),this.on("init",function(event){self.onInit(event)}),this.on("click",function(event){self.onClick(event)}),WPGMZA.useLegacyGlobals&&(wpgmzaLegacyGlobals.MYMAP[this.id]={map:null,bounds:null,mc:null},wpgmzaLegacyGlobals.MYMAP.init=wpgmzaLegacyGlobals.MYMAP[this.id].init=wpgmzaLegacyGlobals.MYMAP.placeMarkers=wpgmzaLegacyGlobals.MYMAP[this.id].placeMarkers=function(){console.warn("This function is deprecated and should no longer be used")})},WPGMZA.Map.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.Map.prototype.constructor=WPGMZA.Map,WPGMZA.Map.nightTimeThemeData=[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"landscape",elementType:"geometry.fill",stylers:[{color:"#575663"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#80823e"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#1b737a"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}],WPGMZA.Map.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProMap:WPGMZA.GoogleMap:WPGMZA.isProVersion()?WPGMZA.OLProMap:WPGMZA.OLMap},WPGMZA.Map.createInstance=function(element,options){return new(WPGMZA.Map.getConstructor())(element,options)},Object.defineProperty(WPGMZA.Map.prototype,"markersPlaced",{get:function(){return this._markersPlaced},set:function(value){throw new Error("Value is read only")}}),Object.defineProperty(WPGMZA.Map.prototype,"lat",{get:function(){return this.getCenter().lat},set:function(value){var center=this.getCenter();center.lat=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"lng",{get:function(){return this.getCenter().lng},set:function(value){var center=this.getCenter();center.lng=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"zoom",{get:function(){return this.getZoom()},set:function(value){this.setZoom(value)}}),WPGMZA.Map.prototype.onInit=function(event){this.initPreloader(),"autoFetchFeatures"in this.settings&&!1===this.settings.autoFetchFeatures||this.fetchFeatures()},WPGMZA.Map.prototype.initPreloader=function(){this.preloader=$(WPGMZA.preloaderHTML),$(this.preloader).hide(),$(this.element).append(this.preloader)},WPGMZA.Map.prototype.showPreloader=function(show){show?$(this.preloader).show():$(this.preloader).hide()},WPGMZA.Map.prototype.loadSettings=function(options){var settings=new WPGMZA.MapSettings(this.element);settings.other_settings;if(delete settings.other_settings,options)for(var key in options)settings[key]=options[key];this.settings=settings},WPGMZA.Map.prototype.initStoreLocator=function(){var storeLocatorElement=$(".wpgmza_sl_main_div");storeLocatorElement.length&&(this.storeLocator=WPGMZA.StoreLocator.createInstance(this,storeLocatorElement[0]))},WPGMZA.Map.prototype.getFeatureArrays=function(){var arrays=WPGMZA.Map.prototype.getFeatureArrays.call(this);return arrays.heatmaps=this.heatmaps,arrays},WPGMZA.Map.prototype.setOptions=function(options){for(var name in options)this.settings[name]=options[name]},WPGMZA.Map.prototype.getRESTParameters=function(options){var defaults={};return options&&options.filter||(defaults.filter=JSON.stringify(this.markerFilter.getFilteringParameters())),$.extend(!0,defaults,options)},WPGMZA.Map.prototype.fetchFeaturesViaREST=function(){var data,offset,limit,self=this,filter=this.markerFilter.getFilteringParameters();"1"==WPGMZA.is_admin&&(filter.includeUnapproved=!0,filter.excludeIntegrated=!0),this.shortcodeAttributes.acf_post_id&&(filter.acfPostID=this.shortcodeAttributes.acf_post_id),this.showPreloader(!0),this.fetchFeaturesXhr&&this.fetchFeaturesXhr.abort(),WPGMZA.settings.fetchMarkersBatchSize?(offset=0,limit=WPGMZA.settings.fetchMarkersBatchSize,function fetchNextBatch(){filter.offset=offset,filter.limit=limit,data=self.getRESTParameters({filter:JSON.stringify(filter)}),self.fetchFeaturesXhr=WPGMZA.restAPI.call("/markers/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){result.length?(self.onMarkersFetched(result,!0),offset+=limit,fetchNextBatch()):(self.onMarkersFetched(result),data.exclude="markers",WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}}))}})}()):(data=this.getRESTParameters({filter:JSON.stringify(filter)}),this.fetchFeaturesXhr=WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}}))},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var data={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(data),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var worker=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),worker=new Blob([worker],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(worker));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){for(var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']"),i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){for(var arr=this.shortcodeAttributes.markers.split(","),markers=[],i=0;i<arr.length;i++){var id=(id=arr[i]).replace(" ",""),marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var data={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(data),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var worker=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),worker=new Blob([worker],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(worker));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){for(var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']"),i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){for(var arr=this.shortcodeAttributes.markers.split(","),markers=[],i=0;i<arr.length;i++){var id=(id=arr[i]).replace(" ",""),marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}};Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Map.getGeographicDistance=function(lat1,a,lat2,lon2){var dLat=deg2rad(lat2-lat1),a=deg2rad(lon2-a),a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))},WPGMZA.Map.prototype.setCenter=function(latLng){if(!("lat"in latLng&&"lng"in latLng))throw new Error("Argument is not an object with lat and lng")},WPGMZA.Map.prototype.setDimensions=function(width,height){0==arguments.length&&(width=this.settings.map_width||"100",this.settings.map_width_type?width+=this.settings.map_width_type.replace("\\",""):width+="%",height=this.settings.map_height||"400",this.settings.map_height_type?height+=this.settings.map_height_type.replace("\\",""):height+="px"),$(this.engineElement).css({width:width,height:height})},WPGMZA.Map.prototype.setAlignment=function(){switch(parseInt(this.settings.wpgmza_map_align)){case 1:$(this.element).css({float:"left"});break;case 2:$(this.element).css({"margin-left":"auto","margin-right":"auto"});break;case 3:$(this.element).css({float:"right"})}},WPGMZA.Map.prototype.addMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");marker.map=this,(marker.parent=this).markers.push(marker),this.dispatchEvent({type:"markeradded",marker:marker}),marker.dispatchEvent({type:"added"})},WPGMZA.Map.prototype.removeMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");if(marker.map!==this)throw new Error("Wrong map error");marker.infoWindow&&marker.infoWindow.close(),marker.map=null,marker.parent=null;var index=this.markers.indexOf(marker);if(-1==index)throw new Error("Marker not found in marker array");this.markers.splice(index,1),this.dispatchEvent({type:"markerremoved",marker:marker}),marker.dispatchEvent({type:"removed"})},WPGMZA.Map.prototype.removeAllMarkers=function(options){for(var i=this.markers.length-1;0<=i;i--)this.removeMarker(this.markers[i])},WPGMZA.Map.prototype.getMarkerByID=function(id){for(var i=0;i<this.markers.length;i++)if(this.markers[i].id==id)return this.markers[i];return null},WPGMZA.Map.prototype.getMarkerByTitle=function(title){if("string"==typeof title){for(var i=0;i<this.markers.length;i++)if(this.markers[i].title==title)return this.markers[i]}else{if(!(title instanceof RegExp))throw new Error("Invalid argument");for(i=0;i<this.markers.length;i++)if(title.test(this.markers[i].title))return this.markers[i]}return null},WPGMZA.Map.prototype.removeMarkerByID=function(marker){marker=this.getMarkerByID(marker);marker&&this.removeMarker(marker)},WPGMZA.Map.prototype.addPolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");(polygon.map=this).polygons.push(polygon),this.dispatchEvent({type:"polygonadded",polygon:polygon})},WPGMZA.Map.prototype.removePolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");if(polygon.map!==this)throw new Error("Wrong map error");polygon.map=null,this.polygons.splice(this.polygons.indexOf(polygon),1),this.dispatchEvent({type:"polygonremoved",polygon:polygon})},WPGMZA.Map.prototype.getPolygonByID=function(id){for(var i=0;i<this.polygons.length;i++)if(this.polygons[i].id==id)return this.polygons[i];return null},WPGMZA.Map.prototype.removePolygonByID=function(polygon){polygon=this.getPolygonByID(polygon);polygon&&this.removePolygon(polygon)},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.addPolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");(polyline.map=this).polylines.push(polyline),this.dispatchEvent({type:"polylineadded",polyline:polyline})},WPGMZA.Map.prototype.removePolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");if(polyline.map!==this)throw new Error("Wrong map error");polyline.map=null,this.polylines.splice(this.polylines.indexOf(polyline),1),this.dispatchEvent({type:"polylineremoved",polyline:polyline})},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.removePolylineByID=function(polyline){polyline=this.getPolylineByID(polyline);polyline&&this.removePolyline(polyline)},WPGMZA.Map.prototype.addCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");(circle.map=this).circles.push(circle),this.dispatchEvent({type:"circleadded",circle:circle})},WPGMZA.Map.prototype.removeCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");if(circle.map!==this)throw new Error("Wrong map error");circle.map=null,this.circles.splice(this.circles.indexOf(circle),1),this.dispatchEvent({type:"circleremoved",circle:circle})},WPGMZA.Map.prototype.getCircleByID=function(id){for(var i=0;i<this.circles.length;i++)if(this.circles[i].id==id)return this.circles[i];return null},WPGMZA.Map.prototype.removeCircleByID=function(circle){circle=this.getCircleByID(circle);circle&&this.removeCircle(circle)},WPGMZA.Map.prototype.addRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");(rectangle.map=this).rectangles.push(rectangle),this.dispatchEvent({type:"rectangleadded",rectangle:rectangle})},WPGMZA.Map.prototype.removeRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");if(rectangle.map!==this)throw new Error("Wrong map error");rectangle.map=null,this.rectangles.splice(this.rectangles.indexOf(rectangle),1),this.dispatchEvent({type:"rectangleremoved",rectangle:rectangle})},WPGMZA.Map.prototype.getRectangleByID=function(id){for(var i=0;i<this.rectangles.length;i++)if(this.rectangles[i].id==id)return this.rectangles[i];return null},WPGMZA.Map.prototype.removeRectangleByID=function(rectangle){rectangle=this.getRectangleByID(rectangle);rectangle&&this.removeRectangle(rectangle)},WPGMZA.Map.prototype.resetBounds=function(){var latlng=new WPGMZA.LatLng(this.settings.map_start_lat,this.settings.map_start_lng);this.panTo(latlng),this.setZoom(this.settings.map_start_zoom)},WPGMZA.Map.prototype.nudge=function(x,nudged){nudged=this.nudgeLatLng(this.getCenter(),x,nudged);this.setCenter(nudged)},WPGMZA.Map.prototype.nudgeLatLng=function(pixels,x,y){pixels=this.latLngToPixels(pixels);if(pixels.x+=parseFloat(x),pixels.y+=parseFloat(y),isNaN(pixels.x)||isNaN(pixels.y))throw new Error("Invalid coordinates supplied");return this.pixelsToLatLng(pixels)},WPGMZA.Map.prototype.animateNudge=function(x,nudged,origin,milliseconds){if(origin){if(!(origin instanceof WPGMZA.LatLng))throw new Error("Origin must be an instance of WPGMZA.LatLng")}else origin=this.getCenter();nudged=this.nudgeLatLng(origin,x,nudged),milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$(this).animate({lat:nudged.lat,lng:nudged.lng},milliseconds)},WPGMZA.Map.prototype.onWindowResize=function(event){},WPGMZA.Map.prototype.onElementResized=function(event){},WPGMZA.Map.prototype.onBoundsChanged=function(event){this.trigger("boundschanged"),this.trigger("bounds_changed")},WPGMZA.Map.prototype.onIdle=function(event){this.trigger("idle")},WPGMZA.Map.prototype.onClick=function(event){},WPGMZA.Map.prototype.hasVisibleMarkers=function(){for(var marker,length=this.markers.length,i=0;i<length;i++)if((marker=this.markers[i]).isFilterable&&marker.getVisible())return!0;return!1},WPGMZA.Map.prototype.closeAllInfoWindows=function(){this.markers.forEach(function(marker){marker.infoWindow&&marker.infoWindow.close()})},$(document).ready(function(event){var invisibleMaps;WPGMZA.visibilityWorkaroundIntervalID||(invisibleMaps=jQuery(".wpgmza_map:hidden"),WPGMZA.visibilityWorkaroundIntervalID=setInterval(function(){jQuery(invisibleMaps).each(function(index,el){var id;jQuery(el).is(":visible")&&(id=jQuery(el).attr("data-map-id"),WPGMZA.getMapByID(id).onElementResized(),invisibleMaps.splice(invisibleMaps.toArray().indexOf(el),1))})},1e3))})}),jQuery(function($){WPGMZA.MapsEngineDialog=function(element){var self=this;this.element=element,window.wpgmzaUnbindSaveReminder&&window.wpgmzaUnbindSaveReminder(),$(element).show(),$(element).remodal().open(),$(element).find("input:radio").on("change",function(event){$("#wpgmza-confirm-engine").prop("disabled",!1),$("#wpgmza-confirm-engine").click()}),$("#wpgmza-confirm-engine").on("click",function(event){self.onButtonClicked(event)})},WPGMZA.MapsEngineDialog.prototype.onButtonClicked=function(event){$(event.target).prop("disabled",!0),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_engine_dialog_set_engine",engine:$("[name='wpgmza_maps_engine']:checked").val(),nonce:$("#wpgmza-maps-engine-dialog").attr("data-ajax-nonce")},success:function(response,status,xhr){window.location.reload()}})},$(document).ready(function(event){var element=$("#wpgmza-maps-engine-dialog");element.length&&(WPGMZA.settings.wpgmza_maps_engine_dialog_done||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||(WPGMZA.mapsEngineDialog=new WPGMZA.MapsEngineDialog(element)))})}),jQuery(function($){WPGMZA.MarkerFilter=function(map){WPGMZA.EventDispatcher.call(this),this.map=map},WPGMZA.MarkerFilter.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.MarkerFilter.prototype.constructor=WPGMZA.MarkerFilter,WPGMZA.MarkerFilter.createInstance=function(map){return new WPGMZA.MarkerFilter(map)},WPGMZA.MarkerFilter.prototype.getFilteringParameters=function(){var params={map_id:this.map.id};return this.map.storeLocator&&(params=$.extend(params,this.map.storeLocator.getFilteringParameters())),params},WPGMZA.MarkerFilter.prototype.update=function(params,source){var self=this;function dispatchEvent(result){var event=new WPGMZA.Event("filteringcomplete");event.map=self.map,event.source=source,event.filteredMarkers=result,event.filteringParams=params,self.onFilteringComplete(event),self.trigger(event),self.map.trigger(event)}this.updateTimeoutID||(params=params||{},this.xhr&&(this.xhr.abort(),delete this.xhr),this.updateTimeoutID=setTimeout(function(){return(params=$.extend(self.getFilteringParameters(),params)).center instanceof WPGMZA.LatLng&&(params.center=params.center.toLatLngLiteral()),params.hideAll?dispatchEvent([]):(self.map.showPreloader(!0),self.xhr=WPGMZA.restAPI.call("/markers",{data:{fields:["id"],filter:JSON.stringify(params)},success:function(result,status,xhr){self.map.showPreloader(!1),dispatchEvent(result)},useCompressedPathVariable:!0})),void delete self.updateTimeoutID},0))},WPGMZA.MarkerFilter.prototype.onFilteringComplete=function(event){var map=[];event.filteredMarkers.forEach(function(data){map[data.id]=!0}),this.map.markers.forEach(function(marker){var allowByFilter;marker.isFilterable&&(allowByFilter=!!map[marker.id],marker.isFiltered=!allowByFilter,marker.setVisible(allowByFilter))})}}),jQuery(function($){WPGMZA.Marker=function(row){var self=this;this._offset={x:0,y:0},WPGMZA.assertInstanceOf(this,"Marker"),this.lat="36.778261",this.lng="-119.4179323999",this.address="California",this.title=null,this.description="",this.link="",this.icon="",this.approved=1,this.pic=null,this.isFilterable=!0,this.disableInfoWindow=!1,WPGMZA.Feature.apply(this,arguments),row&&row.heatmap||(row&&this.on("init",function(event){row.position&&this.setPosition(row.position),row.map&&row.map.addMarker(this)}),this.addEventListener("added",function(event){self.onAdded(event)}),this.handleLegacyGlobals(row))},WPGMZA.Marker.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Marker.prototype.constructor=WPGMZA.Marker,WPGMZA.Marker.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProMarker:WPGMZA.GoogleMarker:WPGMZA.isProVersion()?WPGMZA.OLProMarker:WPGMZA.OLMarker},WPGMZA.Marker.createInstance=function(row){return new(WPGMZA.Marker.getConstructor())(row)},WPGMZA.Marker.ANIMATION_NONE="0",WPGMZA.Marker.ANIMATION_BOUNCE="1",WPGMZA.Marker.ANIMATION_DROP="2",Object.defineProperty(WPGMZA.Marker.prototype,"offsetX",{get:function(){return this._offset.x},set:function(value){this._offset.x=value,this.updateOffset()}}),Object.defineProperty(WPGMZA.Marker.prototype,"offsetY",{get:function(){return this._offset.y},set:function(value){this._offset.y=value,this.updateOffset()}}),WPGMZA.Marker.prototype.onAdded=function(event){var self=this;this.addEventListener("click",function(event){self.onClick(event)}),this.addEventListener("mouseover",function(event){self.onMouseOver(event)}),this.addEventListener("select",function(event){self.onSelect(event)}),this.map.settings.marker==this.id&&self.trigger("select"),"1"==this.infoopen&&this.openInfoWindow(!0)},WPGMZA.Marker.prototype.handleLegacyGlobals=function(cloned){var m;WPGMZA.settings.useLegacyGlobals&&this.map_id&&this.id&&(WPGMZA.pro_version&&(m=WPGMZA.pro_version.match(/\d+/))&&m[0]<=7||(WPGMZA.legacyGlobals.marker_array[this.map_id]||(WPGMZA.legacyGlobals.marker_array[this.map_id]=[]),WPGMZA.legacyGlobals.marker_array[this.map_id][this.id]=this,WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]||(WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]=[]),cloned=$.extend({marker_id:this.id},cloned),WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id][this.id]=cloned))},WPGMZA.Marker.prototype.initInfoWindow=function(){this.infoWindow||(this.infoWindow=WPGMZA.InfoWindow.createInstance())},WPGMZA.Marker.prototype.openInfoWindow=function(autoOpen){this.map?(autoOpen||(this.map.lastInteractedMarker&&this.map.lastInteractedMarker.infoWindow.close(),this.map.lastInteractedMarker=this),this.initInfoWindow(),this.infoWindow.open(this.map,this)):console.warn("Cannot open infowindow for marker with no map")},WPGMZA.Marker.prototype.onClick=function(event){},WPGMZA.Marker.prototype.onSelect=function(event){this.openInfoWindow()},WPGMZA.Marker.prototype.onMouseOver=function(event){WPGMZA.settings.wpgmza_settings_map_open_marker_by==WPGMZA.InfoWindow.OPEN_BY_HOVER&&this.openInfoWindow()},WPGMZA.Marker.prototype.getIcon=function(){function stripProtocol(url){return"string"!=typeof url?url:url.replace(/^http(s?):/,"")}return WPGMZA.defaultMarkerIcon?stripProtocol(WPGMZA.defaultMarkerIcon):stripProtocol(WPGMZA.settings.default_marker_icon)},WPGMZA.Marker.prototype.getPosition=function(){return new WPGMZA.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})},WPGMZA.Marker.prototype.setPosition=function(latLng){latLng instanceof WPGMZA.LatLng?(this.lat=latLng.lat,this.lng=latLng.lng):(this.lat=parseFloat(latLng.lat),this.lng=parseFloat(latLng.lng))},WPGMZA.Marker.prototype.setOffset=function(x,y){this._offset.x=x,this._offset.y=y,this.updateOffset()},WPGMZA.Marker.prototype.updateOffset=function(){},WPGMZA.Marker.prototype.getAnimation=function(){return this.anim},WPGMZA.Marker.prototype.setAnimation=function(animation){},WPGMZA.Marker.prototype.getVisible=function(){},WPGMZA.Marker.prototype.setVisible=function(visible){!visible&&this.infoWindow&&this.infoWindow.close()},WPGMZA.Marker.prototype.getMap=function(){return this.map},WPGMZA.Marker.prototype.setMap=function(map){map?map.addMarker(this):this.map&&this.map.removeMarker(this),this.map=map},WPGMZA.Marker.prototype.getDraggable=function(){},WPGMZA.Marker.prototype.setDraggable=function(draggable){},WPGMZA.Marker.prototype.setOptions=function(options){},WPGMZA.Marker.prototype.setOpacity=function(opacity){},WPGMZA.Marker.prototype.panIntoView=function(){if(!this.map)throw new Error("Marker hasn't been added to a map");this.map.setCenter(this.getPosition())},WPGMZA.Marker.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this),position=this.getPosition();return $.extend(result,{lat:position.lat,lng:position.lng,address:this.address,title:this.title,description:this.description,link:this.link,icon:this.icon,pic:this.pic,approved:this.approved}),result}}),jQuery(function($){WPGMZA.ModernStoreLocatorCircle=function(map_id,settings){var map=WPGMZA.isProVersion()?this.map=WPGMZA.getMapByID(map_id):this.map=WPGMZA.maps[0];this.map_id=map_id,this.mapElement=map.element,this.mapSize={width:$(this.mapElement).width(),height:$(this.mapElement).height()},this.initCanvasLayer(),this.settings={center:new WPGMZA.LatLng(0,0),radius:1,color:"#ff0000",shadowColor:"white",shadowBlur:4,centerRingRadius:10,centerRingLineWidth:3,numInnerRings:9,innerRingLineWidth:1,innerRingFade:!0,numOuterRings:7,ringLineWidth:1,mainRingLineWidth:2,numSpokes:6,spokesStartAngle:Math.PI/2,numRadiusLabels:6,radiusLabelsStartAngle:Math.PI/2,radiusLabelFont:"13px sans-serif",visible:!1},settings&&this.setOptions(settings)},WPGMZA.ModernStoreLocatorCircle.createInstance=function(map,settings){return new("google-maps"==WPGMZA.settings.engine?WPGMZA.GoogleModernStoreLocatorCircle:WPGMZA.OLModernStoreLocatorCircle)(map,settings)},WPGMZA.ModernStoreLocatorCircle.prototype.initCanvasLayer=function(){},WPGMZA.ModernStoreLocatorCircle.prototype.onResize=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.onUpdate=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.setOptions=function(options){for(var name in options){var functionName="set"+name.substr(0,1).toUpperCase()+name.substr(1);"function"==typeof this[functionName]?this[functionName](options[name]):this.settings[name]=options[name]}},WPGMZA.ModernStoreLocatorCircle.prototype.getResolutionScale=function(){return window.devicePixelRatio||1},WPGMZA.ModernStoreLocatorCircle.prototype.getCenter=function(){return this.getPosition()},WPGMZA.ModernStoreLocatorCircle.prototype.setCenter=function(value){this.setPosition(value)},WPGMZA.ModernStoreLocatorCircle.prototype.getPosition=function(){return this.settings.center},WPGMZA.ModernStoreLocatorCircle.prototype.setPosition=function(position){this.settings.center=position},WPGMZA.ModernStoreLocatorCircle.prototype.getRadius=function(){return this.settings.radius},WPGMZA.ModernStoreLocatorCircle.prototype.setRadius=function(radius){if(isNaN(radius))throw new Error("Invalid radius");this.settings.radius=radius},WPGMZA.ModernStoreLocatorCircle.prototype.getVisible=function(){return this.settings.visible},WPGMZA.ModernStoreLocatorCircle.prototype.setVisible=function(visible){this.settings.visible=visible},WPGMZA.ModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getContext=function(type){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.validateSettings=function(){WPGMZA.isHexColorString(this.settings.color)||(this.settings.color="#ff0000")},WPGMZA.ModernStoreLocatorCircle.prototype.draw=function(){this.validateSettings();var settings=this.settings,end=this.getCanvasDimensions(),m=end.width,start=end.height;this.map,this.getResolutionScale();if(context=this.getContext("2d"),context.clearRect(0,0,m,start),settings.visible){context.shadowColor=settings.shadowColor,context.shadowBlur=settings.shadowBlur,context.setTransform(1,0,0,1,0,0);var scale=this.getScale();context.scale(scale,scale);end=this.getWorldOriginOffset();context.translate(end.x,end.y);new WPGMZA.LatLng(this.settings.center);var worldPoint=this.getCenterPixels(),rgba=WPGMZA.hexToRgba(settings.color),ringSpacing=this.getTransformedRadius(settings.radius)/(settings.numInnerRings+1);context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.centerRingRadius)/scale,0,2*Math.PI),context.stroke(),context.closePath();var radius=this.getTransformedRadius(settings.radius)+ringSpacing*settings.numOuterRings+1,m=context.createRadialGradient(0,0,0,0,0,radius),rgba=WPGMZA.hexToRgba(settings.color),start=WPGMZA.rgbaToString(rgba);rgba.a=0,end=WPGMZA.rgbaToString(rgba),m.addColorStop(0,start),m.addColorStop(1,end),context.save(),context.translate(worldPoint.x,worldPoint.y),context.strokeStyle=m,context.lineWidth=2/scale;for(var i=0;i<settings.numSpokes;i++)spokeAngle=settings.spokesStartAngle+2*Math.PI*(i/settings.numSpokes),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.setLineDash([2/scale,15/scale]),context.beginPath(),context.moveTo(0,0),context.lineTo(x,y),context.stroke();context.setLineDash([]),context.restore(),context.lineWidth=1/scale*settings.innerRingLineWidth;for(i=1;i<=settings.numInnerRings;i++){radius=i*ringSpacing;settings.innerRingFade&&(rgba.a=1-(i-1)/settings.numInnerRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath()}context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.radius),0,2*Math.PI),context.stroke(),context.closePath();for(radius=radius+ringSpacing,i=0;i<settings.numOuterRings;i++)settings.innerRingFade&&(rgba.a=1-i/settings.numOuterRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath(),radius+=ringSpacing;if(0<settings.numRadiusLabels){var x,y,radius=this.getTransformedRadius(settings.radius);(m=settings.radiusLabelFont.match(/(\d+)px/))&&parseInt(m[1]),context.font=settings.radiusLabelFont,context.textAlign="center",context.textBaseline="middle",context.fillStyle=settings.color,context.save(),context.translate(worldPoint.x,worldPoint.y);for(i=0;i<settings.numRadiusLabels;i++){var spokeAngle,textAngle=(spokeAngle=settings.radiusLabelsStartAngle+2*Math.PI*(i/settings.numRadiusLabels))+Math.PI/2,width=settings.radiusString;0<Math.sin(spokeAngle)&&(textAngle-=Math.PI),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.save(),context.translate(x,y),context.rotate(textAngle),context.scale(1/scale,1/scale),width=context.measureText(width).width,height=width/2,context.clearRect(-width,-height,2*width,2*height),context.fillText(settings.radiusString,0,0),context.restore()}context.restore()}}}}),jQuery(function($){WPGMZA.NativeMapsAppIcon=function(){navigator.userAgent.match(/^Apple|iPhone|iPad|iPod/)?(this.type="apple",this.element=$('<span><i class="fab fa fa-apple" aria-hidden="true"></i></span>')):(this.type="google",this.element=$('<span><i class="fab fa fa-google" aria-hidden="true"></i></span>'))}}),jQuery(function($){Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(begin,end){return new Uint8Array(Array.prototype.slice.call(this,begin,end))}}),WPGMZA.isSafari()&&!window.external&&(window.external={})}),jQuery(function($){WPGMZA.Polygon=function(row,enginePolygon){WPGMZA.assertInstanceOf(this,"Polygon"),this.paths=null,WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polygon.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polygon.prototype.constructor=WPGMZA.Polygon,Object.defineProperty(WPGMZA.Polygon.prototype,"fillColor",{enumerable:!0,get:function(){return this.fillcolor&&this.fillcolor.length?"#"+this.fillcolor.replace(/^#/,""):"#ff0000"},set:function(a){this.fillcolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineopacity&&this.lineopacity.length?this.lineopacity:.6},set:function(a){this.lineopacity=a}}),WPGMZA.Polygon.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProPolygon:WPGMZA.GooglePolygon:WPGMZA.isProVersion()?WPGMZA.OLProPolygon:WPGMZA.OLPolygon},WPGMZA.Polygon.createInstance=function(row,engineObject){return new(WPGMZA.Polygon.getConstructor())(row,engineObject)}}),jQuery(function($){WPGMZA.Polyline=function(options,googlePolyline){WPGMZA.assertInstanceOf(this,"Polyline"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polyline.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polyline.prototype.constructor=WPGMZA.Polyline,Object.defineProperty(WPGMZA.Polyline.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeWeight",{enumerable:!0,get:function(){return this.linethickness&&this.linethickness.length?parseInt(this.linethickness):1},set:function(a){this.linethickness=a}}),WPGMZA.Polyline.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.GooglePolyline:WPGMZA.OLPolyline},WPGMZA.Polyline.createInstance=function(options,engineObject){return new(WPGMZA.Polyline.getConstructor())(options,engineObject)},WPGMZA.Polyline.prototype.getPoints=function(){return this.toJSON().points},WPGMZA.Polyline.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this);return result.title=this.title,result}}),jQuery(function($){WPGMZA.PopoutPanel=function(element){this.element=element},WPGMZA.PopoutPanel.prototype.open=function(){$(this.element).addClass("wpgmza-open")},WPGMZA.PopoutPanel.prototype.close=function(){$(this.element).removeClass("wpgmza-open")}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Rectangle=function(options,engineRectangle){WPGMZA.assertInstanceOf(this,"Rectangle"),this.name="",this.cornerA=new WPGMZA.LatLng,this.cornerB=new WPGMZA.LatLng,this.color="#ff0000",this.opacity=.5,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Rectangle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeColor",{enumerable:!0,get:function(){return"#000000"}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return 0}}),WPGMZA.Rectangle.createInstance=function(options,engineRectangle){var constructor="open-layers"===WPGMZA.settings.engine?WPGMZA.OLRectangle:WPGMZA.GoogleRectangle;return new constructor(options,engineRectangle)}}),jQuery(function($){function sendAJAXFallbackRequest(route,params){if((params=$.extend({},params)).data||(params.data={}),"route"in params.data)throw new Error("Cannot send route through this method");if("action"in params.data)throw new Error("Cannot send action through this method");return params.data.route=route,params.data.action="wpgmza_rest_api_request",WPGMZA.restAPI.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_AJAX),$.ajax(WPGMZA.ajaxurl,params)}WPGMZA.RestAPI=function(){WPGMZA.RestAPI.URL=WPGMZA.resturl,this.useAJAXFallback=!1},WPGMZA.RestAPI.CONTEXT_REST="REST",WPGMZA.RestAPI.CONTEXT_AJAX="AJAX",WPGMZA.RestAPI.createInstance=function(){return new WPGMZA.RestAPI},Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableSupported",{get:function(){return WPGMZA.serverCanInflate&&"Uint8Array"in window&&"TextEncoder"in window}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableAllowed",{get:function(){return!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?!WPGMZA.settings.disable_compressed_path_variables:WPGMZA.settings.enable_compressed_path_variables}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"maxURLLength",{get:function(){return 2083}}),WPGMZA.RestAPI.prototype.compressParams=function(params){var encoded,suffix="";!params.markerIDs||1<(encoded=params.markerIDs.split(",")).length&&(encoded=(new WPGMZA.EliasFano).encode(encoded),raw=pako.deflate(encoded),input=Array.prototype.map.call(raw,function(ch){return String.fromCharCode(ch)}).join(""),suffix="/"+btoa(input).replace(/\//g,"-").replace(/=+$/,""),params.midcbp=encoded.pointer,delete params.markerIDs);var input=JSON.stringify(params),input=(new TextEncoder).encode(input),raw=pako.deflate(input),raw=Array.prototype.map.call(raw,function(ch){return String.fromCharCode(ch)}).join("");return btoa(raw).replace(/\//g,"-").replace(/=+$/,"")+suffix},WPGMZA.RestAPI.prototype.getNonce=function(route){var pattern,matches=[];for(pattern in WPGMZA.restnoncetable){var regex=new RegExp(pattern);route.match(regex)&&matches.push({pattern:pattern,nonce:WPGMZA.restnoncetable[pattern],length:pattern.length})}if(!matches.length)throw new Error("No nonce found for route");return matches.sort(function(a,b){return b.length-a.length}),matches[0].nonce},WPGMZA.RestAPI.prototype.addNonce=function(route,params,context){function setRESTNonce(xhr){context==WPGMZA.RestAPI.CONTEXT_REST&&self.shouldAddNonce(route)&&xhr.setRequestHeader("X-WP-Nonce",WPGMZA.restnonce),params&&params.method&&!params.method.match(/^GET$/i)&&xhr.setRequestHeader("X-WPGMZA-Action-Nonce",self.getNonce(route))}var base,self=this;params.beforeSend?(base=params.beforeSend,params.beforeSend=function(xhr){base(xhr),setRESTNonce(xhr)}):params.beforeSend=setRESTNonce},WPGMZA.RestAPI.prototype.shouldAddNonce=function(route){route=route.replace(/\//g,"");var isAdmin=!1;WPGMZA.is_admin&&1===parseInt(WPGMZA.is_admin)&&(isAdmin=!0);return!(route&&["markers","features","marker-listing","datatables"].includes(route)&&!isAdmin)},WPGMZA.RestAPI.prototype.call=function(route,params){if(this.useAJAXFallback)return sendAJAXFallbackRequest(route,params);var compressedParams,compressedRoute,attemptedCompressedPathVariable=!1,fallbackRoute=route,fallbackParams=$.extend({},params);if("string"!=typeof route||!route.match(/^\//)&&!route.match(/^http/))throw new Error("Invalid route");WPGMZA.RestAPI.URL.match(/\/$/)&&(route=route.replace(/^\//,"")),params=params||{},this.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_REST),params.error||(params.error=function(xhr,status,message){if("abort"!=status){switch(xhr.status){case 401:case 403:case 405:return($.post(WPGMZA.ajaxurl,{action:"wpgmza_report_rest_api_blocked"},function(response){}),console.warn("The REST API was blocked. This is usually due to security plugins blocking REST requests for non-authenticated users."),"DELETE"===params.method)?(console.warn("The REST API rejected a DELETE request, attempting again with POST fallback"),params.method="POST",params.data||(params.data={}),params.data.simulateDelete="yes",WPGMZA.restAPI.call(route,params)):(this.useAJAXFallback=!0,sendAJAXFallbackRequest(fallbackRoute,fallbackParams));case 414:if(!attemptedCompressedPathVariable)break;return fallbackParams.method="POST",fallbackParams.useCompressedPathVariable=!1,WPGMZA.restAPI.call(fallbackRoute,fallbackParams)}throw new Error(message)}}),params.useCompressedPathVariable&&this.isCompressedPathVariableSupported&&this.isCompressedPathVariableAllowed&&(compressedParams=$.extend({},params),compressedRoute=params.data,compressedRoute=this.compressParams(compressedRoute),WPGMZA.isServerIIS&&(compressedRoute=compressedRoute.replace(/\+/g,"%20")),compressedRoute=route.replace(/\/$/,"")+"/base64"+compressedRoute,WPGMZA.RestAPI.URL,compressedParams.method="GET",delete compressedParams.data,!1===params.cache&&(compressedParams.data={skip_cache:1}),compressedRoute.length<this.maxURLLength?(attemptedCompressedPathVariable=!0,route=compressedRoute,params=compressedParams):(WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed||console.warn("Compressed path variable route would exceed URL length limit"),WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed=!0));var onSuccess=null;return params.success&&(onSuccess=params.success),params.success=function(result,status,xhr){if("object"!=typeof result){var rawResult=result;try{result=JSON.parse(result)}catch(parseExc){result=rawResult}}onSuccess&&"function"==typeof onSuccess&&onSuccess(result,status,xhr)},WPGMZA.RestAPI.URL.match(/\?/)&&(route=route.replace(/\?/,"&")),$.ajax(WPGMZA.RestAPI.URL+route,params)};var nativeCallFunction=WPGMZA.RestAPI.call;WPGMZA.RestAPI.call=function(){console.warn("WPGMZA.RestAPI.call was called statically, did you mean to call the function on WPGMZA.restAPI?"),nativeCallFunction.apply(this,arguments)},$(document.body).on("click","#wpgmza-rest-api-blocked button.notice-dismiss",function(event){WPGMZA.restAPI.call("/rest-api/",{method:"POST",data:{dismiss_blocked_notice:!0}})})});var $_GET={};if(-1!==document.location.toString().indexOf("?"))for(var query=document.location.toString().replace(/^.*?\?/,"").replace(/#.*$/,"").split("&"),wpgmza_i=0,wpgmza_l=query.length;wpgmza_i<wpgmza_l;wpgmza_i++){var aux=decodeURIComponent(query[wpgmza_i]).split("=");$_GET[aux[0]]=aux[1]}jQuery(function($){WPGMZA.SettingsPage=function(){var self=this;this._keypressHistory=[],this.updateEngineSpecificControls(),this.updateStorageControls(),this.updateGDPRControls(),$(window).on("keypress",function(event){self.onKeyPress(event)}),jQuery("body").on("click",".wpgmza_destroy_data",function(warning){warning.preventDefault();var ttype=jQuery(this).attr("danger"),warning="wpgmza_destroy_all_data"==ttype?"Are you sure? This will delete ALL data and settings for WP Google Maps!":"Are you sure?";window.confirm(warning)&&jQuery.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_settings_danger_zone_delete_data",type:ttype,nonce:wpgmza_dz_nonce},success:function(response,status,xhr){"wpgmza_destroy_all_data"==ttype?window.location.replace("admin.php?page=wp-google-maps-menu&action=welcome_page"):"wpgmza_reset_all_settings"==ttype?window.location.reload():alert("Complete.")}})}),$("select[name='wpgmza_maps_engine']").on("change",function(event){self.updateEngineSpecificControls()}),$('[name="wpgmza_settings_marker_pull"]').on("click",function(event){self.updateStorageControls()}),$("input[name='wpgmza_gdpr_require_consent_before_load'], input[name='wpgmza_gdpr_require_consent_before_vgm_submit'], input[name='wpgmza_gdpr_override_notice']").on("change",function(event){self.updateGDPRControls()}),$('select[name="tile_server_url"]').on("change",function(event){"custom_override"===$('select[name="tile_server_url"]').val()?$(".wpgmza_tile_server_override_component").removeClass("wpgmza-hidden"):$(".wpgmza_tile_server_override_component").addClass("wpgmza-hidden")}),$('select[name="tile_server_url"]').trigger("change"),jQuery("#wpgmza_flush_cache_btn").on("click",function(){jQuery(this).attr("disabled","disabled"),WPGMZA.settingsPage.flushGeocodeCache()}),$("#wpgmza-global-settings").tabs({create:function(event,ui){var elmnt,y;void 0!==$_GET.highlight&&((elmnt=document.getElementById($_GET.highlight)).classList.add("highlight-item"),setTimeout(function(){elmnt.classList.add("highlight-item-step-2")},1e3),y=elmnt.getBoundingClientRect().top+window.pageYOffset+-100,window.scrollTo({top:y,behavior:"smooth"}))}}),$("#wpgmza-global-setting").bind("create",function(event,ui){alert("now")}),$("#wpgmza-global-settings fieldset").each(function(index,el){$(el).children(":not(legend)").wrapAll("<span class='settings-group'></span>")})},WPGMZA.SettingsPage.createInstance=function(){return new WPGMZA.SettingsPage},WPGMZA.SettingsPage.prototype.updateEngineSpecificControls=function(){var engine=$("select[name='wpgmza_maps_engine']").val();$("[data-required-maps-engine][data-required-maps-engine!='"+engine+"']").hide(),$("[data-required-maps-engine='"+engine+"']").show()},WPGMZA.SettingsPage.prototype.updateStorageControls=function(){$("input[name='wpgmza_settings_marker_pull'][value='1']").is(":checked")?$("#xml-cache-settings").show():$("#xml-cache-settings").hide()},WPGMZA.SettingsPage.prototype.updateGDPRControls=function(){var showNoticeControls=$("input[name='wpgmza_gdpr_require_consent_before_load']").prop("checked"),showOverrideTextarea=$("input[name='wpgmza_gdpr_require_consent_before_vgm_submit']");showOverrideTextarea.length&&(showNoticeControls=showNoticeControls||showOverrideTextarea.prop("checked"));showOverrideTextarea=showNoticeControls&&$("input[name='wpgmza_gdpr_override_notice']").prop("checked");showNoticeControls?$("#wpgmza-gdpr-compliance-notice").show("slow"):$("#wpgmza-gdpr-compliance-notice").hide("slow"),showOverrideTextarea?$("#wpgmza_gdpr_override_notice_text").show("slow"):$("#wpgmza_gdpr_override_notice_text").hide("slow")},WPGMZA.SettingsPage.prototype.flushGeocodeCache=function(){(new WPGMZA.OLGeocoder).clearCache(function(response){jQuery("#wpgmza_flush_cache_btn").removeAttr("disabled")})},WPGMZA.SettingsPage.prototype.onKeyPress=function(event){this._keypressHistory.push(event.key),9<this._keypressHistory.length&&(this._keypressHistory=this._keypressHistory.slice(this._keypressHistory.length-9)),"codecabin"!=this._keypressHistory.join("")||this._developerModeRevealed||($("fieldset#wpgmza-developer-mode").show(),this._developerModeRevealed=!0)},$(document).ready(function(event){WPGMZA.getCurrentPage()&&(WPGMZA.settingsPage=WPGMZA.SettingsPage.createInstance())})}),jQuery(function($){WPGMZA.StoreLocator=function(map,element){var self=this;WPGMZA.EventDispatcher.call(this),this._center=null,this.map=map,this.element=element,this.state=WPGMZA.StoreLocator.STATE_INITIAL,this.distanceUnits=this.map.settings.store_locator_distance,this.addressInput=WPGMZA.AddressInput.createInstance(this.addressElement,this.map),$(element).find(".wpgmza-not-found-msg").hide(),this.radiusElement&&this.map.settings.wpgmza_store_locator_default_radius&&0<this.radiusElement.find("option[value='"+this.map.settings.wpgmza_store_locator_default_radius+"']").length&&this.radiusElement.val(this.map.settings.wpgmza_store_locator_default_radius),this.map.on("storelocatorgeocodecomplete",function(event){self.onGeocodeComplete(event)}),this.map.on("init",function(event){self.map.markerFilter.on("filteringcomplete",function(event){self.onFilteringComplete(event)}),void 0!==self.map.settings.store_locator_style&&"modern"!=self.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style||"default"!==WPGMZA.settings.user_interface_style&&"modern"!=WPGMZA.settings.user_interface_style&&"legacy"!=WPGMZA.settings.user_interface_style||(self.legacyModernAdapter=WPGMZA.ModernStoreLocator.createInstance(map.id))}),$(document.body).on("click",".wpgmza_sl_search_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_search_button",function(event){self.onSearch(event)}),$(document.body).on("click",".wpgmza_sl_reset_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_reset_button_div",function(event){self.onReset(event)}),$(this.addressElement).on("keypress",function(event){13==event.which&&self.onSearch(event)})},WPGMZA.StoreLocator.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.StoreLocator.prototype.constructor=WPGMZA.StoreLocator,WPGMZA.StoreLocator.STATE_INITIAL="initial",WPGMZA.StoreLocator.STATE_APPLIED="applied",WPGMZA.StoreLocator.createInstance=function(map,element){return new WPGMZA.StoreLocator(map,element)},Object.defineProperty(WPGMZA.StoreLocator.prototype,"address",{get:function(){return $(this.addressElement).val()}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"addressElement",{get:function(){return(this.legacyModernAdapter?$(this.legacyModernAdapter.element):$(this.element)).find("input.wpgmza-address")[0]}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"countryRestriction",{get:function(){return this.map.settings.wpgmza_store_locator_restrict}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radiusElement",{get:function(){return $("#radiusSelect, #radiusSelect_"+this.map.id)}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radius",{get:function(){return parseFloat(this.radiusElement.val())}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"center",{get:function(){return this._center}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"bounds",{get:function(){return this._bounds}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"marker",{get:function(){if(1!=this.map.settings.store_locator_bounce)return null;if(this._marker)return this._marker;return this._marker=WPGMZA.Marker.createInstance({visible:!1}),this._marker.disableInfoWindow=!0,this._marker.isFilterable=!1,this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE),this._marker}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"circle",{get:function(){return this._circle||("modern"!=this.map.settings.wpgmza_store_locator_radius_style||WPGMZA.isDeviceiOS()?this._circle=WPGMZA.Circle.createInstance({strokeColor:"#ff0000",strokeOpacity:"0.25",strokeWeight:2,fillColor:"#ff0000",fillOpacity:"0.15",visible:!1,clickable:!1,center:new WPGMZA.LatLng}):(this._circle=WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id),this._circle.settings.color=this.circleStrokeColor),this._circle)}}),WPGMZA.StoreLocator.prototype.onGeocodeComplete=function(event){if(!event.results||!event.results.length)return this._center=null,void(this._bounds=null);this._center=new WPGMZA.LatLng(event.results[0].latLng),this._bounds=new WPGMZA.LatLngBounds(event.results[0].bounds),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.onSearch=function(event){var geocoder,options,self=this;return this.state=WPGMZA.StoreLocator.STATE_APPLIED,this.address&&this.address.length?(void 0!==this.map.settings.store_locator_style&&"modern"!==this.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style&&"default"===WPGMZA.settings.user_interface_style&&WPGMZA.animateScroll(this.map.element),$(this.element).find(".wpgmza-not-found-msg").hide(),WPGMZA.LatLng.isLatLngString(this.address)?callback([WPGMZA.LatLng.fromString(this.address)],WPGMZA.Geocoder.SUCCESS):(geocoder=WPGMZA.Geocoder.createInstance(),options={address:this.address},this.countryRestriction&&(options.country=this.countryRestriction),geocoder.geocode(options,function(results,status){status==WPGMZA.Geocoder.SUCCESS?callback(results,status):alert(WPGMZA.localized_strings.address_not_found)})),!0):(this.addressElement.focus(),!1);function callback(results,status){self.map.trigger({type:"storelocatorgeocodecomplete",results:results,status:status})}},WPGMZA.StoreLocator.prototype.onReset=function(event){this.state=WPGMZA.StoreLocator.STATE_INITIAL,this._center=null,this._bounds=null,this.map.setZoom(this.map.settings.map_start_zoom),$(this.element).find(".wpgmza-not-found-msg").hide(),this.circle&&this.circle.setVisible(!1),this.marker&&this.marker.map&&this.map.removeMarker(this.marker),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.getFilteringParameters=function(){return this.center?{center:this.center,radius:this.radius}:{}},WPGMZA.StoreLocator.prototype.getZoomFromRadius=function(radius){return this.distanceUnits==WPGMZA.Distance.MILES&&(radius*=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(14-Math.log(radius)/Math.LN2)},WPGMZA.StoreLocator.prototype.onFilteringComplete=function(event){var params=event.filteringParams,factor=this.marker;factor&&factor.setVisible(!1),params.center&&(this.map.setCenter(params.center),factor&&(factor.setPosition(params.center),factor.setVisible(!0),factor.map!=this.map&&this.map.addMarker(factor))),params.radius&&this.map.setZoom(this.getZoomFromRadius(params.radius));var circle=this.circle;circle&&(circle.setVisible(!1),factor=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.Distance.KILOMETERS_PER_MILE:1,params.center&&params.radius&&(circle.setRadius(params.radius*factor),circle.setCenter(params.center),circle.setVisible(!0),circle instanceof WPGMZA.ModernStoreLocatorCircle||circle.map==this.map||this.map.addCircle(circle)),circle instanceof WPGMZA.ModernStoreLocatorCircle&&(circle.settings.radiusString=this.radius)),0==event.filteredMarkers.length&&this.state===WPGMZA.StoreLocator.STATE_APPLIED&&(0<$(this.element).find(".wpgmza-no-results").length&&"legacy"===WPGMZA.settings.user_interface_style?$(this.element).find(".wpgmza-no-results").show():alert(this.map.settings.store_locator_not_found_message||WPGMZA.localized_strings.zero_results))}}),jQuery(function($){WPGMZA.Text=function(options){if(options)for(var name in options)this[name]=options[name]},WPGMZA.Text.createInstance=function(options){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleText:WPGMZA.OLText)(options)}}),jQuery(function($){WPGMZA.ThemeEditor=function(){WPGMZA.EventDispatcher.call(this),this.element=$("#wpgmza-theme-editor"),"open-layers"!=WPGMZA.settings.engine?this.element.length?(this.json=[{}],this.mapElement=WPGMZA.maps[0].element,this.element.appendTo("#wpgmza-map-theme-editor__holder"),$(window).on("scroll",function(event){}),setInterval(function(){},200),this.initHTML(),WPGMZA.themeEditor=this):console.warn("No element to initialise theme editor on"):this.element.remove()},WPGMZA.extend(WPGMZA.ThemeEditor,WPGMZA.EventDispatcher),WPGMZA.ThemeEditor.prototype.updatePosition=function(){},WPGMZA.ThemeEditor.features={all:[],administrative:["country","land_parcel","locality","neighborhood","province"],landscape:["man_made","natural","natural.landcover","natural.terrain"],poi:["attraction","business","government","medical","park","place_of_worship","school","sports_complex"],road:["arterial","highway","highway.controlled_access","local"],transit:["line","station","station.airport","station.bus","station.rail"],water:[]},WPGMZA.ThemeEditor.elements={all:[],geometry:["fill","stroke"],labels:["icon","text","text.fill","text.stroke"]},WPGMZA.ThemeEditor.prototype.parse=function(){$("#wpgmza_theme_editor_feature option, #wpgmza_theme_editor_element option").css("font-weight","normal"),$("#wpgmza_theme_editor_error").hide(),$("#wpgmza_theme_editor").show(),$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val("");var jsonCopy=$('textarea[name="wpgmza_theme_data"]');if(!jsonCopy.val()||jsonCopy.val().length<1)this.json=[{}];else{try{this.json=$.parseJSON($('textarea[name="wpgmza_theme_data"]').val())}catch(e){return this.json=[{}],$("#wpgmza_theme_editor").hide(),void $("#wpgmza_theme_editor_error").show()}$.isArray(this.json)||(jsonCopy=this.json,this.json=[],this.json.push(jsonCopy)),this.highlightFeatures(),this.highlightElements(),this.loadElementStylers()}},WPGMZA.ThemeEditor.prototype.highlightFeatures=function(){$("#wpgmza_theme_editor_feature option").css("font-weight","normal"),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")?$('#wpgmza_theme_editor_feature option[value="'+v.featureType+'"]'):$('#wpgmza_theme_editor_feature option[value="all"]')).css("font-weight","bold")})},WPGMZA.ThemeEditor.prototype.highlightElements=function(){var feature=$("#wpgmza_theme_editor_feature").val();$("#wpgmza_theme_editor_element option").css("font-weight","normal"),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")?$('#wpgmza_theme_editor_element option[value="'+v.elementType+'"]'):$('#wpgmza_theme_editor_element option[value="all"]')).css("font-weight","bold")})},WPGMZA.ThemeEditor.prototype.loadElementStylers=function(){var feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val();$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val(""),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&v.hasOwnProperty("stylers")&&$.isArray(v.stylers)&&0<v.stylers.length&&$.each(v.stylers,function(ii,vv){vv.hasOwnProperty("hue")&&($("#wpgmza_theme_editor_do_hue").prop("checked",!0),$("#wpgmza_theme_editor_hue").val(vv.hue)),vv.hasOwnProperty("lightness")&&$("#wpgmza_theme_editor_lightness").val(vv.lightness),vv.hasOwnProperty("saturation")&&$("#wpgmza_theme_editor_saturation").val(vv.xaturation),vv.hasOwnProperty("gamma")&&$("#wpgmza_theme_editor_gamma").val(vv.gamma),vv.hasOwnProperty("invert_lightness")&&$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!0),vv.hasOwnProperty("visibility")&&$("#wpgmza_theme_editor_visibility").val(vv.visibility),vv.hasOwnProperty("color")&&($("#wpgmza_theme_editor_do_color").prop("checked",!0),$("#wpgmza_theme_editor_color").val(vv.color)),vv.hasOwnProperty("weight")&&$("#wpgmza_theme_editor_weight").val(vv.weight)})})},WPGMZA.ThemeEditor.prototype.writeElementStylers=function(){var new_feature_element_stylers,feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val(),indexJSON=null,stylers=[];"inherit"!=$("#wpgmza_theme_editor_visibility").val()&&stylers.push({visibility:$("#wpgmza_theme_editor_visibility").val()}),!0===$("#wpgmza_theme_editor_do_color").prop("checked")&&stylers.push({color:$("#wpgmza_theme_editor_color").val()}),!0===$("#wpgmza_theme_editor_do_hue").prop("checked")&&stylers.push({hue:$("#wpgmza_theme_editor_hue").val()}),0<$("#wpgmza_theme_editor_gamma").val().length&&stylers.push({gamma:parseFloat($("#wpgmza_theme_editor_gamma").val())}),0<$("#wpgmza_theme_editor_weight").val().length&&stylers.push({weight:parseFloat($("#wpgmza_theme_editor_weight").val())}),0<$("#wpgmza_theme_editor_saturation").val().length&&stylers.push({saturation:parseFloat($("#wpgmza_theme_editor_saturation").val())}),0<$("#wpgmza_theme_editor_lightness").val().length&&stylers.push({lightness:parseFloat($("#wpgmza_theme_editor_lightness").val())}),!0===$("#wpgmza_theme_editor_do_invert_lightness").prop("checked")&&stylers.push({invert_lightness:!0}),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&(indexJSON=i)}),null===indexJSON?0<stylers.length&&(new_feature_element_stylers={},"all"!=feature&&(new_feature_element_stylers.featureType=feature),"all"!=element&&(new_feature_element_stylers.elementType=element),new_feature_element_stylers.stylers=stylers,this.json.push(new_feature_element_stylers)):0<stylers.length?this.json[indexJSON].stylers=stylers:this.json.splice(indexJSON,1),$('textarea[name="wpgmza_theme_data"]').val(JSON.stringify(this.json).replace(/:/g,": ").replace(/,/g,", ")),this.highlightFeatures(),this.highlightElements(),WPGMZA.themePanel.updateMapTheme()},WPGMZA.ThemeEditor.prototype.initHTML=function(){var self=this;$.each(WPGMZA.ThemeEditor.features,function(i,v){$("#wpgmza_theme_editor_feature").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_feature").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),$.each(WPGMZA.ThemeEditor.elements,function(i,v){$("#wpgmza_theme_editor_element").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_element").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),this.parse(),$('textarea[name="wpgmza_theme_data"]').on("input selectionchange propertychange",function(){self.parse()}),$(".wpgmza_theme_selection").click(function(){setTimeout(function(){$('textarea[name="wpgmza_theme_data"]').trigger("input")},1e3)}),$("#wpgmza-theme-editor__toggle").click(function(){$("#wpgmza-theme-editor").removeClass("active")}),$("#wpgmza_theme_editor_feature").on("change",function(){self.highlightElements(),self.loadElementStylers()}),$("#wpgmza_theme_editor_element").on("change",function(){self.loadElementStylers()}),$("#wpgmza_theme_editor_do_hue, #wpgmza_theme_editor_hue, #wpgmza_theme_editor_lightness, #wpgmza_theme_editor_saturation, #wpgmza_theme_editor_gamma, #wpgmza_theme_editor_do_invert_lightness, #wpgmza_theme_editor_visibility, #wpgmza_theme_editor_do_color, #wpgmza_theme_editor_color, #wpgmza_theme_editor_weight").on("input selectionchange propertychange",function(){self.writeElementStylers()}),"open-layers"==WPGMZA.settings.engine&&$("#wpgmza_theme_editor :input").prop("disabled",!0)}}),jQuery(function($){WPGMZA.ThemePanel=function(){var self=this;this.element=$("#wpgmza-theme-panel"),this.map=WPGMZA.maps[0],"open-layers"!=WPGMZA.settings.engine?this.element.length?($("#wpgmza-theme-presets").owlCarousel({items:6,dots:!0}),this.element.on("click","#wpgmza-theme-presets label",function(event){self.onThemePresetClick(event)}),$("#wpgmza-open-theme-editor").on("click",function(event){$("#wpgmza-map-theme-editor__holder").addClass("active"),$("#wpgmza-theme-editor").addClass("active"),WPGMZA.animateScroll($("#wpgmza-theme-editor"))}),WPGMZA.themePanel=this):console.warn("No element to initialise theme panel on"):this.element.remove()},WPGMZA.ThemePanel.previewImageCenter={lat:33.701806462148646,lng:-118.15949896058983},WPGMZA.ThemePanel.previewImageZoom=11,WPGMZA.ThemePanel.prototype.onThemePresetClick=function(existingData){var selectedData=$(existingData.currentTarget).find("[data-theme-json]").attr("data-theme-json"),textarea=$(this.element).find("textarea[name='wpgmza_theme_data']"),existingData=textarea.val(),allPresetData=[];$(this.element).find("[data-theme-json]").each(function(index,el){allPresetData.push($(el).attr("data-theme-json"))}),existingData.length&&-1==allPresetData.indexOf(existingData)&&!confirm(WPGMZA.localized_strings.overwrite_theme_data)||(textarea.val(selectedData),this.updateMapTheme(),WPGMZA.themeEditor.parse())},WPGMZA.ThemePanel.prototype.updateMapTheme=function(){var data;try{data=JSON.parse($("textarea[name='wpgmza_theme_data']").val())}catch(e){return void alert(WPGMZA.localized_strings.invalid_theme_data)}this.map.setOptions({styles:data})}}),jQuery(function($){WPGMZA.Version=function(){},WPGMZA.Version.GREATER_THAN=1,WPGMZA.Version.EQUAL_TO=0,WPGMZA.Version.LESS_THAN=-1,WPGMZA.Version.compare=function(v1,v2){for(var v1parts=v1.match(/\d+/g),v2parts=v2.match(/\d+/g),i=0;i<v1parts.length;++i){if(v2parts.length===i)return 1;if(v1parts[i]!==v2parts[i])return v1parts[i]>v2parts[i]?1:-1}return v1parts.length!=v2parts.length?-1:0}}),jQuery(function($){WPGMZA.XMLCacheConverter=function(){},WPGMZA.XMLCacheConverter.prototype.convert=function(xml){var markers=[],remap={marker_id:"id",linkd:"link"};return $(xml).find("marker").each(function(index,el){var data={};$(el).children().each(function(j,child){var key=child.nodeName;remap[key]&&(key=remap[key]),child.hasAttribute("data-json")?data[key]=JSON.parse($(child).text()):data[key]=$(child).text()}),markers.push(data)}),markers}}),jQuery(function($){WPGMZA.loadXMLAsWebWorker=function(){function tXml(a,d){function c(){for(var l=[];a[b];){if(60==a.charCodeAt(b)){if(47===a.charCodeAt(b+1)){b=a.indexOf(">",b);break}if(33===a.charCodeAt(b+1)){if(45==a.charCodeAt(b+2)){for(;62!==a.charCodeAt(b)||45!=a.charCodeAt(b-1)||45!=a.charCodeAt(b-2)||-1==b;)b=a.indexOf(">",b+1);-1===b&&(b=a.length)}else for(b+=2;62!==a.charCodeAt(b);)b++;b++;continue}var c=f();l.push(c)}else c=b,-2===(b=a.indexOf("<",b)-1)&&(b=a.length),0<(c=a.slice(c,b+1)).trim().length&&l.push(c);b++}return l}function l(){for(var c=b;-1===g.indexOf(a[b]);)b++;return a.slice(c,b)}function f(){var d={};b++,d.tagName=l();for(var f=!1;62!==a.charCodeAt(b);){if(64<(e=a.charCodeAt(b))&&e<91||96<e&&e<123){for(var h,g=l(),e=a.charCodeAt(b);39!==e&&34!==e&&!(64<e&&e<91||96<e&&e<123)&&62!==e;)b++,e=a.charCodeAt(b);f||(d.attributes={},f=!0),39===e||34===e?(e=a[b],h=++b,b=a.indexOf(e,h),e=a.slice(h,b)):(e=null,b--),d.attributes[g]=e}b++}return 47!==a.charCodeAt(b-1)&&("script"==d.tagName?(f=b+1,b=a.indexOf("<\/script>",b),d.children=[a.slice(f,b-1)],b+=8):"style"==d.tagName?(f=b+1,b=a.indexOf("</style>",b),d.children=[a.slice(f,b-1)],b+=7):-1==k.indexOf(d.tagName)&&(b++,d.children=c())),d}var g="\n\t>/=",k=["img","br","input","meta","link"],h=null;if((d=d||{}).searchId){var b=new RegExp("s*ids*=s*['\"]"+d.searchId+"['\"]").exec(a).index;return-1!==b&&(-1!==(b=a.lastIndexOf("<",b))&&(h=f())),b}return b=0,h=c(),d.filter&&(h=tXml.filter(h,d.filter)),d.simplify&&(h=tXml.simplefy(h)),h}tXml.simplify=function(a){var c,d={};if(1===a.length&&"string"==typeof a[0])return a[0];for(c in a.forEach(function(a){var c;d[a.tagName]||(d[a.tagName]=[]),"object"==typeof a?(c=tXml.simplefy(a.children),d[a.tagName].push(c),a.attributes&&(c._attributes=a.attributes)):d[a.tagName].push(a)}),d)1==d[c].length&&(d[c]=d[c][0]);return d},tXml.filter=function(a,d){var c=[];return a.forEach(function(a){"object"==typeof a&&d(a)&&c.push(a),a.children&&(a=tXml.filter(a.children,d),c=c.concat(a))}),c},tXml.domToXml=function(a){var c="";return function d(a){if(a)for(var f=0;f<a.length;f++)if("string"==typeof a[f])c+=a[f].trim();else{var g=a[f];c+="<"+g.tagName;var k=void 0;for(k in g.attributes)c=-1===g.attributes[k].indexOf('"')?c+(" "+k+'="'+g.attributes[k].trim())+'"':c+(" "+k+"='"+g.attributes[k].trim())+"'";c+=">",d(g.children),c+="</"+g.tagName+">"}}(O),c},"object"!=typeof window&&(module.exports=tXml);var inputData,totalFiles,worker=self,dataForMainThread=[],filesLoaded=0;function onXMLLoaded(request){4==request.readyState&&200==request.status&&((new Date).getTime(),function(){for(var markers=tXml(request.responseText)[0].children[0],remap={marker_id:"id",linkd:"link"},i=0;i<markers.children.length;i++){var data={};markers.children[i].children.forEach(function(node){var key=node.tagName;remap[key]&&(key=remap[key]),node.attributes["data-json"]?data[key]=JSON.parse(node.children[0]):node.children.length?data[key]=node.children[0]:data[key]=""}),dataForMainThread.push(data)}}(),++filesLoaded>=totalFiles?worker.postMessage(dataForMainThread):loadNextFile())}function loadNextFile(){var url=inputData.urls[filesLoaded],request=new XMLHttpRequest;request.onreadystatechange=function(){onXMLLoaded(this)},request.open("GET",inputData.protocol+url,!0),request.send()}self.addEventListener("message",function(data){data=data.data;if("load"!==data.command)throw new Error("Unknown command");dataForMainThread=[],filesLoaded=0,totalFiles=(inputData=data).urls.length,loadNextFile()},!1)}}),jQuery(function($){WPGMZA.Integration={},WPGMZA.integrationModules={}}),jQuery(function($){var __,registerBlockType,InspectorControls,_wp$components,Dashicon,PanelBody;window.wp&&wp.i18n&&wp.blocks&&wp.editor&&wp.components&&(__=wp.i18n.__,registerBlockType=wp.blocks.registerBlockType,_wp$components=wp.editor,InspectorControls=_wp$components.InspectorControls,_wp$components.BlockControls,_wp$components=wp.components,Dashicon=_wp$components.Dashicon,_wp$components.Toolbar,_wp$components.Button,_wp$components.Tooltip,PanelBody=_wp$components.PanelBody,_wp$components.TextareaControl,_wp$components.CheckboxControl,_wp$components.TextControl,_wp$components.SelectControl,_wp$components.RichText,WPGMZA.Integration.Gutenberg=function(){registerBlockType("gutenberg-wpgmza/block",this.getBlockDefinition())},WPGMZA.Integration.Gutenberg.prototype.getBlockTitle=function(){return __("WP Google Maps")},WPGMZA.Integration.Gutenberg.prototype.getBlockInspectorControls=function(props){return React.createElement(InspectorControls,{key:"inspector"},React.createElement(PanelBody,{title:__("Map Settings")},React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu&action=edit&map_id=1",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-pencil-square-o","aria-hidden":"true"}),__("Go to Map Editor"))),React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:"https://www.wpgmaps.com/documentation/creating-your-first-map/",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-book","aria-hidden":"true"}),__("View Documentation")))))},WPGMZA.Integration.Gutenberg.prototype.getBlockAttributes=function(){return{}},WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition=function(props){var _this=this;return{title:__("WP Google Maps"),description:__("The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss."),category:"common",icon:"location-alt",keywords:[__("Map"),__("Maps"),__("Google")],attributes:this.getBlockAttributes(),edit:function(props){return[!!props.isSelected&&_this.getBlockInspectorControls(props),React.createElement("div",{className:props.className+" wpgmza-gutenberg-block"},React.createElement(Dashicon,{icon:"location-alt"}),React.createElement("span",{class:"wpgmza-gutenberg-block-title"},__("Your map will appear here on your websites front end")))]},save:function(){return null}}},WPGMZA.Integration.Gutenberg.getConstructor=function(){return WPGMZA.Integration.Gutenberg},WPGMZA.Integration.Gutenberg.createInstance=function(){return new(WPGMZA.Integration.Gutenberg.getConstructor())},WPGMZA.isProVersion()||/^6/.test(WPGMZA.pro_version)||(WPGMZA.integrationModules.gutenberg=WPGMZA.Integration.Gutenberg.createInstance()))}),jQuery(function($){$(document).ready(function(event){var parent=document.body.onclick;parent&&(document.body.onclick=function(event){event.target instanceof WPGMZA.Marker||parent(event)})})}),jQuery(function($){WPGMZA.GoogleUICompatibility=function(){var style;navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS")||((style=$("<style id='wpgmza-google-ui-compatiblity-fix'/>")).html(".wpgmza_map img:not(button img){ padding:0 !important; }"),$(document.head).append(style))},WPGMZA.googleUICompatibility=new WPGMZA.GoogleUICompatibility}),jQuery(function($){WPGMZA.GoogleCircle=function(options,googleCircle){var self=this;WPGMZA.Circle.call(this,options,googleCircle),googleCircle?(this.googleCircle=googleCircle,options&&(options.center=WPGMZA.LatLng.fromGoogleLatLng(googleCircle.getCenter()),options.radius=googleCircle.getRadius()/1e3)):(this.googleCircle=new google.maps.Circle,this.googleCircle.wpgmzaCircle=this),this.googleFeature=this.googleCircle,options&&this.setOptions(options),google.maps.event.addListener(this.googleCircle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleCircle.prototype=Object.create(WPGMZA.Circle.prototype),WPGMZA.GoogleCircle.prototype.constructor=WPGMZA.GoogleCircle,WPGMZA.GoogleCircle.prototype.getCenter=function(){return WPGMZA.LatLng.fromGoogleLatLng(this.googleCircle.getCenter())},WPGMZA.GoogleCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.googleCircle.setCenter(center)},WPGMZA.GoogleCircle.prototype.getRadius=function(){return this.googleCircle.getRadius()/1e3},WPGMZA.GoogleCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments),this.googleCircle.setRadius(1e3*parseFloat(radius))},WPGMZA.GoogleCircle.prototype.setVisible=function(visible){this.googleCircle.setVisible(!!visible)},WPGMZA.GoogleCircle.prototype.setDraggable=function(value){this.googleCircle.setDraggable(!!value)},WPGMZA.GoogleCircle.prototype.setEditable=function(value){var self=this;this.googleCircle.setOptions({editable:value}),value&&(google.maps.event.addListener(this.googleCircle,"center_changed",function(event){self.center=WPGMZA.LatLng.fromGoogleLatLng(self.googleCircle.getCenter()),self.trigger("change")}),google.maps.event.addListener(this.googleCircle,"radius_changed",function(event){self.radius=self.googleCircle.getRadius()/1e3,self.trigger("change")}))},WPGMZA.GoogleCircle.prototype.setOptions=function(options){WPGMZA.Circle.prototype.setOptions.apply(this,arguments),options.center&&(this.center=new WPGMZA.LatLng(options.center))},WPGMZA.GoogleCircle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),center=new WPGMZA.LatLng(this.center);googleOptions.radius*=1e3,googleOptions.center=center.toGoogleLatLng(),this.googleCircle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleDrawingManager=function(map){var self=this;WPGMZA.DrawingManager.call(this,map),this.mode=null,this.googleDrawingManager=new google.maps.drawing.DrawingManager({drawingControl:!1,polygonOptions:{editable:!0},polylineOptions:{editable:!0},circleOptions:{editable:!0},rectangleOptions:{editable:!0}}),this.googleDrawingManager.setMap(map.googleMap),google.maps.event.addListener(this.googleDrawingManager,"polygoncomplete",function(polygon){self.onPolygonClosed(polygon)}),google.maps.event.addListener(this.googleDrawingManager,"polylinecomplete",function(polyline){self.onPolylineComplete(polyline)}),google.maps.event.addListener(this.googleDrawingManager,"circlecomplete",function(circle){self.onCircleComplete(circle)}),google.maps.event.addListener(this.googleDrawingManager,"rectanglecomplete",function(rectangle){self.onRectangleComplete(rectangle)})},WPGMZA.GoogleDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.GoogleDrawingManager.prototype.constructor=WPGMZA.GoogleDrawingManager,WPGMZA.GoogleDrawingManager.prototype.setDrawingMode=function(mode){var googleMode;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:googleMode=null;break;case WPGMZA.DrawingManager.MODE_POLYGON:googleMode=google.maps.drawing.OverlayType.POLYGON;break;case WPGMZA.DrawingManager.MODE_POLYLINE:googleMode=google.maps.drawing.OverlayType.POLYLINE;break;case WPGMZA.DrawingManager.MODE_CIRCLE:googleMode=google.maps.drawing.OverlayType.CIRCLE;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:googleMode=google.maps.drawing.OverlayType.RECTANGLE;break;case WPGMZA.DrawingManager.MODE_HEATMAP:googleMode=null;break;default:throw new Error("Invalid drawing mode")}this.googleDrawingManager.setDrawingMode(googleMode)},WPGMZA.GoogleDrawingManager.prototype.setOptions=function(options){this.googleDrawingManager.setOptions({polygonOptions:options,polylineOptions:options})},WPGMZA.GoogleDrawingManager.prototype.onVertexClicked=function(event){},WPGMZA.GoogleDrawingManager.prototype.onPolygonClosed=function(googlePolygon){var event=new WPGMZA.Event("polygonclosed");event.enginePolygon=googlePolygon,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onPolylineComplete=function(googlePolyline){var event=new WPGMZA.Event("polylinecomplete");event.enginePolyline=googlePolyline,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onCircleComplete=function(googleCircle){var event=new WPGMZA.Event("circlecomplete");event.engineCircle=googleCircle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onRectangleComplete=function(googleRectangle){var event=new WPGMZA.Event("rectanglecomplete");event.engineRectangle=googleRectangle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onHeatmapPointAdded=function(image){var position=WPGMZA.LatLng.fromGoogleLatLng(image.getPosition());image.setMap(null);var event=WPGMZA.Marker.createInstance();event.setPosition(position);image={url:WPGMZA.imageFolderURL+"heatmap-point.png",origin:new google.maps.Point(0,0),anchor:new google.maps.Point(13,13)};event.googleMarker.setIcon(image),this.map.addMarker(event);event=new WPGMZA.Event("heatmappointadded");event.position=position,this.trigger(event)}}),jQuery(function($){WPGMZA.GoogleGeocoder=function(){},WPGMZA.GoogleGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.GoogleGeocoder.prototype.constructor=WPGMZA.GoogleGeocoder,WPGMZA.GoogleGeocoder.prototype.getLatLngFromAddress=function(options,callback){return options&&options.address?(options.lat&&options.lng&&(latLng={lat:options.lat,lng:options.lng},callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:null}],WPGMZA.Geocoder.SUCCESS)),WPGMZA.isLatLngString(options.address)?WPGMZA.Geocoder.prototype.getLatLngFromAddress.call(this,options,callback):(options.country&&(options.componentRestrictions={country:options.country}),void(new google.maps.Geocoder).geocode(options,function(nativeStatus,status){var latLng,bounds;status==google.maps.GeocoderStatus.OK?(latLng={lat:(bounds=nativeStatus[0].geometry.location).lat(),lng:bounds.lng()},bounds=null,nativeStatus[0].geometry.bounds&&(bounds=WPGMZA.LatLngBounds.fromGoogleLatLngBounds(nativeStatus[0].geometry.bounds)),callback(nativeStatus=[{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:bounds}],WPGMZA.Geocoder.SUCCESS)):(nativeStatus=WPGMZA.Geocoder.FAIL,status==google.maps.GeocoderStatus.ZERO_RESULTS&&(nativeStatus=WPGMZA.Geocoder.ZERO_RESULTS),callback(null,nativeStatus))}))):(nativeStatus=WPGMZA.Geocoder.NO_ADDRESS,void callback(null,nativeStatus));var latLng},WPGMZA.GoogleGeocoder.prototype.getAddressFromLatLng=function(options,callback){if(!options||!options.latLng)throw new Error("No latLng specified");var latLng=new WPGMZA.LatLng(options.latLng),geocoder=new google.maps.Geocoder;delete(options=$.extend(options,{location:{lat:latLng.lat,lng:latLng.lng}})).latLng,geocoder.geocode(options,function(results,status){"OK"!==status&&callback(null,WPGMZA.Geocoder.FAIL),results&&results.length||callback([],WPGMZA.Geocoder.NO_RESULTS),callback([results[0].formatted_address],WPGMZA.Geocoder.SUCCESS)})}}),jQuery(function($){WPGMZA.settings.engine&&"google-maps"!=WPGMZA.settings.engine||window.google&&window.google.maps&&(WPGMZA.GoogleHTMLOverlay=function(map){this.element=$("<div class='wpgmza-google-html-overlay'></div>"),this.visible=!0,this.position=new WPGMZA.LatLng,this.setMap(map.googleMap),this.wpgmzaMap=map},WPGMZA.GoogleHTMLOverlay.prototype=new google.maps.OverlayView,WPGMZA.GoogleHTMLOverlay.prototype.onAdd=function(){this.getPanes().overlayMouseTarget.appendChild(this.element[0])},WPGMZA.GoogleHTMLOverlay.prototype.onRemove=function(){this.element&&$(this.element).parent().length&&($(this.element).remove(),this.element=null)},WPGMZA.GoogleHTMLOverlay.prototype.draw=function(){this.updateElementPosition()},WPGMZA.GoogleHTMLOverlay.prototype.updateElementPosition=function(){var pixels=this.getProjection();pixels&&(pixels=pixels.fromLatLngToDivPixel(this.position.toGoogleLatLng()),$(this.element).css({left:pixels.x,top:pixels.y}))})}),jQuery(function($){WPGMZA.GoogleModernStoreLocatorCircle=function(map,settings){var self=this;WPGMZA.ModernStoreLocatorCircle.call(this,map,settings),this.intervalID=setInterval(function(){var mapSize={width:$(self.mapElement).width(),height:$(self.mapElement).height()};mapSize.width==self.mapSize.width&&mapSize.height==self.mapSize.height||(self.canvasLayer.resize_(),self.canvasLayer.draw(),self.mapSize=mapSize)},1e3),$(document).bind("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){self.canvasLayer.resize_(),self.canvasLayer.draw()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.GoogleModernStoreLocatorCircle.prototype.constructor=WPGMZA.GoogleModernStoreLocatorCircle,WPGMZA.GoogleModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this;this.canvasLayer&&(this.canvasLayer.setMap(null),this.canvasLayer.setAnimate(!1)),this.canvasLayer=new CanvasLayer({map:this.map.googleMap,resizeHandler:function(event){self.onResize(event)},updateHandler:function(event){self.onUpdate(event)},animate:!0,resolutionScale:this.getResolutionScale()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setOptions=function(options){WPGMZA.ModernStoreLocatorCircle.prototype.setOptions.call(this,options),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setPosition=function(position){WPGMZA.ModernStoreLocatorCircle.prototype.setPosition.call(this,position),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setRadius=function(radius){WPGMZA.ModernStoreLocatorCircle.prototype.setRadius.call(this,radius),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var spherical=google.maps.geometry.spherical,latitude=this.settings.center,result=new WPGMZA.LatLng({lat:0,lng:0}),latitude=new WPGMZA.LatLng({lat:latitude.lat,lng:0}),result=spherical.computeOffset(result.toGoogleLatLng(),1e3*km,90),result=.006395*km*(spherical.computeOffset(latitude.toGoogleLatLng(),1e3*km,90).lng()/result.lng());if(isNaN(result))throw new Error("here");return result},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvasLayer.canvas.width,height:this.canvasLayer.canvas.height}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){var position=this.map.googleMap.getProjection().fromLatLngToPoint(this.canvasLayer.getTopLeft());return{x:-position.x,y:-position.y}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCenterPixels=function(){var center=new WPGMZA.LatLng(this.settings.center);return this.map.googleMap.getProjection().fromLatLngToPoint(center.toGoogleLatLng())},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvasLayer.canvas.getContext("2d")},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getScale=function(){return Math.pow(2,this.map.getZoom())*this.getResolutionScale()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setVisible=function(visible){WPGMZA.ModernStoreLocatorCircle.prototype.setVisible.call(this,visible),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.destroy=function(){this.canvasLayer.setMap(null),this.canvasLayer=null,clearInterval(this.intervalID)}}),jQuery(function($){WPGMZA.GooglePolyline=function(options,path){var self=this;WPGMZA.Polyline.call(this,options,path),this.googlePolyline=path||new google.maps.Polyline(this.settings),this.googleFeature=this.googlePolyline,options&&options.polydata&&(path=this.parseGeometry(options.polydata),this.googlePolyline.setPath(path)),this.googlePolyline.wpgmzaPolyline=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolyline,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GooglePolyline.prototype=Object.create(WPGMZA.Polyline.prototype),WPGMZA.GooglePolyline.prototype.constructor=WPGMZA.GooglePolyline,WPGMZA.GooglePolyline.prototype.updateNativeFeature=function(){this.googlePolyline.setOptions(this.getScalarProperties())},WPGMZA.GooglePolyline.prototype.setEditable=function(value){var path,self=this;this.googlePolyline.setOptions({editable:value}),value&&(path=this.googlePolyline.getPath(),["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})}),google.maps.event.addListener(this.googlePolyline,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolyline,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))}))},WPGMZA.GooglePolyline.prototype.setDraggable=function(value){this.googlePolyline.setOptions({draggable:value})},WPGMZA.GooglePolyline.prototype.getGeometry=function(){for(var result=[],path=this.googlePolyline.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){WPGMZA.GoogleRectangle=function(options,googleRectangle){var self=this;options=options||{},WPGMZA.Rectangle.call(this,options,googleRectangle),googleRectangle?(this.googleRectangle=googleRectangle,this.cornerA=options.cornerA=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getNorthEast().lat(),lng:googleRectangle.getBounds().getSouthWest().lng()}),this.cornerB=options.cornerB=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getSouthWest().lat(),lng:googleRectangle.getBounds().getNorthEast().lng()})):(this.googleRectangle=new google.maps.Rectangle,this.googleRectangle.wpgmzaRectangle=this),this.googleFeature=this.googleRectangle,options&&this.setOptions(options),google.maps.event.addListener(this.googleRectangle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleRectangle.prototype=Object.create(WPGMZA.Rectangle.prototype),WPGMZA.GoogleRectangle.prototype.constructor=WPGMZA.GoogleRectangle,WPGMZA.GoogleRectangle.prototype.getBounds=function(){return WPGMZA.LatLngBounds.fromGoogleLatLngBounds(this.googleRectangle.getBounds())},WPGMZA.GoogleRectangle.prototype.setVisible=function(visible){this.googleRectangle.setVisible(!!visible)},WPGMZA.GoogleRectangle.prototype.setDraggable=function(value){this.googleRectangle.setDraggable(!!value)},WPGMZA.GoogleRectangle.prototype.setEditable=function(value){var self=this;this.googleRectangle.setEditable(!!value),value&&google.maps.event.addListener(this.googleRectangle,"bounds_changed",function(event){self.trigger("change")})},WPGMZA.GoogleRectangle.prototype.setOptions=function(options){WPGMZA.Rectangle.prototype.setOptions.apply(this,arguments),options.cornerA&&options.cornerB&&(this.cornerA=new WPGMZA.LatLng(options.cornerA),this.cornerB=new WPGMZA.LatLng(options.cornerB))},WPGMZA.GoogleRectangle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),north=parseFloat(this.cornerA.lat),west=parseFloat(this.cornerA.lng),south=parseFloat(this.cornerB.lat),east=parseFloat(this.cornerB.lng);north&&west&&south&&east&&(googleOptions.bounds={north:north,west:west,south:south,east:east}),this.googleRectangle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleText=function(options){WPGMZA.Text.apply(this,arguments),this.overlay=new WPGMZA.GoogleTextOverlay(options)},WPGMZA.extend(WPGMZA.GoogleText,WPGMZA.Text)}),jQuery(function($){WPGMZA.GoogleTextOverlay=function(options){this.element=$("<div class='wpgmza-google-text-overlay'><div class='wpgmza-inner'></div></div>"),(options=options||{}).position&&(this.position=options.position),options.text&&this.element.find(".wpgmza-inner").text(options.text),options.map&&this.setMap(options.map.googleMap)},window.google&&google.maps&&google.maps.OverlayView&&(WPGMZA.GoogleTextOverlay.prototype=new google.maps.OverlayView),WPGMZA.GoogleTextOverlay.prototype.onAdd=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"}),this.getPanes().floatPane.appendChild(this.element[0])},WPGMZA.GoogleTextOverlay.prototype.draw=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"})},WPGMZA.GoogleTextOverlay.prototype.onRemove=function(){this.element.remove()},WPGMZA.GoogleTextOverlay.prototype.hide=function(){this.element.hide()},WPGMZA.GoogleTextOverlay.prototype.show=function(){this.element.show()},WPGMZA.GoogleTextOverlay.prototype.toggle=function(){this.element.is(":visible")?this.element.hide():this.element.show()}}),jQuery(function($){"google-maps"==WPGMZA.settings.engine&&(WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code||(WPGMZA.GoogleVertexContextMenu=function(mapEditPage){var self=this;this.mapEditPage=mapEditPage,this.element=document.createElement("div"),this.element.className="wpgmza-vertex-context-menu",this.element.innerHTML="Delete",google.maps.event.addDomListener(this.element,"click",function(event){return self.removeVertex(),event.preventDefault(),event.stopPropagation(),!1})},WPGMZA.GoogleVertexContextMenu.prototype=new google.maps.OverlayView,WPGMZA.GoogleVertexContextMenu.prototype.onAdd=function(){var self=this,map=this.getMap();this.getPanes().floatPane.appendChild(this.element),this.divListener=google.maps.event.addDomListener(map.getDiv(),"mousedown",function(e){e.target!=self.element&&self.close()},!0)},WPGMZA.GoogleVertexContextMenu.prototype.onRemove=function(){google.maps.event.removeListener(this.divListener),this.element.parentNode.removeChild(this.element),this.set("position"),this.set("path"),this.set("vertex")},WPGMZA.GoogleVertexContextMenu.prototype.open=function(map,path,vertex){this.set("position",path.getAt(vertex)),this.set("path",path),this.set("vertex",vertex),this.setMap(map),this.draw()},WPGMZA.GoogleVertexContextMenu.prototype.close=function(){this.setMap(null)},WPGMZA.GoogleVertexContextMenu.prototype.draw=function(){var point=this.get("position"),projection=this.getProjection();point&&projection&&(point=projection.fromLatLngToDivPixel(point),this.element.style.top=point.y+"px",this.element.style.left=point.x+"px")},WPGMZA.GoogleVertexContextMenu.prototype.removeVertex=function(){var path=this.get("path"),vertex=this.get("vertex");path&&null!=vertex&&path.removeAt(vertex),this.close()}))}),jQuery(function($){WPGMZA.FeaturePanel=function(element,mapEditPage){var self=this;WPGMZA.EventDispatcher.apply(this,arguments),this.map=mapEditPage.map,this.drawingManager=mapEditPage.drawingManager,this.feature=null,this.element=element,this.initDefaults(),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.drawingInstructionsElement=$(this.element).find(".wpgmza-feature-drawing-instructions"),this.drawingInstructionsElement.detach(),this.editingInstructionsElement=$(this.element).find(".wpgmza-feature-editing-instructions"),this.editingInstructionsElement.detach(),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.newPanel[0],self.element[0])&&self.onTabActivated(event)}),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.oldPanel[0],self.element[0])&&self.onTabDeactivated(event)}),$(document.body).on("click","[data-edit-"+this.featureType+"-id]",function(event){self.onEditFeature(event)}),$(document.body).on("click","[data-delete-"+this.featureType+"-id]",function(event){self.onDeleteFeature(event)}),$(this.element).find(".wpgmza-save-feature").on("click",function(event){self.onSave(event)}),this.drawingManager.on(self.drawingManagerCompleteEvent,function(event){self.onDrawingComplete(event)}),this.drawingManager.on("drawingmodechanged",function(event){self.onDrawingModeChanged(event)}),$(this.element).on("change input",function(event){self.onPropertyChanged(event)})},WPGMZA.extend(WPGMZA.FeaturePanel,WPGMZA.EventDispatcher),WPGMZA.FeaturePanel.MODE_ADD="add",WPGMZA.FeaturePanel.MODE_EDIT="edit",WPGMZA.FeaturePanel.prevEditableFeature=null,Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"drawingManagerCompleteEvent",{get:function(){return this.featureType+"complete"}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureDataTable",{get:function(){return $("[data-wpgmza-datatable][data-wpgmza-feature-type='"+this.featureType+"']")[0].wpgmzaDataTable}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureAccordion",{get:function(){return $(this.element).closest(".wpgmza-accordion")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"map",{get:function(){return WPGMZA.mapEditPage.map}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"mode",{get:function(){return this._mode}}),WPGMZA.FeaturePanel.prototype.initPreloader=function(){this.preloader||(this.preloader=$(WPGMZA.preloaderHTML),this.preloader.hide(),$(this.element).append(this.preloader))},WPGMZA.FeaturePanel.prototype.initDataTable=function(){var el=$(this.element).find("[data-wpgmza-datatable][data-wpgmza-rest-api-route]");this[this.featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)},WPGMZA.FeaturePanel.prototype.initDefaults=function(){$(this.element).find("[data-ajax-name]:not([type='radio'])").each(function(index,el){var val=$(el).val();val&&$(el).attr("data-default-value",val)})},WPGMZA.FeaturePanel.prototype.setCaptionType=function(type,id){var icons={add:"fa-plus-circle",save:"fa-pencil-square-o"};switch(type){case WPGMZA.FeaturePanel.MODE_ADD:case WPGMZA.FeaturePanel.MODE_EDIT:this.featureAccordion.find("[data-add-caption][data-edit-caption]").each(function(index,el){var text=$(el).attr("data-"+type+"-caption"),icon=$(el).find("i.fa");id&&(text+=" "+id),$(el).text(text),icon.length&&((icon=$("<i class='fa' aria-hidden='true'></i>")).addClass(icons[type]),$(el).prepend(" "),$(el).prepend(icon))});break;default:throw new Error("Invalid type")}},WPGMZA.FeaturePanel.prototype.setMode=function(type,id){this._mode=type,this.setCaptionType(type,id)},WPGMZA.FeaturePanel.prototype.setTargetFeature=function(feature){var prev,self=this;WPGMZA.FeaturePanel.prevEditableFeature&&((prev=WPGMZA.FeaturePanel.prevEditableFeature).setEditable(!1),prev.setDraggable(!1),prev.off("change")),feature?(feature.setEditable(!0),feature.setDraggable(!0),feature.on("change",function(event){self.onFeatureChanged(event)}),this.setMode(WPGMZA.FeaturePanel.MODE_EDIT),this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showInstructions()):this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.feature=WPGMZA.FeaturePanel.prevEditableFeature=feature},WPGMZA.FeaturePanel.prototype.reset=function(){$(this.element).find("[data-ajax-name]:not([data-ajax-name='map_id']):not([type='color']):not([type='checkbox']):not([type='radio'])").val(""),$(this.element).find("select[data-ajax-name]>option:first-child").prop("selected",!0),$(this.element).find("[data-ajax-name='id']").val("-1"),$(this.element).find("input[type='checkbox']").prop("checked",!1),tinyMCE.get("wpgmza-description-editor")?tinyMCE.get("wpgmza-description-editor").setContent(""):$("#wpgmza-description-editor").val(""),$("#wpgmza-description-editor").val(""),this.showPreloader(!1),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),$(this.element).find("[data-ajax-name][data-default-value]").each(function(index,el){$(el).val($(el).data("default-value"))})},WPGMZA.FeaturePanel.prototype.select=function(arg){var id,expectedBaseClass,self=this;if(this.reset(),$.isNumeric(arg))id=arg;else{if(expectedBaseClass=WPGMZA[WPGMZA.capitalizeWords(this.featureType)],!(feature instanceof expectedBaseClass))throw new Error("Invalid feature type for this panel");id=arg.id}this.showPreloader(!0),WPGMZA.animateScroll($(".wpgmza_map")),WPGMZA.restAPI.call("/"+this.featureType+"s/"+id+"?skip_cache=1",{success:function(data,status,xhr){var feature="get"+WPGMZA.capitalizeWords(self.featureType)+"ByID",feature=self.map[feature](id);self.populate(data),self.showPreloader(!1),self.setMode(WPGMZA.FeaturePanel.MODE_EDIT,id),self.setTargetFeature(feature)}})},WPGMZA.FeaturePanel.prototype.showPreloader=function(show){this.initPreloader(),0==arguments.length||show?(this.preloader.fadeIn(),this.element.addClass("wpgmza-loading")):(this.preloader.fadeOut(),this.element.removeClass("wpgmza-loading"))},WPGMZA.FeaturePanel.prototype.populate=function(data){var value,target,name;for(name in data)switch(target=$(this.element).find("[data-ajax-name='"+name+"']"),value=data[name],(target.attr("type")||"").toLowerCase()){case"checkbox":case"radio":target.prop("checked",1==data[name]);break;case"color":value.match(/^#/)||(value="#"+value);default:"object"==typeof value&&(value=JSON.stringify(value)),$(this.element).find("[data-ajax-name='"+name+"']:not(select)").val(value),$(this.element).find("select[data-ajax-name='"+name+"']").each(function(index,el){"string"==typeof value&&0==data[name].length||$(el).val(value)})}},WPGMZA.FeaturePanel.prototype.serializeFormData=function(){var fields=$(this.element).find("[data-ajax-name]"),data={};return fields.each(function(index,el){var type="text";switch($(el).attr("type")&&(type=$(el).attr("type").toLowerCase()),type){case"checkbox":data[$(el).attr("data-ajax-name")]=$(el).prop("checked")?1:0;break;case"radio":$(el).prop("checked")&&(data[$(el).attr("data-ajax-name")]=$(el).val());break;default:data[$(el).attr("data-ajax-name")]=$(el).val()}}),data},WPGMZA.FeaturePanel.prototype.discardChanges=function(){var feature;this.feature&&(feature=this.feature,this.setTargetFeature(null),feature&&feature.map&&(this.map["remove"+WPGMZA.capitalizeWords(this.featureType)](feature),-1<feature.id&&this.updateFeatureByID(feature.id)))},WPGMZA.FeaturePanel.prototype.updateFeatureByID=function(id){var feature,self=this,route="/"+this.featureType+"s/",functionSuffix=WPGMZA.capitalizeWords(self.featureType),getByIDFunction="get"+functionSuffix+"ByID",removeFunction="remove"+functionSuffix,addFunction="add"+functionSuffix;WPGMZA.restAPI.call(route+id,{success:function(data,status,xhr){(feature=self.map[getByIDFunction](id))&&self.map[removeFunction](feature),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature)}})},WPGMZA.FeaturePanel.prototype.showInstructions=function(){this.mode===WPGMZA.FeaturePanel.MODE_ADD?($(this.map.element).append(this.drawingInstructionsElement),$(this.drawingInstructionsElement).hide().fadeIn()):($(this.map.element).append(this.editingInstructionsElement),$(this.editingInstructionsElement).hide().fadeIn())},WPGMZA.FeaturePanel.prototype.onTabActivated=function(){this.reset(),this.drawingManager.setDrawingMode(this.featureType),this.onAddFeature(event),$(".wpgmza-table-container-title").hide(),$(".wpgmza-table-container").hide();var featureString=this.featureType.charAt(0).toUpperCase()+this.featureType.slice(1);$("#wpgmza-table-container-"+featureString).show(),$("#wpgmza-table-container-title-"+featureString).show()},WPGMZA.FeaturePanel.prototype.onTabDeactivated=function(){this.discardChanges(),this.setTargetFeature(null)},WPGMZA.FeaturePanel.prototype.onAddFeature=function(event){this.drawingManager.setDrawingMode(this.featureType)},WPGMZA.FeaturePanel.prototype.onEditFeature=function(event){var id="data-edit-"+this.featureType+"-id",id=$(event.currentTarget).attr(id);this.discardChanges(),this.select(id)},WPGMZA.FeaturePanel.prototype.onDeleteFeature=function(id){var self=this,route="data-delete-"+this.featureType+"-id",id=$(id.currentTarget).attr(route),route="/"+this.featureType+"s/",feature=this.map["get"+WPGMZA.capitalizeWords(this.featureType)+"ByID"](id);this.featureDataTable.dataTable.processing(!0),WPGMZA.restAPI.call(route+id,{method:"DELETE",success:function(data,status,xhr){self.map["remove"+WPGMZA.capitalizeWords(self.featureType)](feature),self.featureDataTable.reload()}})},WPGMZA.FeaturePanel.prototype.onDrawingModeChanged=function(event){$(this.drawingInstructionsElement).detach(),$(this.editingInstructionsElement).detach(),this.drawingManager.mode==this.featureType&&this.showInstructions()},WPGMZA.FeaturePanel.prototype.onDrawingComplete=function(geometryField){var nativeFeature=geometryField["engine"+WPGMZA.capitalizeWords(this.featureType)],formData=this.serializeFormData(),geometryField=$(this.element).find("textarea[data-ajax-name$='data']");delete formData.polydata;nativeFeature=WPGMZA[WPGMZA.capitalizeWords(this.featureType)].createInstance(formData,nativeFeature);this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.map["add"+WPGMZA.capitalizeWords(this.featureType)](nativeFeature),this.setTargetFeature(nativeFeature),geometryField.length&&geometryField.val(JSON.stringify(nativeFeature.getGeometry())),this.featureType},WPGMZA.FeaturePanel.prototype.onPropertyChanged=function(event){var feature=this.feature;feature&&($(this.element).find(":input[data-ajax-name]").each(function(index,el){var key=$(el).attr("data-ajax-name");feature[key]=$(el).val()}),feature.updateNativeFeature())},WPGMZA.FeaturePanel.prototype.onFeatureChanged=function(event){var geometryField=$(this.element).find("textarea[data-ajax-name$='data']");geometryField.length&&geometryField.val(JSON.stringify(this.feature.getGeometry()))},WPGMZA.FeaturePanel.prototype.onSave=function(event){var self=this,id=$(self.element).find("[data-ajax-name='id']").val(),data=this.serializeFormData(),route="/"+this.featureType+"s/",isNew=-1==id;"circle"!=this.featureType||data.center?"rectangle"!=this.featureType||data.cornerA?"polygon"!=this.featureType||data.polydata?"polyline"!=this.featureType||data.polydata?(isNew||(route+=id),WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0),WPGMZA.restAPI.call(route,{method:"POST",data:data,success:function(data,status,xhr){var addFunction=WPGMZA.capitalizeWords(self.featureType),feature="get"+addFunction+"ByID",removeFunction="remove"+addFunction,addFunction="add"+addFunction;self.reset(),(feature=self.map[feature](id))&&self.map[removeFunction](feature),self.setTargetFeature(null),self.showPreloader(!1),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature),self.featureDataTable.reload(),self.onTabActivated(event)}})):alert(WPGMZA.localized_strings.no_shape_polyline):alert(WPGMZA.localized_strings.no_shape_polygon):alert(WPGMZA.localized_strings.no_shape_rectangle):alert(WPGMZA.localized_strings.no_shape_circle)}}),jQuery(function($){WPGMZA.MarkerPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.MarkerPanel,WPGMZA.FeaturePanel),WPGMZA.MarkerPanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProMarkerPanel:WPGMZA.MarkerPanel)(element,mapEditPage)},WPGMZA.MarkerPanel.prototype.initDefaults=function(){var self=this;WPGMZA.FeaturePanel.prototype.initDefaults.apply(this,arguments),this.adjustSubMode=!1,this.onTabActivated(null),$(document.body).on("click","[data-adjust-"+this.featureType+"-id]",function(event){self.onAdjustFeature(event)}),$(document.body).on("click",".wpgmza_approve_btn",function(event){self.onApproveMarker(event)})},WPGMZA.MarkerPanel.prototype.onAdjustFeature=function(event){var id="data-adjust-"+this.featureType+"-id",id=$(event.currentTarget).attr(id);this.discardChanges(),this.adjustSubMode=!0,this.select(id)},WPGMZA.MarkerPanel.prototype.onApproveMarker=function(route){var self=this,route="/"+this.featureType+"s/"+$(route.currentTarget).attr("id");WPGMZA.restAPI.call(route,{method:"POST",data:{approved:"1"},success:function(data,status,xhr){self.featureDataTable.reload()}})},WPGMZA.MarkerPanel.prototype.onFeatureChanged=function(event){var addressField,pos;this.adjustSubMode?(pos=this.feature.getPosition())&&($(this.element).find("[data-ajax-name='lat']").val(pos.lat),$(this.element).find("[data-ajax-name='lng']").val(pos.lng)):(addressField=$(this.element).find("input[data-ajax-name$='address']")).length&&(pos=this.feature.getPosition(),addressField.val(pos.lat+","+pos.lng))},WPGMZA.MarkerPanel.prototype.setTargetFeature=function(feature){var prev;!WPGMZA.FeaturePanel.prevEditableFeature||(prev=WPGMZA.FeaturePanel.prevEditableFeature).setOpacity&&prev.setOpacity(1),$(this.element).find("[data-ajax-name]").removeAttr("disabled"),$(this.element).find("fieldset").show(),$(this.element).find(".wpgmza-adjust-mode-notice").addClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","hidden"),$(this.element).find('[data-ajax-name="lng"]').attr("type","hidden"),$(this.element).find(".wpgmza-hide-in-adjust-mode").removeClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").addClass("wpgmza-hidden"),feature?(feature.setOpacity&&feature.setOpacity(.7),feature.getMap().panTo(feature.getPosition()),this.adjustSubMode&&($(this.element).find("[data-ajax-name]").attr("disabled","disabled"),$(this.element).find("fieldset:not(.wpgmza-always-on)").hide(),$(this.element).find(".wpgmza-adjust-mode-notice").removeClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","text").removeAttr("disabled"),$(this.element).find('[data-ajax-name="lng"]').attr("type","text").removeAttr("disabled"),$(this.element).find(".wpgmza-hide-in-adjust-mode").addClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").removeClass("wpgmza-hidden"))):this.adjustSubMode=!1,WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments)},WPGMZA.MarkerPanel.prototype.onSave=function(event){var self=this,geocoder=WPGMZA.Geocoder.createInstance(),address=$(this.element).find("[data-ajax-name='address']").val(),geocodingData={address:address};WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0);var cloud_lat=!1,addressUnchanged=!1;0<document.getElementsByName("lat").length&&(cloud_lat=document.getElementsByName("lat")[0].value),0<document.getElementsByName("lng").length&&(addressUnchanged=document.getElementsByName("lng")[0].value),cloud_lat&&addressUnchanged&&(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey||(geocodingData.lat=parseFloat(cloud_lat),geocodingData.lng=parseFloat(addressUnchanged)));addressUnchanged=!1;this.feature&&this.feature.address&&address&&"string"==typeof this.feature.address&&"string"==typeof address&&this.feature.address.trim()===address.trim()&&(addressUnchanged=!0),this.adjustSubMode||addressUnchanged?WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments):geocoder.geocode(geocodingData,function(results,status){switch(status){case WPGMZA.Geocoder.ZERO_RESULTS:return alert(WPGMZA.localized_strings.zero_results),void self.showPreloader(!1);case WPGMZA.Geocoder.SUCCESS:break;case WPGMZA.Geocoder.NO_ADDRESS:return alert(WPGMZA.localized_strings.no_address),void self.showPreloader(!1);case WPGMZA.Geocoder.FAIL:default:return alert(WPGMZA.localized_strings.geocode_fail),void self.showPreloader(!1)}var result=results[0];$(self.element).find("[data-ajax-name='lat']").val(result.lat),$(self.element).find("[data-ajax-name='lng']").val(result.lng),WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments)}),WPGMZA.mapEditPage.map.resetBounds()}}),jQuery(function($){WPGMZA.CirclePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.CirclePanel,WPGMZA.FeaturePanel),WPGMZA.CirclePanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProCirclePanel:WPGMZA.CirclePanel)(element,mapEditPage)},WPGMZA.CirclePanel.prototype.updateFields=function(){$(this.element).find("[data-ajax-name='center']").val(this.feature.getCenter().toString()),$(this.element).find("[data-ajax-name='radius']").val(this.feature.getRadius())},WPGMZA.CirclePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.CirclePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.CirclePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}});var wpgmza_autoCompleteDisabled=!1;jQuery(function($){"map-edit"==WPGMZA.currentPage&&(WPGMZA.MapEditPage=function(){var self=this,element=document.body;WPGMZA.EventDispatcher.call(this),$("#wpgmaps_options fieldset").wrapInner("<div class='wpgmza-flex'></div>"),this.themePanel=new WPGMZA.ThemePanel,this.themeEditor=new WPGMZA.ThemeEditor,this.map=WPGMZA.maps[0],(!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.1.0")>=WPGMZA.Version.EQUAL_TO)&&(this.drawingManager=WPGMZA.DrawingManager.createInstance(this.map)),this.initDataTables(),this.initFeaturePanels(),this.initJQueryUIControls(),"en"!==WPGMZA.locale&&$("#datatable_no_result_message,#datatable_search_string").parent().parent().hide(),$("input.wpgmza-address").each(function(index,el){el.addressInput=WPGMZA.AddressInput.createInstance(el,self.map)}),$('#wpgmza-map-edit-page input[type="color"]').each(function(){$("<div class='button-secondary wpgmza-paste-color-btn' title='Paste a HEX color code'><i class='fa fa-clipboard' aria-hidden='true'></i></div>").insertAfter(this)}),jQuery("body").on("click",".wpgmza_ac_result",function(e){var name=jQuery(this).data("id"),lat=jQuery(this).data("lat"),lng=jQuery(this).data("lng"),name=jQuery("#wpgmza_item_address_"+name).html();jQuery("input[name='lat']").val(lat),jQuery("input[name='lng']").val(lng),jQuery("#wpgmza_add_address_map_editor").val(name),jQuery("#wpgmza_autocomplete_search_results").hide()}),jQuery("body").on("click",".wpgmza-paste-color-btn",function(){try{var colorBtn=$(this);if(!navigator||!navigator.clipboard||!navigator.clipboard.readText)return;navigator.clipboard.readText().then(function(textcopy){colorBtn.parent().find('input[type="color"]').val("#"+textcopy.replace("#","").trim())}).catch(function(err){console.error("WP Google Maps: Could not access clipboard",err)})}catch(c_ex){}}),jQuery("body").on("focusout","#wpgmza_add_address_map_editor",function(e){setTimeout(function(){jQuery("#wpgmza_autocomplete_search_results").fadeOut("slow")},500)});var ajaxRequest=!1,wpgmzaAjaxTimeout=!1,wpgmzaStartTyping=!1,wpgmzaKeyStrokeCount=1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0,wpgmzaTmp="",wpgmzaIdentifiedTypingSpeed=!1;$("body").on("keypress",".wpgmza-address",function(e){if("wpgmza_add_address_map_editor"==this.id&&!wpgmza_autoCompleteDisabled){var wpgmza_apikey=!1;if(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey)wpgmza_apikey=WPGMZA_localized_data.settings.googleMapsApiKey;else if("Escape"!==e.key&&"Alt"!==e.key&&"Control"!==e.key&&"Option"!==e.key&&"Shift"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if(!wpgmzaIdentifiedTypingSpeed){var currentSearch=new Date;return clearTimeout(wpgmzaTmp),wpgmzaTmp=setTimeout(function(){wpgmzaStartTyping=!1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0},1500),wpgmzaStartTyping?1==wpgmzaKeyStrokeCount||(wpgmzaCurrentTimeBetweenStrokes=currentSearch.getTime()-wpgmzaStartTyping,wpgmzaTotalTimeForKeyStrokes+=wpgmzaCurrentTimeBetweenStrokes,wpgmzaAvgTimeBetweenStrokes=wpgmzaTotalTimeForKeyStrokes/(wpgmzaKeyStrokeCount-1),wpgmzaStartTyping=currentSearch.getTime(),3<=wpgmzaKeyStrokeCount&&(wpgmzaIdentifiedTypingSpeed=wpgmzaAvgTimeBetweenStrokes)):wpgmzaStartTyping=currentSearch.getTime(),void wpgmzaKeyStrokeCount++}clearTimeout(wpgmzaAjaxTimeout),$("#wpgmza_autocomplete_search_results").html("Searching..."),$("#wpgmza_autocomplete_search_results").show();currentSearch=jQuery(this).val();if(""!==currentSearch){!1!==ajaxRequest&&ajaxRequest.abort();var domain=window.location.hostname;if("localhost"===domain)try{var paths=window.location.pathname.match(/\/(.*?)\//);paths&&2<=paths.length&&paths[1]&&(domain+="-"+paths[1])}catch(ex){}var wpgmza_api_url="",wpgmza_api_url=wpgmza_apikey?"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+domain+"&hash="+WPGMZA_localized_data.siteHash+"&k="+wpgmza_apikey:"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+domain+"&hash="+WPGMZA_localized_data.siteHash;WPGMZA&&WPGMZA.settings&&WPGMZA.settings.engine&&(wpgmza_api_url+="&engine="+WPGMZA.settings.engine),wpgmzaAjaxTimeout=setTimeout(function(){ajaxRequest=$.ajax({url:wpgmza_api_url,type:"GET",dataType:"json",success:function(results){try{if(void 0!==results.error)"error1"==results.error?($("#wpgmza_autoc_disabled").html(WPGMZA.localized_strings.cloud_api_key_error_1),$("#wpgmza_autoc_disabled").fadeIn("slow"),$("#wpgmza_autocomplete_search_results").hide(),wpgmza_autoCompleteDisabled=!0):console.error(results.error);else{$("#wpgmza_autocomplete_search_results").html("");var i,html="";for(i in results)html+="<div class='wpgmza_ac_result "+(""===html?"":"border-top")+"' data-id='"+i+"' data-lat='"+results[i].lat+"' data-lng='"+results[i].lng+"'><div class='wpgmza_ac_container'><div class='wpgmza_ac_icon'><img src='"+results[i].icon+"' /></div><div class='wpgmza_ac_item'><span id='wpgmza_item_name_"+i+"' class='wpgmza_item_name'>"+results[i].place_name+"</span><span id='wpgmza_item_address_"+i+"' class='wpgmza_item_address'>"+results[i].formatted_address+"</span></div></div></div>";""==html&&(html="<div class='p-2 text-center'><small>No results found...</small></div>"),$("#wpgmza_autocomplete_search_results").html(html),$("#wpgmza_autocomplete_search_results").show()}}catch(exception){console.error("WP Google Maps Plugin: There was an error returning the list of places for your search")}}})},2*wpgmzaIdentifiedTypingSpeed)}else $("#wpgmza_autocomplete_search_results").hide()}else $("#wpgmza_autocomplete_search_results").hide()}}),$("#wpgmza_map_height_type").on("change",function(event){self.onMapHeightTypeChange(event)}),$("#advanced-markers .wpgmza-feature-drawing-instructions").remove(),$("[data-search-area='auto']").hide(),$(document.body).on("click","[data-wpgmza-admin-marker-datatable] input[name='mark']",function(event){self.onShiftClick(event)}),$("#wpgmza_map_type").on("change",function(event){self.onMapTypeChanged(event)}),$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand ("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")}),this.on("markerupdated",function(event){self.onMarkerUpdated(event)}),this.map&&(this.map.on("zoomchanged",function(event){self.onZoomChanged(event)}),this.map.on("boundschanged",function(event){self.onBoundsChanged(event)}),this.map.on("rightclick",function(event){self.onRightClick(event)})),$(element).on("click",".wpgmza_poly_del_btn",function(event){self.onDeletePolygon(event)}),$(element).on("click",".wpgmza_polyline_del_btn",function(event){self.onDeletePolyline(event)}),$(element).on("click",".wpgmza_dataset_del_btn",function(evevnt){self.onDeleteHeatmap(event)}),$(element).on("click",".wpgmza_circle_del_btn",function(event){self.onDeleteCircle(event)}),$(element).on("click",".wpgmza_rectangle_del_btn",function(event){self.onDeleteRectangle(event)}),$(element).on("click","#wpgmza-open-advanced-theme-data",function(event){event.preventDefault(),$(".wpgmza_theme_data_container").toggleClass("wpgmza_hidden")})},WPGMZA.extend(WPGMZA.MapEditPage,WPGMZA.EventDispatcher),WPGMZA.MapEditPage.createInstance=function(){return new(WPGMZA.isProVersion()&&WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?WPGMZA.ProMapEditPage:WPGMZA.MapEditPage)},WPGMZA.MapEditPage.prototype.initDataTables=function(){var self=this;$("[data-wpgmza-datatable][data-wpgmza-rest-api-route]").each(function(index,el){var featureType=$(el).attr("data-wpgmza-feature-type");self[featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)})},WPGMZA.MapEditPage.prototype.initFeaturePanels=function(){var self=this;$(".wpgmza-feature-accordion[data-wpgmza-feature-type]").each(function(index,panelClassName){var instance=$(panelClassName).find(".wpgmza-feature-panel-container > *"),featureType=$(panelClassName).attr("data-wpgmza-feature-type"),panelClassName=WPGMZA.capitalizeWords(featureType)+"Panel",instance=WPGMZA[panelClassName].createInstance(instance,self);self[featureType+"Panel"]=instance})},WPGMZA.MapEditPage.prototype.initJQueryUIControls=function(){var mapContainer,self=this;$("#wpgmaps_tabs").tabs(),mapContainer=$("#wpgmza-map-container").detach(),$("#wpgmaps_tabs_markers").tabs(),$(".map_wrapper").prepend(mapContainer),$("#slider-range-max").slider({range:"max",min:1,max:21,value:$("input[name='map_start_zoom']").val(),slide:function(event,ui){$("input[name='map_start_zoom']").val(ui.value),self.map.setZoom(ui.value)}})},WPGMZA.MapEditPage.prototype.onShiftClick=function(startIndex){var currIndex=startIndex.currentTarget,row=jQuery(currIndex).closest("tr");if(this.lastSelectedRow&&startIndex.shiftKey){var prevIndex=this.lastSelectedRow.index(),currIndex=row.index(),startIndex=Math.min(prevIndex,currIndex),endIndex=Math.max(prevIndex,currIndex),rows=jQuery("[data-wpgmza-admin-marker-datatable] tbody>tr");jQuery("[data-wpgmza-admin-marker-datatable] input[name='mark']").prop("checked",!1);for(var i=startIndex;i<=endIndex;i++)jQuery(rows[i]).find("input[name='mark']").prop("checked",!0)}this.lastSelectedRow=row},WPGMZA.MapEditPage.prototype.onMapTypeChanged=function(event){if("open-layers"!=WPGMZA.settings.engine){var mapTypeId;switch(event.target.value){case"2":mapTypeId=google.maps.MapTypeId.SATELLITE;break;case"3":mapTypeId=google.maps.MapTypeId.HYBRID;break;case"4":mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:mapTypeId=google.maps.MapTypeId.ROADMAP}this.map.setOptions({mapTypeId:mapTypeId})}},WPGMZA.MapEditPage.prototype.onMarkerUpdated=function(event){this.markerDataTable.reload()},WPGMZA.MapEditPage.prototype.onZoomChanged=function(event){$(".map_start_zoom").val(this.map.getZoom())},WPGMZA.MapEditPage.prototype.onBoundsChanged=function(event){var location=this.map.getCenter();$("#wpgmza_start_location").val(location.lat+","+location.lng),$("input[name='map_start_lat']").val(location.lat),$("input[name='map_start_lng']").val(location.lng),$("#wpgmza_start_zoom").val(this.map.getZoom()),$("#wpgmaps_save_reminder").show()},WPGMZA.MapEditPage.prototype.onMapHeightTypeChange=function(event){"%"==event.target.value&&$("#wpgmza_height_warning").show()},WPGMZA.MapEditPage.prototype.onRightClick=function(event){var marker,self=this;this.drawingManager&&this.drawingManager.mode!=WPGMZA.DrawingManager.MODE_MARKER||(this.rightClickMarker||(this.rightClickMarker=WPGMZA.Marker.createInstance({draggable:!0}),this.rightClickMarker.on("dragend",function(event){$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+","+event.latLng.lng)}),this.map.on("click",function(event){self.rightClickMarker.setMap(null)})),(marker=this.rightClickMarker).setPosition(event.latLng),marker.setMap(this.map),$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+", "+event.latLng.lng))},WPGMZA.MapEditPage.prototype.onDeletePolygon=function(event){var cur_id=parseInt($(this).attr("id")),data={action:"delete_poly",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_Path[cur_id].setMap(null),delete WPGM_PathData[cur_id],delete WPGM_Path[cur_id],$("#wpgmza_poly_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeletePolyline=function(event){var cur_id=$(this).attr("id"),data={action:"delete_polyline",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_PathLine[cur_id].setMap(null),delete WPGM_PathLineData[cur_id],delete WPGM_PathLine[cur_id],$("#wpgmza_polyline_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteHeatmap=function(event){var cur_id=$(this).attr("id"),data={action:"delete_dataset",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){heatmap[cur_id].setMap(null),delete heatmap[cur_id],$("#wpgmza_heatmap_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteCircle=function(event){var circle_id=$(this).attr("id"),data={action:"delete_circle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,circle_id:circle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-5 table").replaceWith(response),circle_array.forEach(function(circle){if(circle.id==circle_id)return circle.setMap(null),!1})})},WPGMZA.MapEditPage.prototype.onDeleteRectangle=function(event){var rectangle_id=$(this).attr("id"),data={action:"delete_rectangle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,rectangle_id:rectangle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-6 table").replaceWith(response),rectangle_array.forEach(function(rectangle){if(rectangle.id==rectangle_id)return rectangle.setMap(null),!1})})},$(document).ready(function(event){WPGMZA.mapEditPage=WPGMZA.MapEditPage.createInstance()}))}),jQuery(function($){WPGMZA.PolygonPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolygonPanel,WPGMZA.FeaturePanel),WPGMZA.PolygonPanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProPolygonPanel:WPGMZA.PolygonPanel)(element,mapEditPage)},Object.defineProperty(WPGMZA.PolygonPanel.prototype,"drawingManagerCompleteEvent",{get:function(){return"polygonclosed"}})}),jQuery(function($){WPGMZA.PolylinePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolylinePanel,WPGMZA.FeaturePanel),WPGMZA.PolylinePanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProPolylinePanel:WPGMZA.PolylinePanel)(element,mapEditPage)}}),jQuery(function($){WPGMZA.RectanglePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.RectanglePanel,WPGMZA.FeaturePanel),WPGMZA.RectanglePanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProRectanglePanel:WPGMZA.RectanglePanel)(element,mapEditPage)},WPGMZA.RectanglePanel.prototype.updateFields=function(){var bounds=this.feature.getBounds();bounds.north&&bounds.west&&bounds.south&&bounds.east&&($(this.element).find("[data-ajax-name='cornerA']").val(bounds.north+", "+bounds.west),$(this.element).find("[data-ajax-name='cornerB']").val(bounds.south+", "+bounds.east))},WPGMZA.RectanglePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.RectanglePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.RectanglePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}}),jQuery(function($){var Parent=WPGMZA.Circle;WPGMZA.OLCircle=function(options,center){var circle,geom;Parent.call(this,options,center),options=options||{},center?(circle=center.getGeometry(),center=ol.proj.toLonLat(circle.getCenter()),geom=circle,options.center=new WPGMZA.LatLng(center[1],center[0]),options.radius=circle.getRadius()/1e3):geom=new ol.geom.Circle(ol.proj.fromLonLat([parseFloat(options.center.lng),parseFloat(options.center.lat)]),1e3*options.radius),this.layer=new ol.layer.Vector({source:new ol.source.Vector}),this.olFeature=new ol.Feature({geometry:geom}),this.layer.getSource().addFeature(this.olFeature),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaCircle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.OLCircle.prototype=Object.create(Parent.prototype),WPGMZA.OLCircle.prototype.constructor=WPGMZA.OLCircle,WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)},WPGMZA.OLCircle.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olFeature.getGeometry().getCenter());return new WPGMZA.LatLng({lat:lonLat[1],lng:lonLat[0]})},WPGMZA.OLCircle.prototype.recreate=function(){var x,y,circle3857;this.olFeature&&(this.layer.getSource().removeFeature(this.olFeature),delete this.olFeature),this.center&&this.radius&&(circle3857=1e3*parseFloat(this.radius),x=this.center.lng,y=this.center.lat,circle3857=ol.geom.Polygon.circular([x,y],circle3857,64).clone().transform("EPSG:4326","EPSG:3857"),this.olFeature=new ol.Feature(circle3857),this.layer.getSource().addFeature(this.olFeature))},WPGMZA.OLCircle.prototype.setVisible=function(visible){this.layer.setVisible(!!visible)},WPGMZA.OLCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.recreate()},WPGMZA.OLCircle.prototype.getRadius=function(){return this.layer.getSource().getFeatures()[0].getGeometry().getRadius()/1e3},WPGMZA.OLCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments)},WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLDrawingManager=function(map){WPGMZA.DrawingManager.call(this,map),this.source=new ol.source.Vector({wrapX:!1}),this.layer=new ol.layer.Vector({source:this.source})},WPGMZA.OLDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.OLDrawingManager.prototype.constructor=WPGMZA.OLDrawingManager,WPGMZA.OLDrawingManager.prototype.setOptions=function(options){var params={};options.strokeOpacity&&(params.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToRGBA(options.strokeColor,options.strokeOpacity)})),options.fillOpacity&&(params.fill=new ol.style.Fill({color:WPGMZA.hexOpacityToRGBA(options.fillColor,options.fillOpacity)})),this.layer.setStyle(new ol.style.Style(params))},WPGMZA.OLDrawingManager.prototype.setDrawingMode=function(mode){var type,endEventType,self=this;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),this.interaction&&(this.map.olMap.removeInteraction(this.interaction),this.interaction=null),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:return;case WPGMZA.DrawingManager.MODE_POLYGON:type="Polygon",endEventType="polygonclosed";break;case WPGMZA.DrawingManager.MODE_POLYLINE:type="LineString",endEventType="polylinecomplete";break;case WPGMZA.DrawingManager.MODE_CIRCLE:type="Circle",endEventType="circlecomplete";break;case WPGMZA.DrawingManager.MODE_RECTANGLE:type="Circle",endEventType="rectanglecomplete";break;case WPGMZA.DrawingManager.MODE_HEATMAP:return;default:throw new Error("Invalid drawing mode")}WPGMZA.mapEditPage&&WPGMZA.mapEditPage.selectInteraction&&WPGMZA.mapEditPage.map.olMap.removeInteraction(WPGMZA.mapEditPage.selectInteraction);var options={source:this.source,type:type};mode==WPGMZA.DrawingManager.MODE_RECTANGLE&&(options.geometryFunction=ol.interaction.Draw.createBox()),this.interaction=new ol.interaction.Draw(options),this.interaction.on("drawend",function(event){if(endEventType){var WPGMZAEvent=new WPGMZA.Event(endEventType);switch(mode){case WPGMZA.DrawingManager.MODE_POLYGON:WPGMZAEvent.enginePolygon=event.feature;break;case WPGMZA.DrawingManager.MODE_POLYLINE:WPGMZAEvent.enginePolyline=event.feature;break;case WPGMZA.DrawingManager.MODE_CIRCLE:WPGMZAEvent.engineCircle=event.feature;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:WPGMZAEvent.engineRectangle=event.feature;break;default:throw new Error("Drawing mode not implemented")}self.dispatchEvent(WPGMZAEvent)}}),this.map.olMap.addInteraction(this.interaction)}}),jQuery(function($){WPGMZA.OLFeature=function(options){WPGMZA.assertInstangeOf(this,"OLFeature"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.extend(WPGMZA.OLFeature,WPGMZA.Feature),WPGMZA.OLFeature.getOLStyle=function(options){var translated={};if(!options)return new ol.style.Style;var name,weight,color,map={fillcolor:"fillColor",opacity:"fillOpacity",linecolor:"strokeColor",lineopacity:"strokeOpacity",linethickness:"strokeWeight"};for(name in options=$.extend({},options))name in map&&(options[map[name]]=options[name]);return options.strokeColor&&(weight=color=1,"strokeOpacity"in options&&(color=options.strokeOpacity),"strokeWeight"in options&&(weight=options.strokeWeight),translated.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToString(options.strokeColor,color),width:weight})),options.fillColor&&(color=1,"fillOpacity"in options&&(color=options.fillOpacity),color=WPGMZA.hexOpacityToString(options.fillColor,color),translated.fill=new ol.style.Fill({color:color})),new ol.style.Style(translated)},WPGMZA.OLFeature.setInteractionsOnFeature=function(feature,enable){enable?feature.modifyInteraction||(feature.snapInteraction=new ol.interaction.Snap({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.snapInteraction),feature.modifyInteraction=new ol.interaction.Modify({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.modifyInteraction),feature.modifyInteraction.on("modifyend",function(event){feature.trigger("change")})):feature.modifyInteraction&&(feature.map&&(feature.map.olMap.removeInteraction(feature.snapInteraction),feature.map.olMap.removeInteraction(feature.modifyInteraction)),delete feature.snapInteraction,delete feature.modifyInteraction)}}),jQuery(function($){WPGMZA.OLGeocoder=function(){},WPGMZA.OLGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.OLGeocoder.prototype.constructor=WPGMZA.OLGeocoder,WPGMZA.OLGeocoder.prototype.getResponseFromCache=function(query,callback){WPGMZA.restAPI.call("/geocode-cache",{data:{query:JSON.stringify(query)},success:function(response,xhr,status){response.lng=response.lon,callback(response)},useCompressedPathVariable:!0})},WPGMZA.OLGeocoder.prototype.getResponseFromNominatim=function(options,callback){var data={q:options.address,format:"json"};options.componentRestrictions&&options.componentRestrictions.country?data.countrycodes=options.componentRestrictions.country:options.country&&(data.countrycodes=options.country),$.ajax("https://nominatim.openstreetmap.org/search",{data:data,success:function(response,xhr,status){callback(response)},error:function(response,xhr,status){callback(null,WPGMZA.Geocoder.FAIL)}})},WPGMZA.OLGeocoder.prototype.cacheResponse=function(query,response){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_store_nominatim_cache",query:JSON.stringify(query),response:JSON.stringify(response)},method:"POST"})},WPGMZA.OLGeocoder.prototype.clearCache=function(callback){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_clear_nominatim_cache"},method:"POST",success:function(response){callback(response)}})},WPGMZA.OLGeocoder.prototype.getLatLngFromAddress=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.getAddressFromLatLng=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.geocode=function(options,callback){var finish,location,self=this;if(!options)throw new Error("Invalid options");if(WPGMZA.LatLng.REGEXP.test(options.address)){var latLng=WPGMZA.LatLng.fromString(options.address);callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng}],WPGMZA.Geocoder.SUCCESS)}else{if(options.location&&(options.latLng=new WPGMZA.LatLng(options.location)),options.address)location=options.address,finish=function(response,status){for(var i=0;i<response.length;i++)response[i].geometry={location:new WPGMZA.LatLng({lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)})},response[i].latLng={lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)},response[i].bounds=new WPGMZA.LatLngBounds(new WPGMZA.LatLng({lat:response[i].boundingbox[1],lng:response[i].boundingbox[2]}),new WPGMZA.LatLng({lat:response[i].boundingbox[0],lng:response[i].boundingbox[3]})),response[i].lng=response[i].lon;callback(response,status)};else{if(!options.latLng)throw new Error("You must supply either a latLng or address");location=options.latLng.toString(),finish=function(address,status){address=address[0].display_name;callback([address],status)}}var query={location:location,options:options};this.getResponseFromCache(query,function(response){response.length?finish(response,WPGMZA.Geocoder.SUCCESS):self.getResponseFromNominatim($.extend(options,{address:location}),function(response,status){status!=WPGMZA.Geocoder.FAIL?0!=response.length?(finish(response,WPGMZA.Geocoder.SUCCESS),self.cacheResponse(query,response)):callback([],WPGMZA.Geocoder.ZERO_RESULTS):callback(null,WPGMZA.Geocoder.FAIL)})})}}}),jQuery(function($){WPGMZA.OLModernStoreLocatorCircle=function(map,settings){WPGMZA.ModernStoreLocatorCircle.call(this,map,settings)},WPGMZA.OLModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.OLModernStoreLocatorCircle.prototype.constructor=WPGMZA.OLModernStoreLocatorCircle,WPGMZA.OLModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this,olViewportElement=$(this.map.element).children(".ol-viewport");this.canvas=document.createElement("canvas"),this.canvas.className="wpgmza-ol-canvas-overlay",olViewportElement.find(".ol-layers .ol-layer:first-child").prepend(this.canvas),this.renderFunction=function(event){self.canvas.width==olViewportElement.width()&&self.canvas.height==olViewportElement.height()||(self.canvas.width=olViewportElement.width(),self.canvas.height=olViewportElement.height(),$(this.canvas).css({width:olViewportElement.width()+"px",height:olViewportElement.height()+"px"})),self.draw()},this.map.olMap.on("postrender",this.renderFunction)},WPGMZA.OLModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvas.getContext(type)},WPGMZA.OLModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvas.width,height:this.canvas.height}},WPGMZA.OLModernStoreLocatorCircle.prototype.getCenterPixels=function(){return this.map.latLngToPixels(this.settings.center)},WPGMZA.OLModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){return{x:0,y:0}},WPGMZA.OLModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var centerPixels=new WPGMZA.LatLng(this.settings.center),outerPixels=new WPGMZA.LatLng(centerPixels);outerPixels.moveByDistance(km,90);centerPixels=this.map.latLngToPixels(centerPixels),outerPixels=this.map.latLngToPixels(outerPixels);return Math.abs(outerPixels.x-centerPixels.x)},WPGMZA.OLModernStoreLocatorCircle.prototype.getScale=function(){return 1},WPGMZA.OLModernStoreLocatorCircle.prototype.destroy=function(){$(this.canvas).remove(),this.map.olMap.un("postrender",this.renderFunction),this.map=null,this.canvas=null}}),jQuery(function($){var Parent;WPGMZA.OLPolyline=function(options,olFeature){if(WPGMZA.Polyline.call(this,options),olFeature)this.olFeature=olFeature;else{var coordinates=[];if(options&&options.polydata)for(var path=this.parseGeometry(options.polydata),i=0;i<path.length;i++){if(!$.isNumeric(path[i].lat))throw new Error("Invalid latitude");if(!$.isNumeric(path[i].lng))throw new Error("Invalid longitude");coordinates.push(ol.proj.fromLonLat([parseFloat(path[i].lng),parseFloat(path[i].lat)]))}this.olFeature=new ol.Feature({geometry:new ol.geom.LineString(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolyline:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.Polyline,WPGMZA.OLPolyline.prototype=Object.create(Parent.prototype),WPGMZA.OLPolyline.prototype.constructor=WPGMZA.OLPolyline,WPGMZA.OLPolyline.prototype.getGeometry=function(){for(var result=[],coordinates=this.olFeature.getGeometry().getCoordinates(),i=0;i<coordinates.length;i++){var latLng=ol.proj.toLonLat(coordinates[i]),latLng={lat:latLng[1],lng:latLng[0]};result.push(latLng)}return result},WPGMZA.OLPolyline.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){var Parent=WPGMZA.Rectangle;WPGMZA.OLRectangle=function(options,olFeature){var coordinates;Parent.apply(this,arguments),olFeature?this.olFeature=olFeature:(coordinates=[[]],options.cornerA&&options.cornerB&&(coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)]))),this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})),this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]}),style:this.olStyle}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaRectangle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.extend(WPGMZA.OLRectangle,WPGMZA.Rectangle),WPGMZA.OLRectangle.prototype.getBounds=function(){var bottomRightLatLng=this.olFeature.getGeometry().getExtent(),topLeftLatLng=ol.extent.getTopLeft(bottomRightLatLng),bottomRightLatLng=ol.extent.getBottomRight(bottomRightLatLng),topLeftLatLng=ol.proj.toLonLat(topLeftLatLng),bottomRightLatLng=ol.proj.toLonLat(bottomRightLatLng),topLeftLatLng=new WPGMZA.LatLng(topLeftLatLng[1],topLeftLatLng[0]),bottomRightLatLng=new WPGMZA.LatLng(bottomRightLatLng[1],bottomRightLatLng[0]);return new WPGMZA.LatLngBounds(topLeftLatLng,bottomRightLatLng)},WPGMZA.OLRectangle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLText=function(){}}),jQuery(function($){WPGMZA.DataTable=function(element){var version,self=this;if(!$.fn.dataTable)return console.warn("The dataTables library is not loaded. Cannot create a dataTable. Did you enable 'Do not enqueue dataTables'?"),void(WPGMZA.settings.wpgmza_do_not_enqueue_datatables&&WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT&&alert("You have selected 'Do not enqueue DataTables' in WP Google Maps' settings. No 3rd party software is loading the DataTables library. Because of this, the marker table cannot load. Please uncheck this option to use the marker table."));$.fn.dataTable.ext?$.fn.dataTable.ext.errMode="throw":(version=$.fn.dataTable.version||"unknown",console.warn("You appear to be running an outdated or modified version of the dataTables library. This may cause issues with table functionality. This is usually caused by 3rd party software loading an older version of DataTables. The loaded version is "+version+", we recommend version 1.10.12 or above.")),$.fn.dataTable.Api&&$.fn.dataTable.Api.register("processing()",function(show){return this.iterator("table",function(ctx){ctx.oApi._fnProcessingDisplay(ctx,show)})}),this.element=element,(this.element.wpgmzaDataTable=this).dataTableElement=this.getDataTableElement();var settings=this.getDataTableSettings();this.phpClass=$(element).attr("data-wpgmza-php-class"),(this.wpgmzaDataTable=this).useCompressedPathVariable=WPGMZA.restAPI&&WPGMZA.restAPI.isCompressedPathVariableSupported&&WPGMZA.settings.enable_compressed_path_variables,this.method=this.useCompressedPathVariable?"GET":"POST",null==this.getLanguageURL()||"//cdn.datatables.net/plug-ins/1.10.12/i18n/English.json"==this.getLanguageURL()?(this.dataTable=$(this.dataTableElement).DataTable(settings),this.dataTable.ajax.reload()):$.ajax(this.getLanguageURL(),{success:function(response,status,xhr){self.languageJSON=response,self.dataTable=$(self.dataTableElement).DataTable(settings),self.dataTable.ajax.reload()}})},WPGMZA.DataTable.prototype.getDataTableElement=function(){return $(this.element).find("table")},WPGMZA.DataTable.prototype.onAJAXRequest=function(data,settings){var params={phpClass:this.phpClass},attr=$(this.element).attr("data-wpgmza-ajax-parameters");return attr&&$.extend(params,JSON.parse(attr)),$.extend(data,params)},WPGMZA.DataTable.prototype.onDataTableAjaxRequest=function(data,callback,options){var self=this,route=this.element,route=$(route).attr("data-wpgmza-rest-api-route"),options=this.onAJAXRequest(data,options),draw=options.draw;if(delete options.draw,!route)throw new Error("No data-wpgmza-rest-api-route attribute specified");options={method:"POST",useCompressedPathVariable:!0,data:options,dataType:"json",cache:!this.preventCaching,beforeSend:function(xhr){xhr.setRequestHeader("X-DataTables-Draw",draw)},success:function(response,status,xhr){response.draw=draw,self.lastResponse=response,callback(response),$("[data-marker-icon-src]").each(function(index,element){WPGMZA.MarkerIcon.createInstance($(element).attr("data-marker-icon-src")).applyToElement(element)})}};return WPGMZA.restAPI.call(route,options)},WPGMZA.DataTable.prototype.getDataTableSettings=function(){var self=this,languageURL=this.element,options={};$(languageURL).attr("data-wpgmza-datatable-options")&&(options=JSON.parse($(languageURL).attr("data-wpgmza-datatable-options"))),options.deferLoading=!0,options.processing=!0,options.serverSide=!0,options.ajax=function(data,callback,settings){return WPGMZA.DataTable.prototype.onDataTableAjaxRequest.apply(self,arguments)},WPGMZA.AdvancedTableDataTable&&this instanceof WPGMZA.AdvancedTableDataTable&&WPGMZA.settings.wpgmza_default_items&&(options.iDisplayLength=parseInt(WPGMZA.settings.wpgmza_default_items)),options.aLengthMenu=[[5,10,25,50,100,-1],["5","10","25","50","100",WPGMZA.localized_strings.all]];languageURL=this.getLanguageURL();return languageURL&&(options.language={url:languageURL}),options},WPGMZA.DataTable.prototype.getLanguageURL=function(){if(!WPGMZA.locale)return null;var languageURL;switch(WPGMZA.locale.substr(0,2)){case"af":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Afrikaans.json";break;case"sq":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Albanian.json";break;case"am":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Amharic.json";break;case"ar":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Arabic.json";break;case"hy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Armenian.json";break;case"az":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Azerbaijan.json";break;case"bn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bangla.json";break;case"eu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Basque.json";break;case"be":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Belarusian.json";break;case"bg":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bulgarian.json";break;case"ca":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Catalan.json";break;case"zh":languageURL="zh_TW"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Chinese-traditional.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Chinese.json";break;case"hr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Croatian.json";break;case"cs":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Czech.json";break;case"da":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Danish.json";break;case"nl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Dutch.json";break;case"et":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Estonian.json";break;case"fi":languageURL=WPGMZA.locale.match(/^fil/)?WPGMZA.pluginDirURL+"languages/datatables/Filipino.json":WPGMZA.pluginDirURL+"languages/datatables/Finnish.json";break;case"fr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/French.json";break;case"gl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Galician.json";break;case"ka":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Georgian.json";break;case"de":languageURL=WPGMZA.pluginDirURL+"languages/datatables/German.json";break;case"el":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Greek.json";break;case"gu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Gujarati.json";break;case"he":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hebrew.json";break;case"hi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hindi.json";break;case"hu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hungarian.json";break;case"is":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Icelandic.json";break;case"id":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Indonesian.json";break;case"ga":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Irish.json";break;case"it":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Italian.json";break;case"ja":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Japanese.json";break;case"kk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kazakh.json";break;case"ko":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Korean.json";break;case"ky":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kyrgyz.json";break;case"lv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Latvian.json";break;case"lt":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Lithuanian.json";break;case"mk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Macedonian.json";break;case"ml":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Malay.json";break;case"mn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Mongolian.json";break;case"ne":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Nepali.json";break;case"nb":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Bokmal.json";break;case"nn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Nynorsk.json";break;case"ps":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Pashto.json";break;case"fa":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Persian.json";break;case"pl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Polish.json";break;case"pt":languageURL="pt_BR"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Portuguese-Brasil.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Portuguese.json";break;case"ro":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Romanian.json";break;case"ru":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Russian.json";break;case"sr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Serbian.json";break;case"si":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Sinhala.json";break;case"sk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovak.json";break;case"sl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovenian.json";break;case"es":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Spanish.json";break;case"sw":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swahili.json";break;case"sv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swedish.json";break;case"ta":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Tamil.json";break;case"te":languageURL=WPGMZA.pluginDirURL+"languages/datatables/telugu.json";break;case"th":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Thai.json";break;case"tr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Turkish.json";break;case"uk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Ukrainian.json";break;case"ur":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Urdu.json";break;case"uz":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Uzbek.json";break;case"vi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Vietnamese.json";break;case"cy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Welsh.json"}return languageURL},WPGMZA.DataTable.prototype.onAJAXResponse=function(response){},WPGMZA.DataTable.prototype.reload=function(){this.dataTable.ajax.reload(null,!1)}}),jQuery(function($){WPGMZA.AdminFeatureDataTable=function(element){var self=this;this.allSelected=!1,WPGMZA.DataTable.call(this,element),$(element).on("click",".wpgmza.bulk_delete",function(event){self.onBulkDelete(event)}),$(element).on("click",".wpgmza.select_all_markers",function(event){self.onSelectAll(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.extend(WPGMZA.AdminFeatureDataTable,WPGMZA.DataTable),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featurePanel",{get:function(){return WPGMZA.mapEditPage[this.featureType+"Panel"]}}),WPGMZA.AdminFeatureDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,meta){meta=self.lastResponse.meta[meta];row.wpgmzaFeatureData=meta},options},WPGMZA.AdminFeatureDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0],plural=this.featureType+"s";$(this.element).find("input[name='mark']:checked").each(function(index,row){row=$(row).closest("tr")[0];ids.push(row.wpgmzaFeatureData.id)}),ids.forEach(function(marker){marker=map.getMarkerByID(marker);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/"+plural+"/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminFeatureDataTable.prototype.onSelectAll=function(event){this.allSelected=!this.allSelected;var self=this;$(this.element).find("input[name='mark']").each(function(){self.allSelected?$(this).prop("checked",!0):$(this).prop("checked",!1)})},WPGMZA.AdminFeatureDataTable.prototype.onCenterMarker=function(latLng){latLng=null==latLng.currentTarget?latLng:$(latLng.currentTarget).attr("data-center-marker-id"),latLng=WPGMZA.mapEditPage.map.getMarkerByID(latLng);latLng&&(latLng=new WPGMZA.LatLng({lat:latLng.lat,lng:latLng.lng}),WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.animateScroll("#wpgmaps_tabs_markers"))}}),jQuery(function($){WPGMZA.AdminMapDataTable=function(element){var self=this;WPGMZA.DataTable.call(this,element),$(element).on("mousedown","button[data-action='edit']",function(event){switch(event.which){case 1:var map_id=$(event.target).attr("data-map-id");window.location.href=window.location.href+"&action=edit&map_id="+map_id;break;case 2:map_id=$(event.target).attr("data-map-id");window.open(window.location.href+"&action=edit&map_id="+map_id)}}),$(element).find(".wpgmza.select_all_maps").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete_maps").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","button[data-action='duplicate']",function(map_id){map_id=$(map_id.target).attr("data-map-id");self.dataTable.processing(!0),WPGMZA.restAPI.call("/maps/",{method:"POST",data:{id:map_id,action:"duplicate"},success:function(response,status,xhr){self.reload()}})}),$(element).on("click","button[data-action='trash']",function(map_id){var result=confirm(WPGMZA.localized_strings.map_delete_prompt_text);self.dataTable.processing(!0),result&&(map_id=$(map_id.target).attr("data-map-id"),WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{id:map_id},success:function(response,status,xhr){self.reload()}}))})},WPGMZA.extend(WPGMZA.AdminMapDataTable,WPGMZA.DataTable),WPGMZA.AdminMapDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,meta){meta=self.lastResponse.meta[meta];row.wpgmzaMapData=meta},options},WPGMZA.AdminMapDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMapDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[];$(this.element).find("input[name='mark']:checked").each(function(index,row){row=$(row).closest("tr")[0];ids.push(row.wpgmzaMapData.id)}),confirm(WPGMZA.localized_strings.map_bulk_delete_prompt_text)&&WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},$(document).ready(function(event){$("[data-wpgmza-admin-map-datatable]").each(function(index,el){WPGMZA.AdminMapDataTable=new WPGMZA.AdminMapDataTable(el)})})}),jQuery(function($){WPGMZA.AdminMarkerDataTable=function(element){var self=this;this.preventCaching=!0,WPGMZA.DataTable.call(this,element),$(element).on("click","[data-delete-marker-id]",function(event){self.onDeleteMarker(event)}),$(element).find(".wpgmza.select_all_markers").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.AdminMarkerDataTable.prototype=Object.create(WPGMZA.DataTable.prototype),WPGMZA.AdminMarkerDataTable.prototype.constructor=WPGMZA.AdminMarkerDataTable,WPGMZA.AdminMarkerDataTable.createInstance=function(element){return new WPGMZA.AdminMarkerDataTable(element)},WPGMZA.AdminMarkerDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,meta){meta=self.lastResponse.meta[meta];row.wpgmzaMarkerData=meta},options},WPGMZA.AdminMarkerDataTable.prototype.onEditMarker=function(event){WPGMZA.animatedScroll("#wpgmaps_tabs_markers")},WPGMZA.AdminMarkerDataTable.prototype.onDeleteMarker=function(data){var self=this,id=$(data.currentTarget).attr("data-delete-marker-id"),data={action:"delete_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:id};$.post(ajaxurl,data,function(response){WPGMZA.mapEditPage.map.removeMarkerByID(id),self.reload()})},WPGMZA.AdminMarkerDataTable.prototype.onApproveMarker=function(event){var data=$(this).attr("id"),data={action:"approve_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:data};$.post(ajaxurl,data,function(response){wpgmza_InitMap(),wpgmza_reinitialisetbl()})},WPGMZA.AdminMarkerDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMarkerDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0];$(this.element).find("input[name='mark']:checked").each(function(index,row){row=$(row).closest("tr")[0];ids.push(row.wpgmzaMarkerData.id)}),ids.forEach(function(marker){marker=map.getMarkerByID(marker);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/markers/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminMarkerDataTable.prototype.onCenterMarker=function(latLng){latLng=null==latLng.currentTarget?latLng:$(latLng.currentTarget).attr("data-center-marker-id"),latLng=WPGMZA.mapEditPage.map.getMarkerByID(latLng);latLng&&(latLng=new WPGMZA.LatLng({lat:latLng.lat,lng:latLng.lng}),WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.mapEditPage.map.setZoom(6),WPGMZA.animateScroll("#wpgmaps_tabs_markers"))}}),jQuery(function($){WPGMZA.AdvancedPage=function(){$("#wpgmaps_tabs").tabs(),WPGMZA.restAPI.call("/markers?action=count-duplicates",{success:function(result){}}),$("button#wpgmza-remove-duplicates").on("click",function(event){confirm(WPGMZA.localized_strings.confirm_remove_duplicates)&&($(event.target).prop("disabled",!0),WPGMZA.restAPI.call("/markers?action=remove-duplicates",{success:function(result){alert(result.message),$(event.target).prop("disabled",!1)}}))})},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_ADVANCED&&(WPGMZA.advancedPage=new WPGMZA.AdvancedPage)})}),jQuery(function($){WPGMZA.CategoriesPage=function(){0<$(".wpgmza-marker-icon-picker").length&&(this.markerIconPicker=new WPGMZA.MarkerIconPicker($(".wpgmza-marker-icon-picker")))},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_CATEGORIES&&(WPGMZA.categoriesPage=new WPGMZA.CategoriesPage)})}),jQuery(function($){WPGMZA.CategoryPicker=function(element){var self=this,data=JSON.parse($(element).attr("data-js-tree-data"));this.element=element,this.input=$(this.element).find("input.wpgmza-category-picker-input"),$(this.element).jstree({core:{data:data},plugins:["checkbox"]}).on("loaded.jstree",function(){$(self.element).jstree("open_all")}),$(this.element).after(this.input),$(this.element).on("changed.jstree",function(e,data){self.input.val(self.getSelection().join(","))})},WPGMZA.CategoryPicker.prototype.getSelection=function(){return $(this.element).jstree("get_selected")},WPGMZA.CategoryPicker.prototype.setSelection=function(arr){$(this.element).jstree("deselect_all"),arr&&$(this.element).jstree("select_node",arr)}}),jQuery(function($){WPGMZA.CategoryTreeNode=function(options){for(var name in this.children=[],options)if("children"===name)for(var i=0;i<options.children.length;i++){var child=WPGMZA.CategoryTreeNode.createInstance(options.children[i]);(child.parent=this).children.push(child)}else this[name]=options[name]},WPGMZA.extend(WPGMZA.CategoryTreeNode,WPGMZA.EventDispatcher),WPGMZA.CategoryTreeNode.createInstance=function(options){return new WPGMZA.CategoryTreeNode(options)},WPGMZA.CategoryTreeNode.prototype.getChildByID=function(id){if(this.id==id)return this;for(var i=0;i<this.children.length;i++){var result=this.children[i].getChildByID(id);if(result)return result}return null}}),jQuery(function($){WPGMZA.CategoryTree=function(options){WPGMZA.CategoryTreeNode.call(this,options)},WPGMZA.extend(WPGMZA.CategoryTree,WPGMZA.CategoryTreeNode),WPGMZA.CategoryTree.createInstance=function(options){return new WPGMZA.CategoryTree(options)},WPGMZA.CategoryTree.prototype.getCategoryByID=function(id){return this.getChildByID(id)},WPGMZA.categoryTreeData&&(WPGMZA.categories=WPGMZA.CategoryTree.createInstance(WPGMZA.categoryTreeData),delete WPGMZA.categoryTreeData)}),jQuery(function($){WPGMZA.CustomFieldFilterController=function(map_id){var self=this;this.map_id=map_id,this.widgets=[],this.ajaxTimeoutID=null,this.ajaxRequest=null,this.markerListingCSS=$("<style type='text/css'/>"),$(document.body).append(this.markerListingCSS),WPGMZA.CustomFieldFilterController.controllersByMapID[map_id]=this,$("[data-wpgmza-filter-widget-class][data-map-id="+map_id+"]").each(function(index,el){self.widgets.push(WPGMZA.CustomFieldFilterWidget.createInstance(el)),$(el).on("input change",function(event){self.onWidgetChanged(event)}),$(el).is(":checkbox")&&$(el).on("click",function(event){self.onWidgetChanged(event)})});var container=$(".wpgmza-filter-widgets[data-map-id='"+map_id+"']");$(container).find("button.wpgmza-reset-custom-fields").on("click",function(event){$(container).find("input:not([type='checkbox']):not([type='radio']), textarea").val(""),$(container).find("input[type='checkbox']").prop("checked",!1),$(container).find("select").val(""),self.onWidgetChanged()})},WPGMZA.CustomFieldFilterController.AJAX_DELAY=500,WPGMZA.CustomFieldFilterController.controllersByMapID={},WPGMZA.CustomFieldFilterController.dataTablesSourceHTMLByMapID={},WPGMZA.CustomFieldFilterController.createInstance=function(map_id){return new WPGMZA.CustomFieldFilterController(map_id)},WPGMZA.CustomFieldFilterController.prototype.getAjaxRequestData=function(){var self=this,result={url:WPGMZA.ajaxurl,method:"POST",data:{action:"wpgmza_custom_field_filter_get_filtered_marker_ids",map_id:this.map_id,widgetData:[]},success:function(response,status,xhr){self.onAjaxResponse(response,status,xhr)}};return this.widgets.forEach(function(widget){result.data.widgetData.push(widget.getAjaxRequestData())}),result},WPGMZA.CustomFieldFilterController.prototype.onWidgetChanged=function(event){var map=WPGMZA.getMapByID(this.map_id);map.markerListing&&map.markerListing.dataTable&&map.markerListing.dataTable.dataTable&&map.markerListing.dataTable.dataTable.page(1).draw(),map.markerFilter.update({},this)},WPGMZA.CustomFieldFilterController.prototype.onAjaxResponse=function(response,status,xhr){this.lastResponse=response;var marker_id,container,selectors=[];for(marker_id in marker_array[this.map_id]){var visible=0==response.marker_ids.length||-1<response.marker_ids.indexOf(marker_id);marker_array[this.map_id][marker_id].setVisible(visible),visible||selectors.push(".wpgmaps_mlist_row[mid='"+marker_id+"']")}wpgmaps_localize[this.map_id].order_markers_by&&2==wpgmaps_localize[this.map_id].order_markers_by?wpgmza_update_data_table(WPGMZA.CustomFieldFilterController.dataTablesSourceHTMLByMapID[this.map_id],this.map_id):(this.markerListingCSS.html(selectors.join(", ")+"{ display: none; }"),container=this.currAdvancedTableHTML?$("#wpgmza_marker_holder_"+this.map_id):$(this.currAdvancedTableHTML),this.applyToAdvancedTable(container))},WPGMZA.CustomFieldFilterController.prototype.reapplyLastResponse=function(){if(this.lastResponse){var marker_id,response=this.lastResponse;for(marker_id in marker_array[this.map_id]){var visible=-1<response.marker_ids.indexOf(marker_id);marker_array[this.map_id][marker_id].setVisible(visible)}}},WPGMZA.CustomFieldFilterController.prototype.applyToAdvancedTable=function(){var response,container;this.lastResponse&&(response=this.lastResponse,container=$("#wpgmza_marker_holder_"+this.map_id),$(container).find("[mid]").each(function(index,el){var marker_id=$(el).attr("mid");-1==response.marker_ids.indexOf(marker_id)&&$(el).remove()}))},$(window).on("load",function(event){1!=WPGMZA.is_admin&&$(".wpgmza_map").each(function(index,el){parseInt($(el).attr("id").match(/\d+/)[0]);setTimeout(function(){$(el).children("div").first().after($(".wpgmza-modern-marker-open-button"))},500)})})}),jQuery(function($){WPGMZA.CustomFieldFilterWidget=function(element){this.element=element},WPGMZA.CustomFieldFilterWidget.createInstance=function(element){var widgetPHPClass=$(element).attr("data-wpgmza-filter-widget-class"),constructor=null;switch(widgetPHPClass){case"WPGMZA\\CustomFieldFilterWidget\\Text":constructor=WPGMZA.CustomFieldFilterWidget.Text;break;case"WPGMZA\\CustomFieldFilterWidget\\Dropdown":constructor=WPGMZA.CustomFieldFilterWidget.Dropdown;break;case"WPGMZA\\CustomFieldFilterWidget\\Checkboxes":constructor=WPGMZA.CustomFieldFilterWidget.Checkboxes;break;case"WPGMZA\\CustomFieldFilterWidget\\Time":constructor=WPGMZA.CustomFieldFilterWidget.Time;break;case"WPGMZA\\CustomFieldFilterWidget\\Date":constructor=WPGMZA.CustomFieldFilterWidget.Date;break;default:throw new Error("Unknown field type '"+widgetPHPClass+"'")}return new constructor(element)},WPGMZA.CustomFieldFilterWidget.prototype.getAjaxRequestData=function(){return{field_id:$(this.element).attr("data-field-id"),value:$(this.element).val()}},WPGMZA.CustomFieldFilterWidget.Text=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Text.prototype=Object.create(WPGMZA.CustomFieldFilterWidget.prototype),WPGMZA.CustomFieldFilterWidget.Text.prototype.constructor=WPGMZA.CustomFieldFilterWidget.Text,WPGMZA.CustomFieldFilterWidget.Dropdown=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Dropdown.prototype=Object.create(WPGMZA.CustomFieldFilterWidget.prototype),WPGMZA.CustomFieldFilterWidget.Dropdown.prototype.constructor=WPGMZA.CustomFieldFilterWidget.Dropdown,WPGMZA.CustomFieldFilterWidget.Checkboxes=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Checkboxes.prototype=Object.create(WPGMZA.CustomFieldFilterWidget.prototype),WPGMZA.CustomFieldFilterWidget.Checkboxes.prototype.constructor=WPGMZA.CustomFieldFilterWidget.Checkboxes,WPGMZA.CustomFieldFilterWidget.Checkboxes.prototype.getAjaxRequestData=function(){var checked=[];return $(this.element).find(":checked").each(function(index,el){checked.push($(el).val())}),{field_id:$(this.element).attr("data-field-id"),value:checked}},$(document.body).on("mouseover",".wpgmza-placeholder-label",function(event){$(event.currentTarget).children("ul.wpgmza-checkboxes").stop(!0,!1).fadeIn()}),$(document.body).on("mouseleave",".wpgmza-placeholder-label",function(event){$(event.currentTarget).children("ul.wpgmza-checkboxes").stop(!0,!1).fadeOut()}),WPGMZA.CustomFieldFilterWidget.Time=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Time.prototype.getAjaxRequestData=function(){var field_id=$(this.element).attr("data-field-id");return{field_id:field_id,value_start:$('[data-field-id="'+field_id+'"][data-date-start="true"]').val(),value_end:$('[data-field-id="'+field_id+'"][data-date-end="true"]').val(),type:"time"}},WPGMZA.CustomFieldFilterWidget.Date=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Date.prototype.getAjaxRequestData=function(){var field_id=$(this.element).attr("data-field-id");return{field_id:field_id,value_start:$('[data-field-id="'+field_id+'"][data-date-start="true"]').val(),value_end:$('[data-field-id="'+field_id+'"][data-date-end="true"]').val(),type:"date"}}}),jQuery(function($){WPGMZA.DirectionsBox=function(map){var self=this;if(this.map=map,this.element=$("#wpgmaps_directions_edit_"+map.id),this.element[0].wpgmzaMap=map,$(this.element).find("input.wpgmza-address").each(function(index,el){el.wpgmzaAddressInput=WPGMZA.AddressInput.createInstance(el,map)}),this.optionsElement=this.element.find(".wpgmza-directions-options"),this.optionsElement.hide(),this.showOptionsElement=this.element.find("#wpgmza_show_options_"+map.id),this.showOptionsElement.on("click",function(event){self.onShowOptions(event)}),this.hideOptionsElement=this.element.find("#wpgmza_hide_options_"+map.id),this.hideOptionsElement.on("click",function(event){self.onHideOptions(event)}),this.hideOptionsElement.hide(),this.waypointTemplateItem=$(this.element).find(".wpgmaps_via.wpgmaps_template"),this.waypointTemplateItem.removeClass("wpgmaps_template"),this.waypointTemplateItem.remove(),this.element.find(".wpgmaps_add_waypoint a").on("click",function(event){self.onAddWaypoint(event)}),this.element.on("click",".wpgmza_remove_via",function(event){self.onRemoveWaypoint(event)}),this.element.on("click",".wpgmza-travel-mode-option",function(){var mode=jQuery(this).data("mode");self.travelMode=mode,jQuery("body").find(".wpgmza-travel-mode-option").removeClass("wpgmza-travel-option__selected"),jQuery(this).addClass("wpgmza-travel-option__selected"),jQuery("body").find(".wpgmza-travel-mode").val(mode)}),$("body").sortable&&$(this.element).find(".wpgmaps_directions_outer_div [data-map-id]").sortable({items:".wpgmza-form-field.wpgmaps_via"}),this.getDirectionsButton=this.element.find(".wpgmaps_get_directions"),this.getDirectionsButton.on("click",function(event){self.onGetDirections()}),$(this.element).find(".wpgmza-reset-directions").on("click",function(event){self.onResetDirections(event)}),$(this.element).find(".wpgmza-print-directions").on("click",function(event){self.onPrintDirections(event)}),this.service=WPGMZA.DirectionsService.createInstance(map),this.renderer=WPGMZA.DirectionsRenderer.createInstance(map),this.map.shortcodeAttributes.directions_from&&$("#wpgmza_input_from_"+this.map.id).val(this.map.shortcodeAttributes.directions_from),this.map.shortcodeAttributes.directions_to&&$("#wpgmza_input_to_"+this.map.id).val(this.map.shortcodeAttributes.directions_to),this.map.shortcodeAttributes.directions_waypoints)for(var addresses=this.map.shortcodeAttributes.directions_waypoints.split("|"),i=0;i<addresses.length;i++)this.addWaypoint(addresses[i]);"true"==this.map.shortcodeAttributes.directions_auto&&this.route(),this.openExternal&&this.isUsingAppleMaps&&$(".wpgmza-add-waypoint").hide()},WPGMZA.DirectionsBox.prototype=Object.create(WPGMZA.EventDispatcher),WPGMZA.DirectionsBox.prototype.constructor=WPGMZA.DirectionsBox,WPGMZA.DirectionsBox.STYLE_DEFAULT="default",WPGMZA.DirectionsBox.STYLE_MODERN="modern",WPGMZA.DirectionsBox.STATE_INPUT="input",WPGMZA.DirectionsBox.STATE_DISPLAY="display",WPGMZA.DirectionsBox.forceGoogleMaps=!1,WPGMZA.DirectionsBox.createInstance=function(map){return new(!WPGMZA.isModernComponentStyleAllowed()||"modern"!=map.settings.directions_box_style&&"modern"!=WPGMZA.settings.user_interface_style?WPGMZA.DirectionsBox:WPGMZA.ModernDirectionsBox)(map)},Object.defineProperty(WPGMZA.DirectionsBox.prototype,"style",{get:function(){return this.map.settings.directions_box_style}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"state",{set:function(value){switch($(".wpgmza-directions-box[data-map-id='"+this.map.id+"']").show(),value){case WPGMZA.DirectionsBox.STATE_INPUT:$("#wpgmaps_directions_editbox_"+this.map.id).show("slow"),$("#wpgmaps_directions_notification_"+this.map.id).hide("slow"),$(this.element).find("input.wpgmza-get-directions").show(),$(this.element).find("a.wpgmza-reset-directions").hide(),$(this.element).find("a.wpgmza-print-directions").hide();break;case WPGMZA.DirectionsBox.STATE_DISPLAY:$("#wpgmaps_directions_editbox_"+this.map.id).hide("slow"),$("#wpgmaps_directions_notification_"+this.map.id).show("slow"),$(this.element).find("input.wpgmza-get-directions").hide(),$(this.element).find("a.wpgmza-reset-directions").show(),$(this.element).find("a.wpgmza-print-directions").show();break;default:throw new Error("Unknown state")}}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"start",{get:function(){return this.from}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"end",{get:function(){return this.to}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"from",{get:function(){return $("#wpgmza_input_from_"+this.map.id).val()},set:function(value){$("#wpgmza_input_from_"+this.map.id).val(value)}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"to",{get:function(){return $("#wpgmza_input_to_"+this.map.id).val()},set:function(value){$("#wpgmza_input_to_"+this.map.id).val(value)}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"avoidTolls",{get:function(){return $("#wpgmza_tolls_"+this.map.id).is(":checked")}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"avoidHighways",{get:function(){return $("#wpgmza_highways_"+this.map.id).is(":checked")}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"avoidFerries",{get:function(){return $("#wpgmza_ferries_"+this.map.id).is(":checked")}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"travelMode",{get:function(){return $("#wpgmza_dir_type_"+this.map.id).val()}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"travelModeShort",{get:function(){return this.travelMode.substr(0,1).toLowerCase()}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"openExternal",{get:function(){return"external"==this.map.settings.directions_behaviour||"intelligent"==this.map.settings.directions_behaviour&&WPGMZA.isTouchDevice()}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"isUsingAppleMaps",{get:function(){return navigator.platform.match(/iPhone|iPod|iPad/)&&!this.map.settings.force_google_directions_app}}),WPGMZA.DirectionsBox.prototype.getAjaxParameters=function(){var request={origin:this.from,destination:this.to,provideRouteAlternatives:!0,avoidHighways:this.avoidHighways,avoidTolls:this.avoidTolls,avoidFerries:this.avoidFerries,travelMode:this.travelMode,unitSystem:this.map.settings.store_locator_distance},addresses=this.getWaypointAddresses(),waypoints=[];if(addresses.length){for(var i in addresses){var location=addresses[i];waypoints[i]={location:location,stopover:!1}}request.waypoints=waypoints}return request},WPGMZA.DirectionsBox.prototype.getWaypointAddresses=function(){$("#wpgmza_input_waypoints_"+this.map.id).val();var elements=$("#wpgmaps_directions_edit_"+this.map.id+" input.wpgmaps_via"),values=[];return elements.length&&elements.each(function(index,el){values.push($(el).val())}),values},WPGMZA.DirectionsBox.prototype.getExternalURLParameters=function(options){var waypoints;if("apple"==(options=options||{}).scheme?(params={saddr:this.from,daddr:this.to},options.marker&&(params.daddr=options.marker.address)):(params={api:1,origin:this.from,destination:this.to,travelmode:this.travelMode},(waypoints=this.getWaypointAddresses()).length&&(params.waypoints=waypoints.join("|")),options.marker&&(params.destination=options.marker.address)),"string"!=options.format)return params;var name,components=[];for(name in params)components.push(name+"="+encodeURIComponent(params[name]));return"?"+components.join("&")},WPGMZA.DirectionsBox.prototype.getExternalURL=function(options){return options=options||{},options=$.extend(options,{format:"string"}),this.isUsingAppleMaps?(options.scheme="apple","https://maps.apple.com/maps"+this.getExternalURLParameters(options)):"https://www.google.com/maps/dir/"+this.getExternalURLParameters(options)},WPGMZA.DirectionsBox.prototype.route=function(){var params,self=this;""!=this.from||""!=this.to?(params=this.getAjaxParameters(),"legacy"==WPGMZA.settings.user_interface_style&&"modern"==self.map.settings.directions_box_style||WPGMZA.settings.user_interface_style,this.state=WPGMZA.DirectionsBox.STATE_DISPLAY,this.map.modernDirectionsBox&&this.map.modernDirectionsBox.open(),this.service.route(params,function(response,status){switch(status){case WPGMZA.DirectionsService.SUCCESS:$("#wpgmaps_directions_notification_"+self.map.id).html(""),$("#directions_panel_"+self.map.id).show(),self.renderer.setDirections(response);break;case WPGMZA.DirectionsService.ZERO_RESULTS:self.state=WPGMZA.DirectionsBox.STATE_INPUT,$("#wpgmaps_directions_notification_"+self.map.id).html(WPGMZA.localized_strings.zero_results),self.reset();break;case WPGMZA.DirectionsService.NOT_FOUND:if(self.state=WPGMZA.DirectionsBox.STATE_INPUT,$("#wpgmaps_directions_notification_"+self.map.id).html(WPGMZA.localized_strings.zero_results),self.reset(),response.geocoded_waypoints&&response.geocoded_waypoints.length)for(var i=0;i<response.geocoded_waypoints.length;i++)(status=response.geocoded_waypoints[i].geocoder_status)==WPGMZA.DirectionsService.NOT_FOUND&&(0==i?$(self.element).find(".wpgmza-directions-from"):i==response.geocoded_waypoints.length-1?$(self.element).find(".wpgmza-directions-to"):$($(self.element).find("div.wpgmza-waypoint-via")[i-1])).addClass("wpgmza-not-found");break;default:alert(WPGMZA.localized_strings.unknown_directions_service_status),this.state=WPGMZA.DirectionsBox.STATE_INPUT}})):alert(WPGMZA.localized_strings.please_fill_out_both_from_and_to_fields)},WPGMZA.DirectionsBox.prototype.reset=function(){$("#wpgmaps_directions_editbox_"+this.map.id).show(),$("#directions_panel_"+this.map.id).hide(),$("#directions_panel_"+this.map.id).html(""),$("#wpgmaps_directions_notification_"+this.map.id).hide(),$("#wpgmaps_directions_reset_"+this.map.id).hide(),$("#wpgmaps_directions_notification_"+this.map.id).html(WPGMZA.localized_strings.fetching_directions),$(".wpgmza-not-found").removeClass("wpgmza-not-found"),this.state=WPGMZA.DirectionsBox.STATE_INPUT,this.renderer.clear()},WPGMZA.DirectionsBox.prototype.showOptions=function(show){show||0==arguments.length?(this.optionsElement.show(),this.showOptionsElement.hide(),this.hideOptionsElement.show()):(this.optionsElement.hide(),this.showOptionsElement.show(),this.hideOptionsElement.hide())},WPGMZA.DirectionsBox.prototype.hideOptions=function(){this.showOptions(!1)},WPGMZA.DirectionsBox.prototype.addWaypoint=function(address){var row=this.waypointTemplateItem.clone();return $(this.element).find("div.wpgmza-directions-to").before(row),address&&$(row).find("input").val(address),WPGMZA.AddressInput.createInstance($(row).find("input")[0],this.map),row},WPGMZA.DirectionsBox.prototype.onAddWaypoint=function(){this.addWaypoint().find("input").focus()},WPGMZA.DirectionsBox.prototype.onShowOptions=function(event){$(this.element).find(".wpgmza-directions-options").show(),$(this.element).find(".wpgmza-hide-directions-options").show(),$(this.element).find(".wpgmza-show-directions-options").hide()},WPGMZA.DirectionsBox.prototype.onHideOptions=function(event){$(this.element).find(".wpgmza-directions-options").hide(),$(this.element).find(".wpgmza-hide-directions-options").hide(),$(this.element).find(".wpgmza-show-directions-options").show()},WPGMZA.DirectionsBox.prototype.onRemoveWaypoint=function(){$(event.target).closest(".wpgmza-form-field").remove()},WPGMZA.DirectionsBox.prototype.onGetDirections=function(event){this.openExternal?window.open(this.getExternalURL(),"_blank"):this.route()},WPGMZA.DirectionsBox.prototype.onPrintDirections=function(event){try{var routeHtml=document.getElementById("directions_panel_"+this.map.id).innerHTML,printWindow=window.open("","","height=600,width=800");printWindow.document.write("<html><head><title>Get Directions</title>"),printWindow.document.write("</head><body >"),printWindow.document.write(routeHtml),printWindow.document.write("</body></html>"),printWindow.document.close(),printWindow.print()}catch(ex){var url=this.getExternalURL()+"&om=1";window.open(url,"_blank")}},WPGMZA.DirectionsBox.prototype.onResetDirections=function(event){this.reset()},$(document.body).on("click",".wpgmza_gd, .wpgmza-directions-button",function(arbLatLng){var marker,address,coords,map,element=$(arbLatLng.currentTarget).closest("[data-wpgmza-marker-listing]");element.length||(element=$(arbLatLng.currentTarget).closest(".wpgmza_modern_infowindow, [data-map-id]")),element[0].wpgmzaMarkerListing||element[0].wpgmzaInfoWindow||element[0].wpgmzaMap||(element=$(arbLatLng.currentTarget).closest(".wpgmza_map[data-map-id]")),element.length&&(element.length&&((element=element[0]).wpgmzaMarkerListing?marker=(map=element.wpgmzaMarkerListing.map).getMarkerByID($(arbLatLng.currentTarget).closest("[data-marker-id]").attr("data-marker-id")):element.wpgmzaInfoWindow?map=(marker=element.wpgmzaInfoWindow.mapObject).map:marker=element.wpgmzaMap?(map=element.wpgmzaMap,element.wpgmzaMap.getMarkerByID($(arbLatLng.currentTarget).attr("data-marker-id"))):(map=element.wpgmzaMap).getMarkerByID($(arbLatLng.currentTarget).closest("[data-marker-id]").attr("data-marker-id"))),marker?(address=marker.address,coords=marker.getPosition().toString()):(arbLatLng=$(arbLatLng.currentTarget).data("latlng"))&&(marker={address:coords=arbLatLng}),map.directionsBox.openExternal?window.open(map.directionsBox.getExternalURL({marker:marker})):(map.directionsBox.state=WPGMZA.DirectionsBox.STATE_INPUT,map.directionsBox.to=address&&address.length?address:coords,$("#wpgmza_input_from_"+map.id).focus().select(),map.directionsBox instanceof WPGMZA.ModernDirectionsBox?map.directionsBox.open():WPGMZA.animateScroll(map.directionsBox.element)))})}),jQuery(function($){WPGMZA.DirectionsRenderer=function(map){WPGMZA.EventDispatcher.apply(this,arguments),this.map=map},WPGMZA.extend(WPGMZA.DirectionsRenderer,WPGMZA.EventDispatcher),WPGMZA.DirectionsRenderer.createInstance=function(map){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.CloudAPI.isBeingUsed?WPGMZA.CloudDirectionsRenderer:WPGMZA.GoogleDirectionsRenderer:WPGMZA.OLDirectionsRenderer)(map)},WPGMZA.DirectionsRenderer.prototype.getPolylineOptions=function(){var settings={strokeColor:"#4285F4",strokeWeight:4,strokeOpacity:.8};return this.map.settings.directions_route_stroke_color&&(settings.strokeColor=this.map.settings.directions_route_stroke_color),this.map.settings.directions_route_stroke_weight&&(settings.strokeWeight=parseInt(this.map.settings.directions_route_stroke_weight)),this.map.settings.directions_route_stroke_opacity&&(settings.strokeOpacity=parseFloat(this.map.settings.directions_route_stroke_opacity)),settings},WPGMZA.DirectionsRenderer.prototype.removeMarkers=function(){this.directionStartMarker&&this.map.removeMarker(this.directionStartMarker),this.directionEndMarker&&this.map.removeMarker(this.directionEndMarker)},WPGMZA.DirectionsRenderer.prototype.addMarkers=function(points){this.directionStartMarker=WPGMZA.Marker.createInstance({position:points[0],icon:this.map.settings.directions_route_origin_icon,retina:this.map.settings.directions_origin_retina,disableInfoWindow:!0}),this.directionStartMarker._icon.retina=this.directionStartMarker.retina,this.map.addMarker(this.directionStartMarker),this.directionEndMarker=WPGMZA.Marker.createInstance({position:points[points.length-1],icon:this.map.settings.directions_route_destination_icon,retina:this.map.settings.directions_destination_retina,disableInfoWindow:!0}),this.directionEndMarker._icon.retina=this.directionEndMarker.retina,this.map.addMarker(this.directionEndMarker)},WPGMZA.DirectionsRenderer.prototype.setDirections=function(directions){},WPGMZA.DirectionsRenderer.prototype.fitBoundsToRoute=function(pointA,pointB){var bounds=new WPGMZA.LatLngBounds;bounds.extend(pointA),bounds.extend(pointB),this.map.fitBounds(bounds)}}),jQuery(function($){WPGMZA.DirectionsService=function(map){WPGMZA.EventDispatcher.apply(this,arguments),this.map=map},WPGMZA.extend(WPGMZA.DirectionsService,WPGMZA.EventDispatcher),WPGMZA.DirectionsService.ZERO_RESULTS="zero-results",WPGMZA.DirectionsService.NOT_FOUND="not-found",WPGMZA.DirectionsService.SUCCESS="success",WPGMZA.DirectionsService.DRIVING="driving",WPGMZA.DirectionsService.WALKING="walking",WPGMZA.DirectionsService.TRANSIT="transit",WPGMZA.DirectionsService.BICYCLING="bicycling",WPGMZA.DirectionsService.createInstance=function(map){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleDirectionsService:WPGMZA.OLDirectionsService)(map)},WPGMZA.DirectionsService.route=function(params,callback){}}),jQuery(function($){WPGMZA.Heatmap=function(options){WPGMZA.assertInstanceOf(this,"EventDispatcher"),options=options||{},this.name="",this.radius=20,this.opacity=.5;options.gradient&&"default"!=options.gradient&&("string"==typeof options.gradient?options.gradient=JSON.parse(options.gradient):"array"!=typeof options.gradient&&console.warn("Ignoring invalid gradient")),"default"==options.gradient&&delete options.gradient,WPGMZA.Feature.apply(this,arguments)},WPGMZA.Heatmap.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Heatmap.prototype.constructor=WPGMZA.Heatmap,WPGMZA.Heatmap.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleHeatmap:WPGMZA.OLHeatmap},WPGMZA.Heatmap.createInstance=function(row){return new(WPGMZA.Heatmap.getConstructor())(row)},WPGMZA.Heatmap.createEditableMarker=function(options){var options=$.extend({draggable:!0},options),marker=WPGMZA.Marker.createInstance(options),callback=function(){marker.setIcon(WPGMZA.heatmapIcon),marker.off("added",callback)};return marker.on("added",callback),options.heatmap&&options.heatmap.markers.push(marker),marker},WPGMZA.Heatmap.prototype.setEditable=function(editable){var map,self=this;this.markers&&(this.markers.forEach(function(marker){marker.map.removeMarker(marker)}),delete this.markers),this._prevMap&&delete this._prevMap,editable&&(this.markers=[],this.dataset.forEach(function(marker){marker={lat:marker.lat,lng:marker.lng,heatmap:self},marker=WPGMZA.Heatmap.createEditableMarker(marker);self.map.addMarker(marker)}),this._clickCallback=function(event){self.onClick(event)},this._dragEndCallback=function(event){self.onDragEnd(event)},this._mouseDownCallback=function(event){self.onMapMouseDown(event)},this._mouseMoveCallback=function(event){self.onMapMouseMove(event)},this._mouseUpCallback=function(event){self.onWindowMouseUp(event)},(map=this.map).on("click",this._clickCallback),map.on("dragend",this._dragEndCallback),$(map.element).on("mousedown",this._mouseDownCallback),$(map.element).on("mousemove",this._mouseMoveCallback),$(window).on("mouseup",function(event){self.onWindowMouseUp(event)}),map.on("heatmapremoved",function(event){event.heatmap===self&&(map.off("click",self._clickCallback),map.off("dragend",self._dragEndCallback),$(map.element).off("mousedown",self._mouseDownCallback),$(map.element).off("mousemove",self._mouseMoveCallback),$(window).off("mouseup",this._mouseUpCallback))}))},WPGMZA.Heatmap.prototype.updateDatasetFromMarkers=function(){var dataset=[];this.markers.forEach(function(marker){dataset.push(marker.getPosition())}),this.dataset=dataset},WPGMZA.Heatmap.prototype.onClick=function(marker){if(marker.target instanceof WPGMZA.Marker&&marker.target.heatmap===this){var index=this.markers.indexOf(marker.target);return this.markers.splice(index,1),this.map.removeMarker(marker.target),this.updateDatasetFromMarkers(),void this.trigger("change")}marker.target instanceof WPGMZA.Map&&(marker={lat:marker.latLng.lat,lng:marker.latLng.lng,heatmap:this},marker=WPGMZA.Heatmap.createEditableMarker(marker),this.map.addMarker(marker),this.updateDatasetFromMarkers(),this.trigger("change"))},WPGMZA.Heatmap.prototype.onDragEnd=function(event){event.target instanceof WPGMZA.Marker&&this.markers&&-1!=this.markers.indexOf(event.target)&&(this.updateDatasetFromMarkers(),this.trigger("change"))},WPGMZA.Heatmap.prototype.getGeometry=function(){return this.dataset},WPGMZA.Heatmap.prototype.onMapMouseDown=function(event){if(2==event.button)return this._rightMouseDown=!0,event.preventDefault(),!1},WPGMZA.Heatmap.prototype.onWindowMouseUp=function(event){2==event.button&&(this._rightMouseDown=!1)},WPGMZA.Heatmap.prototype.onMapMouseMove=function(marker){this._rightMouseDown&&(marker={x:marker.pageX-$(this.map.element).offset().left,y:marker.pageY-$(this.map.element).offset().top},marker={lat:(marker=this.map.pixelsToLatLng(marker)).lat,lng:marker.lng,heatmap:this},marker=WPGMZA.Heatmap.createEditableMarker(marker),this.map.addMarker(marker),this.updateDatasetFromMarkers(),this.trigger("change"))}}),jQuery(function($){WPGMZA.LegacyJSONConverter=function(){},WPGMZA.LegacyJSONConverter.prototype.convert=function(json){var key,markers=[];for(key in"string"==typeof json&&(json=JSON.parse(json)),json){var data={map_id:json.map_id,marker_id:json.marker_id,title:json.title,address:json.address,icon:json.icon,pic:json.pic,desc:json.desc,linkd:json.linkd,anim:json.anim,retina:json.retina,category:json.category,lat:json.lat,lng:json.lng,infoopen:json.infoopen};markers[data.marker_id]=data}return markers}}),jQuery(function($){WPGMZA.MarkerGalleryInput=function(input){var self=this,container=$(input).parent();container.append("<div class='wpgmza-gallery-input'><ul><li class='wpgmza-add-new-picture'><i class='fa fa-camera' aria-hidden='true'></i></li></ul></div>"),this.input=input,this.element=container.find(".wpgmza-gallery-input"),$(this.input).next("#upload_image_button").remove(),$(this.input).hide(),this.addNewPictureButton=$(this.element).find(".wpgmza-add-new-picture"),this.addNewPictureButton.on("click",function(event){self.onAddNewPictureClicked(event)}),this.templateItem=$(this.addNewPictureButton).clone(),this.templateItem.removeClass("wpgmza-add-new-picture"),this.templateItem.find("i").remove(),$(this.element).find("ul").sortable({items:"li:not(.wpgmza-add-new-picture)",stop:function(){self.onDragEnd()}}),$(document.body).on("click",".wpgmza-delete-gallery-item",function(event){self.onDeleteItem(event)})},WPGMZA.MarkerGalleryInput.prototype.populate=function(arr){if(this.clear(),arr&&arr.length)for(var i=0;i<arr.length;i++)this.addPicture(arr[i])},WPGMZA.MarkerGalleryInput.prototype.update=function(){var string=this.serialize();this.input.val(string),this.input.attr("value",string)},WPGMZA.MarkerGalleryInput.prototype.clear=function(){$(this.element).find("[data-picture-url]").remove()},WPGMZA.MarkerGalleryInput.prototype.addPicture=function(picture){var item=this.templateItem.clone(),url=picture.url;item.css({"background-image":"url('"+url+"')"}),item.attr("data-picture-url",url),item.attr("data-attachment-id",picture.attachment_id),item.insertBefore(this.addNewPictureButton),item.append($("<button type='button' class='wpgmza-delete-gallery-item'>✖</button>")),this.update()},WPGMZA.MarkerGalleryInput.prototype.serialize=function(){return JSON.stringify(this.toJSON())},WPGMZA.MarkerGalleryInput.prototype.toJSON=function(){var gallery=[];return $(this.element).find("[data-picture-url]").each(function(index,el){gallery.push({attachment_id:$(el).attr("data-attachment-id"),url:$(el).attr("data-picture-url")})}),gallery},WPGMZA.MarkerGalleryInput.prototype.onDragEnd=function(){this.update()},WPGMZA.MarkerGalleryInput.prototype.onAttachmentPicked=function(attachment_id,attachment_url){this.addPicture({attachment_id:attachment_id,url:attachment_url})},WPGMZA.MarkerGalleryInput.prototype.onAddNewPictureClicked=function(event){var self=this;WPGMZA.openMediaDialog(function(attachment_id,attachment_url){self.onAttachmentPicked(attachment_id,attachment_url)})},WPGMZA.MarkerGalleryInput.prototype.onDeleteItem=function(event){$(event.target).closest("[data-picture-url]").remove()}}),jQuery(function($){WPGMZA.MarkerGallery=function(width,context){var self=this,guid=WPGMZA.guid();if(this.element=$("<div class='wpgmza-empty-gallery'/>"),(this.marker=width).gallery){if(width.gallery.length<2){var first=width.gallery[0];if(0==width.gallery.length)return;var img=first.thumbnail||first.url,img=context.getImageElementFromURL(img);return WPGMZA.settings.disable_lightbox_images||this.marker.map.settings.disable_lightbox_images||(img.attr("data-featherlight",first.url),context instanceof WPGMZA.ProInfoWindow&&(img.attr("id",guid),context.on("domready",function(event){$("#"+guid).on("click",function(event){self.onFeatherLightClick(event)})}))),void(this.element=img)}this.element=$("<div class='wpgmza-marker-gallery'><div id='"+guid+"' class='owl-carousel'></div></div>"),this.carouselElement=this.element.find(".owl-carousel"),width.gallery.forEach(function(item){self.addPicture(item,context)}),context instanceof WPGMZA.ProInfoWindow?(width=(width=context.imageWidth)||200,this.element.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),this.carouselElement.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),context.on("domready",function(event){$("#"+guid).owlCarousel(self.getOwlCarouselOptions()),$("#"+guid).on("click","[data-featherlight]",function(event){self.onFeatherLightClick(event)})})):context instanceof WPGMZA.CarouselMarkerListing?setTimeout(function(){var width=$(context.element).find(".owl-item").innerWidth()-40;self.element.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),self.carouselElement.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),$(self.carouselElement).owlCarousel(self.getOwlCarouselOptions())},1e3):setTimeout(function(){$(self.carouselElement).owlCarousel(self.getOwlCarouselOptions())},100)}},WPGMZA.MarkerGallery.prototype.getOwlCarouselOptions=function(){return{navigation:!0,pagination:!1,dots:!1,slideSpeed:3e3,paginationSpeed:400,singleItem:!0,loop:!0,items:1,autoplay:!0,autoplayTimeout:4e3}},WPGMZA.MarkerGallery.prototype.addPicture=function(item,context){var img,container=$("<div/>");item.thumbnail||(item.thumbnail=item.url),context instanceof WPGMZA.ProInfoWindow?img=context.getImageElementFromURL(item.thumbnail):(img=$("<img/>")).attr("src",item.thumbnail),img.css({float:"none"}),WPGMZA.settings.disable_lightbox_images||this.marker.map.settings.disable_lightbox_images||img.attr("data-featherlight",item.url),container.append(img),$(this.carouselElement).append(container)},WPGMZA.MarkerGallery.prototype.onFeatherLightClick=function(event){var self=this;WPGMZA.isFullScreen()&&setTimeout(function(){$($(self.marker.map.element).find(".gm-style")[0]).append($(".featherlight"))},250)},$(document).on("fullscreenchange",function(){$(".featherlight").remove()})}),jQuery(function($){WPGMZA.MarkerIconPicker=function(name){var self=this;if(!name)throw new Error("Element cannot be undefined");if(!(name instanceof HTMLElement||name instanceof jQuery&&1==name.length))throw new Error("Invalid element");this.element=name;var input=$(this.element).find("input.wpgmza-marker-icon-url"),name=$(input).attr("name")||$(input).attr("data-ajax-name");if(input.length){if(!name)throw new Error("Input must have a name for marker library to function");$(this.element).find("button.wpgmza-marker-library").attr("data-target-name",name);WPGMZA.MarkerIcon.createInstance(input.val())}$(this.element).find("button.wpgmza-upload").on("click",function(event){self.onUploadImage(event)}),$(this.element).find("button.wpgmza-reset").on("click",function(event){self.onReset(event)})},WPGMZA.MarkerIconPicker.prototype.setIcon=function(preview){var url=WPGMZA.MarkerIcon.createInstance(preview).url,preview=url;url!=WPGMZA.defaultMarkerIcon?$(this.element).find("input.wpgmza-marker-icon-url").val(url):$(this.element).find("input.wpgmza-marker-icon-url").val(""),0==url.length&&(preview=WPGMZA.defaultMarkerIcon),$(this.element).find(".wpgmza-marker-icon-preview").css({"background-image":"url('"+preview+"')"})},WPGMZA.MarkerIconPicker.prototype.onUploadImage=function(){var self=this;WPGMZA.openMediaDialog(function(attachment_id,attachment_url){self.setIcon(attachment_url),$(this.element).find("input.wpgmza-marker-icon-url").val("")})},WPGMZA.MarkerIconPicker.prototype.onReset=function(){this.reset()},WPGMZA.MarkerIconPicker.prototype.reset=function(){this.setIcon(WPGMZA.defaultMarkerIcon)}}),jQuery(function($){WPGMZA.MarkerIcon=function(options){var self=this;if(WPGMZA.EventDispatcher.apply(this,arguments),this.isLoaded=!1,this.url="",this.retina=!1,"object"==typeof options)for(var key in options)this[key]=options[key];else if("string"==typeof options)try{var json=JSON.parse(options);for(key in json)this[key]=json[key]}catch(e){this.url=options}else if(options)throw new Error("Argument must be an object");this.url=this.url.replace(/^http(s?):/,""),this.dimensions={width:null,height:null};var url=this.isDefault?WPGMZA.defaultMarkerIcon:this.url;WPGMZA.getImageDimensions(url,function(dimensions){self.dimensions=dimensions,self.isLoaded=!0,self.trigger("load")})},WPGMZA.extend(WPGMZA.MarkerIcon,WPGMZA.EventDispatcher),WPGMZA.MarkerIcon.createInstance=function(options){return new WPGMZA.MarkerIcon(options)},Object.defineProperty(WPGMZA.MarkerIcon.prototype,"width",{get:function(){return this.retina?parseInt(WPGMZA.settings.retinaWidth):parseInt(this.dimensions.width)}}),Object.defineProperty(WPGMZA.MarkerIcon.prototype,"height",{get:function(){return this.retina?parseInt(WPGMZA.settings.retinaHeight):parseInt(this.dimensions.height)}}),Object.defineProperty(WPGMZA.MarkerIcon.prototype,"isDefault",{get:function(){return 0==this.url.length||this.url==WPGMZA.defaultMarkerIcon.replace(/^http(s?):/,"")}}),WPGMZA.MarkerIcon.prototype.applyToElement=function(element){this.isDefault?$(element).attr("src",WPGMZA.defaultMarkerIcon):$(element).attr("src",this.url),this.retina&&$(element).css({width:this.width+"px",height:this.height+"px"})}}),jQuery(function($){var currentCallback;window.WPGMZA||(window.WPGMZA={}),WPGMZA.MarkerLibraryDialog=function(element){var self=this;this.element=element,$(element).remodal(),window.addEventListener("message",function(event){"download_marker"==event.data.action&&$.ajax({url:ajaxurl,type:"POST",data:{action:"wpgmza_upload_base64_image",security:WPGMZA.legacyajaxnonce,data:event.data.data.replace(/^data:.+?base64,/,""),mimeType:"image/png"},success:function(url,status,xhr){url=url.url;currentCallback(url),$(self.element).remodal().close()}})},!1)},WPGMZA.MarkerLibraryDialog.prototype.open=function(callback){currentCallback=callback,$(this.element).remodal().open(),$("iframe#mappity").attr("src","https://www.mappity.org?wpgmza-embed=1")},WPGMZA.MarkerLibraryDialog.prototype.onSearch=function(){var string=this.searchInput.val().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),regexp=new RegExp(string,"i");$(this.element).find("img").each(function(index,filename){var li=$(filename).closest("li"),filename=$(filename).attr("title").replace(/\.png$/,"");string.length&&!filename.match(regexp)?$(li).addClass("wpgmza-marker-library-no-result"):$(li).removeClass("wpgmza-marker-library-no-result")})},WPGMZA.MarkerLibraryDialog.prototype.onIconSelected=function(event){currentCallback(event.target.src),$(this.element).remodal().close()},$(document).ready(function(event){var el=$(".wpgmza-marker-library-dialog");el.length&&($(el).css("display",""),WPGMZA.markerLibraryDialog=new WPGMZA.MarkerLibraryDialog(el),$("input.wpgmza-marker-library, button.wpgmza-marker-library").each(function(index,el){var button,target,preview;target=$(button=el).closest(".wpgmza-marker-icon-picker").find(".wpgmza-marker-icon-url"),preview=$(button).closest(".wpgmza-marker-icon-picker").find("img, .wpgmza-marker-icon-preview"),$(button).on("click",function(){WPGMZA.markerLibraryDialog.open(function(src){target.val(src),target.change(),preview.prop("tagName").match(/img/)?preview.attr("src",src):preview.css({"background-image":"url("+src+")"}),$(button).hasClass("wpgmza-marker-directions-library")||$("#wpgmza_cmm>img").attr("src",src)})})}))})}),jQuery(function($){WPGMZA.ModernDirectionsBox=function(map){WPGMZA.DirectionsBox.apply(this,arguments);var behaviour,self=this,original=this.element;original.length&&(behaviour=$(map.element),this.map=map,this.element=$("<div class='wpgmza-popout-panel wpgmza-modern-directions-box'></div>"),this.panel=new WPGMZA.PopoutPanel(this.element),this.element.append(original),behaviour.append(this.element),$(this.element).find("h2").after($("\t\t\t<div class='wpgmza-directions-buttons'>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-times' aria-hidden='true'></i></span>\t\t\t</div>\t\t")),$(this.element).find("td:first-child").remove(),behaviour=$(this.element).find("select[name^='wpgmza_dir_type']").closest("tr"),$(this.element).find(".wpgmaps_to_row").after(behaviour),$(this.element).find("#wpgmza_options_box_"+map.id).addClass("wpgmza-directions-options"),this.resultBox=new WPGMZA.ModernDirectionsResultBox(map,this),"intelligent"==(behaviour=map.settings.directions_behaviour)&&(behaviour=WPGMZA.isTouchDevice()?"external":"default"),"default"==behaviour&&$(this.element).find(".wpgmaps_get_directions").on("click",function(event){0!=self.from.length&&0!=self.to.length&&self.resultBox.open()}),$(this.element).find(".wpgmza-close").on("click",function(event){self.panel.close()}),$(this.element).on("click",".wpgmza-travel-mode-option",function(){var mode=jQuery(this).data("mode");jQuery("body").find(".wpgmza-travel-mode-option").removeClass("wpgmza-travel-option__selected"),jQuery(this).addClass("wpgmza-travel-option__selected"),jQuery("body").find(".wpgmza-travel-mode").val(mode)}))},WPGMZA.extend(WPGMZA.ModernDirectionsBox,WPGMZA.DirectionsBox),Object.defineProperty(WPGMZA.ModernDirectionsBox.prototype,"from",{get:function(){return $(this.element).find("input.wpgmza-directions-from").val()},set:function(value){return $(this.element).find("input.wpgmza-directions-from").val(value)}}),Object.defineProperty(WPGMZA.ModernDirectionsBox.prototype,"to",{get:function(){return $(this.element).find("input.wpgmza-directions-to").val()},set:function(value){return $(this.element).find("input.wpgmza-directions-to").val(value)}}),WPGMZA.ModernDirectionsBox.prototype.open=function(){this.panel.open(),this.resultBox&&this.resultBox.close(),$(this.element).children().show()},WPGMZA.ModernDirectionsBox.prototype.onNativeMapsApp=function(){var url=this.getExternalURL();window.open(url,"_blank")}}),jQuery(function($){WPGMZA.ModernDirectionsResultBox=function(map,directionsBox){WPGMZA.PopoutPanel.apply(this,arguments);var self=this,container=$(map.element);this.map=map,this.directionsBox=directionsBox,this.element=$("<div class='wpgmza-popout-panel wpgmza-modern-directions-box'>\t\t\t<h2 class='wpgmza-directions-box__title'>"+$(directionsBox.element).find("h2").html()+"</h2>\t\t\t<div class='wpgmza-directions-buttons'>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-arrow-left' aria-hidden='true'></i></span>\t\t\t\t<a class='wpgmza-print' style='display: none;'><i class='fa fa-print' aria-hidden='true'></i></a>\t\t\t</div>\t\t\t<div class='wpgmza-directions-results'>\t\t\t</div>\t\t</div>"),this.element.addClass("wpgmza-modern-directions-box__results");var nativeIcon=new WPGMZA.NativeMapsAppIcon;this.nativeMapAppIcon=nativeIcon,$(this.element).find(".wpgmza-directions-buttons").append(nativeIcon.element),$(nativeIcon.element).on("click",function(event){self.onNativeMapsApp(event)}),container.append(this.element),this.element.append($("#directions_panel_"+map.id)),$(this.element).find(".wpgmza-print").attr("href","data:text/html,<script>document.body.innerHTML +=sessionStorage.wpgmzaPrintDirectionsHTML; window.print();<\/script>"),$(this.element).find(".wpgmza-close").on("click",function(event){self.close()}),$(this.element).find(".wpgmza-print").on("click",function(event){self.onPrint(event)}),this.map.on("directionsserviceresult",function(event){self.onDirectionsChanged(event,event.response,event.status)}),this.clear()},WPGMZA.ModernDirectionsResultBox.prototype=Object.create(WPGMZA.PopoutPanel.prototype),WPGMZA.ModernDirectionsResultBox.prototype.constructor=WPGMZA.ModernDirectionsResultBox,WPGMZA.ModernDirectionsResultBox.prototype.clear=function(){$(this.element).find(".wpgmza-directions-results").html(""),$(this.element).find("a.wpgmza-print").attr("href","")},WPGMZA.ModernDirectionsResultBox.prototype.open=function(){WPGMZA.PopoutPanel.prototype.open.apply(this,arguments),this.showPreloader()},WPGMZA.ModernDirectionsResultBox.prototype.showPreloader=function(){$(this.element).find(".wpgmza-directions-results").html("<img src='"+wpgmza_ajax_loader_gif.src+"'/>")},WPGMZA.ModernDirectionsResultBox.prototype.onDirectionsChanged=function(event,response,status){switch(this.clear(),status){case WPGMZA.DirectionsService.SUCCESS:break;case WPGMZA.DirectionsService.NOT_FOUND:case WPGMZA.DirectionsService.ZERO_RESULTS:var message=status.toLowerCase(),message=WPGMZA.localized_strings[message];$(this.element).find(".wpgmza-directions-results").html('<i class="fa fa-times" aria-hidden="true"></i>'+message);break;default:message=WPGMZA.localized_strings.unknown_error;$(this.element).find(".wpgmza-directions-results").html('<i class="fa fa-times" aria-hidden="true"></i>'+message)}},WPGMZA.ModernDirectionsResultBox.prototype.onNativeMapsApp=function(event){var url=this.directionsBox.getExternalURL();window.open(url,"_blank")},WPGMZA.ModernDirectionsResultBox.prototype.onPrint=function(event){var content=$(this.element).find(".wpgmza-directions-results").html();document.implementation.createHTMLDocument();sessionStorage.wpgmzaPrintDirectionsHTML=content}}),jQuery(function($){WPGMZA.ModernMarkerListingMarkerView=function(map){var self=this;this.map=map,this.map_id=map.id,WPGMZA.PopoutPanel.apply(this,arguments);var container=$("#wpgmza_map_"+map.id);this.element=$("<div class='wpgmza-popout-panel wpgmza-modern-marker-listing-marker-view'>\t\t\t<div class='wpgmza-close-container'>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-arrow-left' aria-hidden='true'></i></span>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-times' aria-hidden='true'></i></span>\t\t\t</div>\t\t\t<div data-name='title'></div>\t\t\t<div data-name='address'></div>\t\t\t<div data-name='category'></div>\t\t\t<img data-name='pic'/>\t\t\t<div data-name='description'></div>\t\t\t<div class='wpgmza-modern-marker-listing-buttons'>\t\t\t\t<div class='wpgmza-modern-marker-listing-button wpgmza-link-button'>\t\t\t\t\t<i class='fa fa-link' aria-hidden='true'></i>\t\t\t\t\t<div>\t\t\t\t\t\t"+WPGMZA.localized_strings.link+"\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t\t<div class='wpgmza-modern-marker-listing-button wpgmza-directions-button'>\t\t\t\t\t<i class='fa fa-road' aria-hidden='true'></i>\t\t\t\t\t<div>\t\t\t\t\t\t"+WPGMZA.localized_strings.directions+"\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t\t<div class='wpgmza-modern-marker-listing-button wpgmza-zoom-button'>\t\t\t\t\t<i class='fa fa-search-plus' aria-hidden='true'></i>\t\t\t\t\t<div>\t\t\t\t\t\t"+WPGMZA.localized_strings.zoom+"\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t</div>\t\t</div>"),map.on("init",function(){container.append(self.element)}),map.on("click",function(event){event.target instanceof WPGMZA.Marker&&event.target!=self.map.userLocationMarker&&event.target!=self.map.storeLocatorMarker&&self.open(event.target.id)}),$(this.element).find(".wpgmza-close").on("click",function(event){self.close(),$("#wpgmza_map_"+self.map_id+" .wpgmza-modern-store-locator").removeClass("wpgmza_sl_mv_offset")}),$(this.element).find(".wpgmza-link-button").on("click",function(event){self.onLink(event)}),$(this.element).find(".wpgmza-directions-button").on("click",function(event){self.onDirections(event)}),$(this.element).find(".wpgmza-zoom-button").on("click",function(event){self.onZoom(event)}),$(container).append(this.element),container.children(".wpgmza-modern-directions-box").length&&$(this.element).after(container.children(".wpgmza-modern-directions-box"))},WPGMZA.ModernMarkerListingMarkerView.prototype=Object.create(WPGMZA.PopoutPanel.prototype),WPGMZA.ModernMarkerListingMarkerView.prototype.constructor=WPGMZA.ModernMarkerListingMarkerView,WPGMZA.ModernMarkerListingMarkerView.prototype.open=function(marker_id){var self=this,marker=this.map.getMarkerByID(marker_id);marker.disableInfoWindow||(WPGMZA.PopoutPanel.prototype.open.apply(this,arguments),this.marker=marker,$(this.element).find("[data-name]").each(function(index,el){var name=$(el).attr("data-name"),value=marker[name]||"";switch("category"===name&&0<marker.categories.length&&(value=marker.categories.join(",")),name){case"pic":$(el).attr("src",value),$(el).attr("alt",marker.title),marker.pic.length?$(el).show():$(el).hide();break;case"category":for(var ids=value.split(","),names=[],i=0;i<ids.length;i++){var id=ids[i];wpgmza_category_data[id]&&names.push(wpgmza_category_data[id].category_name)}$(el).html(names.join(", "));break;default:$(el).html(value)}}),marker.link&&0!=marker.link.length?$(this.element).find(".wpgmza-link-button").show():$(this.element).find(".wpgmza-link-button").hide(),$("#wpgmza_map_"+this.map_id+" .wpgmza-modern-store-locator").addClass("wpgmza_sl_mv_offset"),$(this.element).find("[data-custom-field-name]").remove(),$(this.element).find(".wpgmza-modern-marker-listing-buttons").before(marker.custom_fields_html),$(this.element).find(".wpgmza-directions-button").attr("data-marker-id",marker_id),$(this.element).find(".wpgmza-close").on("click",function(event){self.close()}))},WPGMZA.ModernMarkerListingMarkerView.prototype.onLink=function(event){window.open(this.marker.link,"_blank")},WPGMZA.ModernMarkerListingMarkerView.prototype.onDirections=function(event){this.map.directionsBox.to=this.marker.address,this.map.directionsBox.element.show()},WPGMZA.ModernMarkerListingMarkerView.prototype.onZoom=function(event){this.map.setCenter(this.marker.getPosition()),this.map.setZoom(14)}}),jQuery(function($){WPGMZA.ProAddressInput=function(element,map){WPGMZA.AddressInput.apply(this,arguments),this.useMyLocationButton=new WPGMZA.UseMyLocationButton(element),$(this.element).after(this.useMyLocationButton.element)},WPGMZA.extend(WPGMZA.ProAddressInput,WPGMZA.AddressInput),WPGMZA.AddressInput.createInstance=function(element,map){return new WPGMZA.ProAddressInput(element,map)}}),jQuery(function($){var Parent="open-layers"==WPGMZA.settings.engine?WPGMZA.OLDrawingManager:WPGMZA.GoogleDrawingManager;WPGMZA.ProDrawingManager=function(map){var self=this;Parent.apply(this,arguments),this.map.on("click rightclick",function(event){self.onMapClick(event)})},WPGMZA.extend(WPGMZA.ProDrawingManager,Parent),WPGMZA.DrawingManager.getConstructor=function(){return"google-maps"!==WPGMZA.settings.engine?WPGMZA.OLProDrawingManager:WPGMZA.GoogleProDrawingManager},WPGMZA.ProDrawingManager.prototype.setDrawingMode=function(mode){var self=this;if(mode!=WPGMZA.DrawingManager.MODE_HEATMAP)return this.heatmap&&(this.heatmap.markers.forEach(function(marker){self.map.removeMarker(marker)}),this.map.removeHeatmap(this.heatmap),delete this.heatmap),void Parent.prototype.setDrawingMode.apply(this,arguments);Parent.prototype.setDrawingMode.apply(this,arguments)},WPGMZA.ProDrawingManager.prototype.getHeatmapParameters=function(){var params={};$(".wpgmza-feature-panel[data-wpgmza-feature-type='heatmap'] [data-ajax-name]").each(function(index,el){var value;"gradient"!=$(el).attr("data-ajax-name")&&(value="number"===$(el).attr("type")?parseFloat($(el).val()):$(el).val(),params[$(el).attr("data-ajax-name")]=value)});var str=$(".wpgmza-feature-panel[data-wpgmza-feature-type='heatmap'] [data-ajax-name='gradient']:checked").val();return"default"!=str&&(params.gradient=JSON.parse(str)),params},WPGMZA.ProDrawingManager.prototype.onMapClick=function(event){var self=this;if(this.mode==WPGMZA.DrawingManager.MODE_HEATMAP&&event.target instanceof WPGMZA.Map)return this.heatmap||(this.heatmap=WPGMZA.Heatmap.createInstance({dataset:[]}),this.map.addHeatmap(this.heatmap),this.heatmap.setEditable(!0),this.heatmap.on("change",function(event){self.onHeatmapGeometryChanged(event)})),2==event.button?(event.preventDefault(),!1):void 0},WPGMZA.ProDrawingManager.prototype.updateHeatmapGeometryField=function(){var arr=[];this.heatmap.markers.forEach(function(position){position=position.getPosition().toLatLngLiteral();arr.push(position)}),$("[data-wpgmza-feature-type='heatmap']").find("[data-ajax-name='dataset']").val(JSON.stringify(arr))},WPGMZA.ProDrawingManager.prototype.updateHeatmap=function(){var key,params=this.getHeatmapParameters();for(key in params)this.heatmap[key]=params[key];this.heatmap.update()},WPGMZA.ProDrawingManager.prototype.onHeatmapPropertyChanged=function(event){"dataset_name"!=$(event.target).attr("data-ajax-name")&&this.updateHeatmap()},WPGMZA.ProDrawingManager.prototype.onHeatmapGeometryChanged=function(event){this.updateHeatmapGeometryField()}}),jQuery(function($){WPGMZA.ProInfoWindow=function(feature){var self=this;WPGMZA.InfoWindow.call(this,feature),this.on("infowindowopen",function(event){self.updateDistanceFromLocation(),self.showDistanceAwayFromStoreLocatorCenter()})},WPGMZA.ProInfoWindow.prototype=Object.create(WPGMZA.InfoWindow.prototype),WPGMZA.ProInfoWindow.prototype.constructor=WPGMZA.ProInfoWindow,WPGMZA.ProInfoWindow.STYLE_INHERIT="-1",WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE="0",WPGMZA.ProInfoWindow.STYLE_MODERN="1",WPGMZA.ProInfoWindow.STYLE_MODERN_PLUS="2",WPGMZA.ProInfoWindow.STYLE_MODERN_CIRCULAR="3",WPGMZA.ProInfoWindow.STYLE_TEMPLATE="template",WPGMZA.ProInfoWindow.OPEN_BY_CLICK=1,WPGMZA.ProInfoWindow.OPEN_BY_HOVER=2,Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"maxWidth",{get:function(){var width=WPGMZA.settings.wpgmza_settings_infowindow_width;return!(!width||!/^\d+$/.test(width))&&width}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"imageWidth",{get:function(){var width=WPGMZA.settings.wpgmza_settings_image_width;return!(!width||!/^\d+$/.test(width))&&width}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"imageHeight",{get:function(){var height=WPGMZA.settings.wpgmza_settings_image_height;return!(!height||!/^\d+$/.test(height))&&height}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"enableImageResizing",{get:function(){return 1==WPGMZA.settings.wpgmza_settings_image_resizing}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"linkTarget",{get:function(){return 1==WPGMZA.settings.infoWindowLinks?"_BLANK":""}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"linkText",{get:function(){return WPGMZA.localized_strings.more_info}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"directionsText",{get:function(){return WPGMZA.localized_strings.get_directions}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"distanceUnits",{get:function(){return 1==this.feature.map.settings.store_locator_distance?WPGMZA.Distance.MILES:WPGMZA.Distance.KILOMETERS}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"showAddress",{get:function(){return 1!=WPGMZA.settings.infoWindowAddress||"map-edit"==WPGMZA.currentPage}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"style",{get:function(){return this.map&&this.map.userLocationMarker==this?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:this.getSelectedStyle()}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"isPanIntoViewAllowed",{get:function(){return this.style==WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE}}),WPGMZA.ProInfoWindow.prototype.getSelectedStyle=function(){var globalTypeSetting=WPGMZA.settings.wpgmza_iw_type,localTypeSetting=this.feature.map.settings.wpgmza_iw_type,type=localTypeSetting;return(localTypeSetting!=WPGMZA.ProInfoWindow.STYLE_INHERIT&&void 0!==localTypeSetting||(type=globalTypeSetting)!=WPGMZA.ProInfoWindow.STYLE_INHERIT)&&type?String(type):WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE},WPGMZA.ProInfoWindow.prototype.getImageElementFromURL=function(url){var img=$("<img/>");return img.addClass("wpgmza_infowindow_image"),img.attr("src",url),img.css({float:"right"}),this.maxWidth&&img.css({"max-width":this.maxWidth}),this.enableImageResizing&&this.imageWidth&&(img.css({width:this.imageWidth}),img.css({height:this.imageHeight})),this.enableImageResizing||img.css({margin:"5px"}),img},WPGMZA.ProInfoWindow.prototype.showDistanceAwayFromStoreLocatorCenter=function(){var distance;this.feature instanceof WPGMZA.Marker&&this.feature.map.settings.store_locator_show_distance&&this.feature.map.storeLocator&&this.feature.map.storeLocator.state==WPGMZA.StoreLocator.STATE_APPLIED&&(this.feature.map.settings.show_distance_from_location||(distance=this.feature.getPosition(),distance=this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center,distance),$(this.element).append("<p>"+(this.feature.map.settings.store_locator_distance==WPGMZA.Distance.KILOMETERS?distance+WPGMZA.localized_strings.kilometers_away:distance+" "+WPGMZA.localized_strings.miles_away)+"</p>")))},WPGMZA.ProInfoWindow.prototype.updateDistanceFromLocation=function(){var source,text=this.feature;text instanceof WPGMZA.Marker?(source=text.map.showDistanceFromLocation)&&(text=WPGMZA.Distance.between(source,text.getPosition()),this.distanceUnits==WPGMZA.Distance.MILES&&(text/=WPGMZA.Distance.KILOMETERS_PER_MILE),text=Math.round(text,2),source=source.source==WPGMZA.ProMap.SHOW_DISTANCE_FROM_USER_LOCATION?WPGMZA.localized_strings.from_your_location:WPGMZA.localized_strings.from_searched_location,$(this.element).find(".wpgmza-distance-from-location .wpgmza-amount").text(text),$(this.element).find(".wpgmza-distance-from-location .wpgmza-source").text(source)):console.warn("This function is only intended for use with markers and should not have been called in this manner")},WPGMZA.ProInfoWindow.prototype.legacyCreateDefaultInfoWindow=function(map){var marker=this.feature,map=marker.map;function empty(field){return!(field&&field.length&&0<field.length)}var description,div,link,p,a,container=$("<div class='wpgmza_markerbox scrollFix'></div>");this.maxWidth&&container.css({"max-width":this.maxWidth}),empty(marker.gallery)?empty(marker.pic)||(description=this.getImageElementFromURL(marker.pic),container.append(description)):(div=new WPGMZA.MarkerGallery(marker,this),container.append(div.element)),empty(marker.title)||((p=$("<p class='wpgmza_infowindow_title'></p>")).html(marker.title),container.append(p)),!empty(marker.address)&&this.showAddress&&((p=$("<p class='wpgmza_infowindow_address'></p>")).html(marker.address),container.append(p)),empty(marker.desc)&&empty(marker.description)||(description=empty(marker.desc)?marker.description:marker.desc,(div=$("<div class='wpgmza_infowindow_description'></div>")).html(description),container.append(div)),1==map.settings.show_distance_from_location&&(p=$("<p class='wpgmza-distance-from-location'><span class='wpgmza-amount'></span> <span class='wpgmza-units'></span> <span class='wpgmza-source'></span></p>"),link=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.localized_strings.miles_away:WPGMZA.localized_strings.kilometers_away,p.find(".wpgmza-units").text(link),container.append(p)),empty(marker.linkd)&&empty(marker.link)||(link=empty(marker.link)?marker.linkd:marker.link,p=$("<p class='wpgmza_infowindow_link'></p>"),(a=$("<a class='wpgmza_infowindow_link'></a>")).attr("href",WPGMZA.decodeEntities(link)),a.attr("target",this.linkTarget),a.text(this.linkText),p.append(a),container.append(p)),map.directionsEnabled&&1!==parseInt(WPGMZA.is_admin)&&marker.getPosition&&(p=$("<p></p>"),(a=$("<a class='wpgmza_gd'></a>")).attr("href","javascript: ;"),a.attr("id",map.id),a.attr("data-address",marker.address),a.attr("data-latlng",marker.getPosition().toString()),a.attr("data-marker-id",marker.id),a.attr("wpgm_addr_field",marker.address),a.attr("gps",marker.lat+","+marker.lng),a.text(this.directionsText),p.append(a),container.append(p)),marker.custom_fields_html&&container.append(marker.custom_fields_html),container.append(this.addEditButton()),this.setContent(container.html())},WPGMZA.ProInfoWindow.prototype.legacyCreateModernInfoWindow=function(container){var units,ratingContainer,t,legend,mapid=container.id;0==$("#wpgmza_iw_holder_"+container.id).length&&($(document.body).append("<div id='wpgmza_iw_holder_"+container.id+"'></div>"),null!==(legend=document.getElementById("wpgmza_iw_holder_"+mapid))&&$(legend).remove(),window.wpgmza_iw_Div||(window.wpgmza_iw_Div=[]),wpgmza_iw_Div[mapid]=document.createElement("div"),wpgmza_iw_Div[mapid].id="wpgmza_iw_holder_"+mapid,wpgmza_iw_Div[mapid].style="display:block;",document.getElementsByTagName("body")[0].appendChild(wpgmza_iw_Div[mapid]),wpgmza_iw_Div_inner=document.createElement("div"),wpgmza_iw_Div_inner.className="wpgmza_modern_infowindow_inner wpgmza_modern_infowindow_inner_"+mapid,wpgmza_iw_Div[mapid].appendChild(wpgmza_iw_Div_inner),wpgmza_iw_Div_close=document.createElement("div"),wpgmza_iw_Div_close.className="wpgmza_modern_infowindow_close",wpgmza_iw_Div_close.setAttribute("mid",mapid),$(wpgmza_iw_Div_close).on("click",function(event){$(wpgmza_iw_Div[mapid]).remove()}),t=document.createTextNode("x"),wpgmza_iw_Div_close.appendChild(t),wpgmza_iw_Div_inner.appendChild(wpgmza_iw_Div_close),wpgmza_iw_Div_img=document.createElement("div"),wpgmza_iw_Div_img.className="wpgmza_iw_image",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_Div_img),wpgmza_iw_img=document.createElement("img"),wpgmza_iw_img.className="wpgmza_iw_marker_image",wpgmza_iw_img.src="",wpgmza_iw_img.style="max-width:100%;",wpgmza_iw_Div_img.appendChild(wpgmza_iw_img),wpgmza_iw_img_div=document.createElement("div"),wpgmza_iw_img_div.className="wpgmza_iw_title",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_img_div),wpgmza_iw_img_div_p=document.createElement("p"),wpgmza_iw_img_div_p.className="wpgmza_iw_title_p",wpgmza_iw_img_div.appendChild(wpgmza_iw_img_div_p),WPGMZA.settings.wpgmza_settings_infowindow_address||(wpgmza_iw_address_div=document.createElement("div"),wpgmza_iw_address_div.className="wpgmza_iw_address",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_address_div),wpgmza_iw_address_p=document.createElement("p"),wpgmza_iw_address_p.className="wpgmza_iw_address_p",wpgmza_iw_address_div.appendChild(wpgmza_iw_address_p)),wpgmza_iw_description=document.createElement("div"),wpgmza_iw_description.className="wpgmza_iw_description",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_description),wpgmza_iw_description_p=document.createElement("p"),wpgmza_iw_description_p.className="wpgmza_iw_description_p",wpgmza_iw_description.appendChild(wpgmza_iw_description_p),1==container.settings.show_distance_from_location&&(ratingContainer=$("<p class='wpgmza-distance-from-location'><span class='wpgmza-amount'></span> <span class='wpgmza-units'></span> <span class='wpgmza-source'></span></p>"),units=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.localized_strings.miles_away:WPGMZA.localized_strings.kilometers_away,ratingContainer.find(".wpgmza-units").text(units),$(wpgmza_iw_Div_inner).append(ratingContainer)),ratingContainer=$("<div class='wpgmza-rating-container'></div>")[0],wpgmza_iw_Div_inner.appendChild(ratingContainer),$(wpgmza_iw_Div_inner).append("<div class='wpgmza_iw_custom_fields'/>"),wpgmza_iw_buttons=document.createElement("div"),wpgmza_iw_buttons.className="wpgmza_iw_buttons",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_buttons),wpgmza_directions_button=document.createElement("a"),wpgmza_directions_button.className="wpgmza_button wpgmza_left wpgmza_directions_button",wpgmza_directions_button.src="#",t=document.createTextNode(WPGMZA.localized_strings.directions),wpgmza_directions_button.appendChild(t),wpgmza_iw_buttons.appendChild(wpgmza_directions_button),wpgmza_more_info_button=document.createElement("a"),wpgmza_more_info_button.className="wpgmza_button wpgmza_right wpgmza_more_info_button",wpgmza_more_info_button.src="#",t=document.createTextNode(WPGMZA.localized_strings.more_info),wpgmza_more_info_button.appendChild(t),wpgmza_iw_buttons.appendChild(wpgmza_more_info_button),legend=document.getElementById("wpgmza_iw_holder_"+mapid),$(legend).css("display","block"),$(legend).addClass("wpgmza_modern_infowindow"),$(legend).addClass("wpgmza-shadow"),"google-maps"==WPGMZA.settings.engine?(container=this.feature.map).googleMap.controls[google.maps.ControlPosition.RIGHT_TOP].push(legend):((container=$(".wpgmza-ol-modern-infowindow-container[data-map-id='"+mapid+"']")).length||(container=$("<div class='wpgmza-ol-modern-infowindow-container' data-map-id='"+mapid+"'></div>"),$(".wpgmza_map[data-map-id='"+mapid+"']").append(container)),container.append(legend)))},WPGMZA.ProInfoWindow.prototype.open=function(map,feature){if(window.infoWindow&&(infoWindow[feature.map.id]=this),!WPGMZA.InfoWindow.prototype.open.call(this,map,feature))return!1;if(this.feature==map.userLocationMarker)return!0;if(map.settings.wpgmza_list_markers_by==WPGMZA.MarkerListing.STYLE_MODERN)return!1;if(WPGMZA.settings.wpgmza_settings_disable_infowindows)return!1;if(this.style==WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE||"map-edit"==WPGMZA.currentPage)return this.legacyCreateDefaultInfoWindow(),!0;var data=wpgmaps_localize_marker_data[map.id],marker=feature;if("array"==typeof data){for(var i=0;i<data.length;i++)if(data[i].marker_id==feature.id){data[i];break}}else if("object"==typeof data)for(var key in data)if(data[key].marker_id==feature.id){data[key];break}this.legacyCreateModernInfoWindow(map),window.modern_iw_open&&(modern_iw_open[map.id]=!0);var gallery,element=this.element=jQuery("#wpgmza_iw_holder_"+map.id);element.find(".wpgmza_iw_marker_image").attr("src",""),element.find(".wpgmza_iw_title").html(""),element.find(".wpgmza_iw_description").html(""),element.find(".wpgmza_iw_address_p").html(""),element.find(".wpgmza_more_info_button").attr("href","#"),element.find(".wpgmza_more_info_button").attr("target",""),element.find(".wpgmza_directions_button").attr("gps",""),element.find(".wpgmza_directions_button").attr("href","#"),element.find(".wpgmza_directions_button").attr("id",""),element.find(".wpgmza_directions_button").attr("data-marker-id",""),element.find(".wpgmza_directions_button").attr("wpgm_addr_field",""),""===marker.image&&""===marker.title?element.find(".wpgmza_iw_image").css("display","none"):element.find(".wpgmza_iw_image").css("display","block"),(container=$("#wpgmza_iw_holder_"+map.id+" .wpgmza_iw_image")).html(""),marker.gallery?((gallery=new WPGMZA.MarkerGallery(marker,this)).element.css({float:"none"}),container.append(gallery.element)):marker.pic.length?((description=$("<img class='wpgmza_infowindow_image'/>")).attr("src",marker.pic),description.css({display:"block"}),container.append(description)):(element.find(".wpgmza_iw_marker_image").css("display","none"),element.find(".wpgmza_iw_title").attr("style","position: relative !important"),element.find(".wpgmza_iw_title").addClass("wpgmze_iw_title_no_image")),""!==marker.title&&element.find(".wpgmza_iw_title").html(marker.title);var description="";marker.desc?description=marker.desc:marker.description&&(description=marker.description),description&&description.length?(element.find(".wpgmza_iw_description").css("display","block"),element.find(".wpgmza_iw_description").html(description)):element.find(".wpgmza_iw_description").css("display","none");var container=element.find(".wpgmza_iw_description");return marker.custom_fields_html&&(container.append(marker.custom_fields_html),container.css("display","block")),void 0!==marker.address&&""!==marker.address&&element.find(".wpgmza_iw_address_p").html(marker.address),void 0!==marker.link&&""!==marker.link?(element.find(".wpgmza_more_info_button").show(),element.find(".wpgmza_more_info_button").attr("href",marker.link),element.find(".wpgmza_more_info_button").attr("target",this.linkTarget)):element.find(".wpgmza_more_info_button").hide(),map.directionsEnabled?(element.find(".wpgmza_directions_button").show(),element.find(".wpgmza_directions_button").attr("href","javascript:void(0);"),element.find(".wpgmza_directions_button").attr("gps",marker.lat+","+marker.lng),element.find(".wpgmza_directions_button").attr("wpgm_addr_field",marker.address),element.find(".wpgmza_directions_button").attr("id",map.id),element.find(".wpgmza_directions_button").attr("data-marker-id",marker.id),element.find(".wpgmza_directions_button").addClass("wpgmza_gd")):element.find(".wpgmza_directions_button").hide(),element.show(),this.trigger("domready"),this.trigger("infowindowopen"),!0},WPGMZA.ProInfoWindow.prototype.close=function(){$(this.feature.map.element).find(".wpgmza-pro-info-window-container").html()},WPGMZA.ProInfoWindow.prototype.setPosition=function(position){},$(document).ready(function(event){$(document.body).on("click",".wpgmza-close-info-window",function(event){$(event.target).closest(".wpgmza-info-window").remove()})})}),jQuery(function($){var Parent;WPGMZA.GoogleInfoWindow=function(feature){Parent.call(this,feature),this.setFeature(feature)},WPGMZA.GoogleInfoWindow.Z_INDEX=99,Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.GoogleInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.GoogleInfoWindow.prototype.constructor=WPGMZA.GoogleInfoWindow,WPGMZA.GoogleInfoWindow.prototype.setFeature=function(feature){(this.feature=feature)instanceof WPGMZA.Marker?this.googleObject=feature.googleMarker:feature instanceof WPGMZA.Polygon?this.googleObject=feature.googlePolygon:feature instanceof WPGMZA.Polyline&&(this.googleObject=feature.googlePolyline)},WPGMZA.GoogleInfoWindow.prototype.createGoogleInfoWindow=function(){var self=this;this.googleInfoWindow||(this.googleInfoWindow=new google.maps.InfoWindow,this.googleInfoWindow.setZIndex(WPGMZA.GoogleInfoWindow.Z_INDEX),google.maps.event.addListener(this.googleInfoWindow,"domready",function(event){self.trigger("domready")}),google.maps.event.addListener(this.googleInfoWindow,"closeclick",function(event){self.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(self.state=WPGMZA.InfoWindow.STATE_CLOSED,self.feature.map.trigger("infowindowclose"))}))},WPGMZA.GoogleInfoWindow.prototype.open=function(map,html){var self=this;if(!Parent.prototype.open.call(this,map,html))return!1;this.parent=map,this.createGoogleInfoWindow(),this.setFeature(html),this.googleInfoWindow.open(this.feature.map.googleMap,this.googleObject);var intervalID,guid=WPGMZA.guid(),html=WPGMZA.isProVersion()?"":this.addEditButton(),html="<div id='"+guid+"'>"+html+" "+this.content+"</div>";return this.googleInfoWindow.setContent(html),intervalID=setInterval(function(event){div=$("#"+guid),div.length&&(clearInterval(intervalID),div[0].wpgmzaFeature=self.feature,div.addClass("wpgmza-infowindow"),self.element=div[0],self.trigger("infowindowopen"))},50),!0},WPGMZA.GoogleInfoWindow.prototype.close=function(){this.googleInfoWindow&&(WPGMZA.InfoWindow.prototype.close.call(this),this.googleInfoWindow.close())},WPGMZA.GoogleInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html,this.createGoogleInfoWindow(),this.googleInfoWindow.setContent(html)},WPGMZA.GoogleInfoWindow.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.createGoogleInfoWindow(),this.googleInfoWindow.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.OLInfoWindow=function(feature){var self=this;Parent.call(this,feature),this.element=$("<div class='wpgmza-infowindow ol-info-window-container ol-info-window-plain'></div>")[0],$(this.element).on("click",".ol-info-window-close",function(event){self.close()})},Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.OLInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.OLInfoWindow.prototype.constructor=WPGMZA.OLInfoWindow,Object.defineProperty(WPGMZA.OLInfoWindow.prototype,"isPanIntoViewAllowed",{get:function(){return!0}}),WPGMZA.OLInfoWindow.prototype.open=function(map,feature){var self=this,latLng=feature.getPosition();if(!Parent.prototype.open.call(this,map,feature))return!1;this.parent=map,this.overlay&&this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=new ol.Overlay({element:this.element,stopEvent:!0,insertFirst:!0}),this.overlay.setPosition(ol.proj.fromLonLat([latLng.lng,latLng.lat])),self.feature.map.olMap.addOverlay(this.overlay),$(this.element).show(),this.setContent(this.content),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&WPGMZA.getImageDimensions(feature.getIcon(),function(size){$(self.element).css({left:Math.round(size.width/2)+"px"})}),this.trigger("infowindowopen"),this.trigger("domready")},WPGMZA.OLInfoWindow.prototype.close=function(event){$(this.element).hide(),this.overlay&&(WPGMZA.InfoWindow.prototype.close.call(this),this.trigger("infowindowclose"),this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=null)},WPGMZA.OLInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html;var eaBtn=WPGMZA.isProVersion()?"":this.addEditButton();$(this.element).html(eaBtn+"<i class='fa fa-times ol-info-window-close' aria-hidden='true'></i>"+html)},WPGMZA.OLInfoWindow.prototype.setOptions=function(options){options.maxWidth&&$(this.element).css({"max-width":options.maxWidth+"px"})},WPGMZA.OLInfoWindow.prototype.onOpen=function(){var self=this,imgs=$(this.element).find("img"),numImages=imgs.length,numImagesLoaded=0;function inside(a,b){a=$(a)[0].getBoundingClientRect(),b=$(b)[0].getBoundingClientRect();return a.left>=b.left&&a.left<=b.right&&a.right<=b.right&&a.right>=b.left&&a.top>=b.top&&a.top<=b.bottom&&a.bottom<=b.bottom&&a.bottom>=b.top}function panIntoView(){var offset=.45*-$(self.element).height();self.feature.map.animateNudge(0,offset,self.feature.getPosition())}WPGMZA.InfoWindow.prototype.onOpen.apply(this,arguments),this.isPanIntoViewAllowed&&(imgs.each(function(index,el){el.onload=function(){++numImagesLoaded!=numImages||inside(self.element,self.feature.map.element)||panIntoView()}}),0!=numImages||inside(self.element,self.feature.map.element)||panIntoView())}}),jQuery(function($){WPGMZA.LatLng.fromJpeg=function(src,callback){var img=new Image;img.onload=function(){EXIF.getData(img,function(){var fLat,fLng,aLat=EXIF.getTag(img,"GPSLatitude"),aLng=EXIF.getTag(img,"GPSLongitude");aLat&&aLng?(fLat=EXIF.getTag(img,"GPSLatitudeRef")||"N",fLng=EXIF.getTag(img,"GPSLongitudeRef")||"W",fLat=(aLat[0]+aLat[1]/60+aLat[2]/3600)*("N"==fLat?1:-1),fLng=(aLng[0]+aLng[1]/60+aLng[2]/3600)*("W"==fLng?-1:1),callback(new WPGMZA.LatLng({lat:fLat,lng:fLng}))):callback(null)})},img.src=src},WPGMZA.LatLng.EXIF_ADDRESS_GEOCODE_KM_THRESHOLD=.5,$(document.body).on("click",".wpgmza-get-location-from-picture[data-source][data-destination]",function(event){var url,m=$(this).attr("data-source"),dest=$(this).attr("data-destination"),lat=$(this).attr("data-destination-lat"),lng=$(this).attr("data-destination-lng");if(!$(m).length)throw alert(WPGMZA.localized_strings.no_picture_found),new Error("Source element not found");if(!$(dest).length)throw new Error("Destination element not found");if($(m).is("img"))url=$(m).attr("src");else{if(!(m=$(m).css("background-image").match(/url\(["'](.+)["'"]\)/)))throw new Error("No background image found");url=m[1]}url&&0!=url.length||alert(WPGMZA.localized_strings.no_picture_found),WPGMZA.LatLng.fromJpeg(url,function(jpegLatLng){var geocoder;jpegLatLng?($(dest).val(jpegLatLng.toString()),lat&&lng&&($(lat).val(jpegLatLng.lat),$(lng).val(jpegLatLng.lng)),WPGMZA.settings.useRawJpegCoordinates||(geocoder=WPGMZA.Geocoder.createInstance()).getAddressFromLatLng({latLng:jpegLatLng},function(results,status){var address;status==WPGMZA.Geocoder.SUCCESS&&(address=results[0],geocoder.getLatLngFromAddress({address:address},function(addressLatLng,status){status==WPGMZA.Geocoder.SUCCESS&&(addressLatLng=new WPGMZA.LatLng(addressLatLng[0].latLng),WPGMZA.Distance.between(addressLatLng,jpegLatLng)<=WPGMZA.LatLng.EXIF_ADDRESS_GEOCODE_KM_THRESHOLD&&$(dest).val(address))}))})):alert(WPGMZA.localized_strings.no_gps_coordinates)})})}),jQuery(function($){"map-edit"==WPGMZA.currentPage&&(WPGMZA.ProMapEditPage=function(){var self=this;WPGMZA.MapEditPage.apply(this,arguments),this.directionsOriginIconPicker=new WPGMZA.MarkerIconPicker($("#directions_origin_icon_picker_container > .wpgmza-marker-icon-picker")),this.directionsDestinationIconPicker=new WPGMZA.MarkerIconPicker($("#directions_destination_icon_picker_container > .wpgmza-marker-icon-picker")),this.advancedSettingsMarkerIconPicker=new WPGMZA.MarkerIconPicker($("#advanced-settings-marker-icon-picker-container .wpgmza-marker-icon-picker")),this.userIconPicker=new WPGMZA.MarkerIconPicker($("#wpgmza_show_user_location_conditional .wpgmza-marker-icon-picker")),this.storeLocatorIconPicker=new WPGMZA.MarkerIconPicker($("#wpgmza_store_locator_bounce_conditional .wpgmza-marker-icon-picker")),$("input[name='store_locator_search_area']").on("input",function(event){self.onStoreLocatorSearchAreaChanged(event)}),self.onStoreLocatorSearchAreaChanged(),$('input[name="wpgmza_iw_type"][value="1"]').prop("checked")||$('input[name="wpgmza_iw_type"][value="2"]').prop("checked")||$('input[name="wpgmza_iw_type"][value="3"]').prop("checked")?$("#iw_custom_colors_row").fadeIn():$("#iw_custom_colors_row").fadeOut(),$(".iw_custom_click_show").on("click",function(){$("#iw_custom_colors_row").fadeIn()}),$(".iw_custom_click_hide").on("click",function(){$("#iw_custom_colors_row").fadeOut()}),$("#wpgmza_push_in_map").prop("checked")?$("#wpgmza_marker_list_conditional").fadeIn():$("#wpgmza_marker_list_conditional").fadeOut(),$("#wpgmza_push_in_map").on("change",function(){$(this).prop("checked")?$("#wpgmza_marker_list_conditional").fadeIn():$("#wpgmza_marker_list_conditional").fadeOut()}),$("#wpgmza_show_user_location").prop("checked")?$("#wpgmza_show_user_location_conditional").fadeIn():$("#wpgmza_show_user_location_conditional").fadeOut(),$("#wpgmza_show_user_location").on("change",function(){$(this).prop("checked")?$("#wpgmza_show_user_location_conditional").fadeIn():$("#wpgmza_show_user_location_conditional").fadeOut()}),$("#wpgmza_store_locator_bounce").prop("checked")?$("#wpgmza_store_locator_bounce_conditional").fadeIn():$("#wpgmza_store_locator_bounce_conditional").fadeOut(),$("#wpgmza_store_locator_bounce").on("change",function(){$(this).prop("checked")?$("#wpgmza_store_locator_bounce_conditional").fadeIn():$("#wpgmza_store_locator_bounce_conditional").fadeOut()}),$("#zoom_level_on_marker_listing_override").prop("checked")?$("#zoom_level_on_marker_listing_click_level").fadeIn():$("#zoom_level_on_marker_listing_click_level").fadeOut(),$("#zoom_level_on_marker_listing_override").on("change",function(){$(this).prop("checked")?$("#zoom_level_on_marker_listing_click_level").fadeIn():$("#zoom_level_on_marker_listing_click_level").fadeOut()}),$("#zoom-on-marker-listing-click-slider").slider({range:"max",min:1,max:21,value:$("input[name='zoom_level_on_marker_listing_click']").val(),slide:function(event,ui){$("input[name='zoom_level_on_marker_listing_click']").val(ui.value)}}),$("#wpgmza_override_users_location_zoom_level").prop("checked")?$("#wpgmza_override_users_location_zoom_levels_slider").fadeIn():$("#wpgmza_override_users_location_zoom_levels_slider").fadeOut(),$("#wpgmza_override_users_location_zoom_level").on("change",function(){$(this).prop("checked")?$("#wpgmza_override_users_location_zoom_levels_slider").fadeIn():$("#wpgmza_override_users_location_zoom_levels_slider").fadeOut()}),$("#override-users-location-zoom-levels-slider").slider({range:"max",min:1,max:21,value:$("input[name='override_users_location_zoom_levels']").val(),slide:function(event,ui){$("input[name='override_users_location_zoom_levels']").val(ui.value)}}),$("#open-route-service-key-notice").wrapInner("<div class='notice notice-error'><p></p></div>"),$("#zoom-on-marker-click-slider").slider({range:"max",min:1,max:21,value:$("input[name='wpgmza_zoom_on_marker_click_slider']").val(),slide:function(event,ui){$("input[name='wpgmza_zoom_on_marker_click_slider']").val(ui.value)}}),$("#wpgmza_zoom_on_marker_click").prop("checked")?$("#wpgmza_zoom_on_marker_click_zoom_level").fadeIn():$("#wpgmza_zoom_on_marker_click_zoom_level").fadeOut(),$("#wpgmza_zoom_on_marker_click").on("change",function(){$(this).prop("checked")?$("#wpgmza_zoom_on_marker_click_zoom_level").fadeIn():$("#wpgmza_zoom_on_marker_click_zoom_level").fadeOut()}),$("#datatable_result").prop("checked")?$("#datable_strings").fadeIn():$("#datable_strings").fadeOut(),$("#datatable_result").on("change",function(){$(this).prop("checked")?$("#datable_strings").fadeIn():$("#datable_strings").fadeOut()}),$("#datatable_result_page").prop("checked")?$("#datable_strings_entries").fadeIn():$("#datable_strings_entries").fadeOut(),$("#datatable_result_page").on("change",function(){$(this).prop("checked")?$("#datable_strings_entries").fadeIn():$("#datable_strings_entries").fadeOut()})},WPGMZA.extend(WPGMZA.ProMapEditPage,WPGMZA.MapEditPage),WPGMZA.ProMapEditPage.prototype.onStoreLocatorSearchAreaChanged=function(event){var value=$("input[name='store_locator_search_area']:checked").val();$("[data-search-area='"+value+"']").show(),$("[data-search-area][data-search-area!='"+value+"']").hide()})}),jQuery(function($){WPGMZA.ProMapListPage=function(){var self=this;WPGMZA.MapListPage.apply(this,arguments),$("[data-action='new-map']").on("click",function(event){self.onNewMap(event)}),$("[data-action='wizard']").on("click",function(event){self.onWizard(event)})},WPGMZA.extend(WPGMZA.ProMapListPage,WPGMZA.MapListPage),WPGMZA.MapListPage.createInstance=function(){return new WPGMZA.ProMapListPage},WPGMZA.ProMapListPage.prototype.onNewMap=function(event){$(event.target).prop("disabled","true"),WPGMZA.restAPI.call("/maps/",{method:"POST",data:{map_title:WPGMZA.localized_strings.new_map,map_start_lat:36.778261,map_start_lng:-119.4179323999,map_start_zoom:3},success:function(response,status,xhr){window.location.href=window.location.href="admin.php?page=wp-google-maps-menu&action=edit&map_id="+response.id}})},WPGMZA.ProMapListPage.prototype.onWizard=function(event){window.location.href="admin.php?page=wp-google-maps-menu&action=wizard"}}),jQuery(function($){WPGMZA.ProMap=function(element,options){var self=this;this._markersPlaced=!1,this.element=element,WPGMZA.Map.call(this,element,options),this.defaultMarkerIcon=null,this.settings.upload_default_marker&&(this.defaultMarkerIcon=WPGMZA.MarkerIcon.createInstance(this.settings.upload_default_marker)),this.heatmaps=[],this.showDistanceFromLocation=null,this.initCustomFieldFilterController(),this.initUserLocationMarker(),this.on("filteringcomplete",function(){self.onFilteringComplete()}),this._onMarkersPlaced=function(event){self.onMarkersPlaced(event)},this.on("markersplaced",this._onMarkersPlaced),WPGMZA.CloudAPI&&WPGMZA.CloudAPI.isBeingUsed&&WPGMZA.cloudAPI.call("/load")},WPGMZA.ProMap.prototype=Object.create(WPGMZA.Map.prototype),WPGMZA.ProMap.prototype.constructor=WPGMZA.ProMap,WPGMZA.ProMap.SHOW_DISTANCE_FROM_USER_LOCATION="user",WPGMZA.ProMap.SHOW_DISTANCE_FROM_SEARCHED_ADDRESS="searched",WPGMZA.ProMap.ControlPosition={TOP_CENTER:1,TOP_LEFT:2,TOP_RIGHT:3,LEFT_TOP:4,RIGHT_TOP:5,LEFT_CENTER:6,RIGHT_CENTER:7,LEFT_BOTTOM:8,RIGHT_BOTTOM:9,BOTTOM_CENTER:10,BOTTOM_LEFT:11,BOTTOM_RIGHT:12},Object.defineProperty(WPGMZA.ProMap.prototype,"mashupIDs",{get:function(){var result=[],attr=$(this.element).attr("data-mashup-ids");return attr&&attr.length&&(result=attr.split(",")),result}}),Object.defineProperty(WPGMZA.ProMap.prototype,"directionsEnabled",{get:function(){return 1==this.settings.directions_enabled}}),WPGMZA.ProMap.prototype.onInit=function(event){var latLng,zoom,self=this;WPGMZA.Map.prototype.onInit.apply(this,arguments),this.initDirectionsBox(),this.shortcodeAttributes.lat&&this.shortcodeAttributes.lng?(latLng=new WPGMZA.LatLng({lat:this.shortcodeAttributes.lat,lng:this.shortcodeAttributes.lng}),this.setCenter(latLng),this.shortcodeAttributes.mark_center&&"true"===this.shortcodeAttributes.mark_center&&(zoom=WPGMZA.Marker.createInstance({lat:this.shortcodeAttributes.lat,lng:this.shortcodeAttributes.lng,address:this.shortcodeAttributes.lat+", "+this.shortcodeAttributes.lng}),this.addMarker(zoom))):this.shortcodeAttributes.address&&WPGMZA.Geocoder.createInstance().geocode({address:this.shortcodeAttributes.address},function(results,status){status==WPGMZA.Geocoder.SUCCESS?self.setCenter(results[0].latLng):console.warn("Shortcode attribute address could not be geocoded")}),(zoom=WPGMZA.getQueryParamValue("mzoom"))&&this.setZoom(zoom),WPGMZA.getCurrentPage()!=WPGMZA.PAGE_MAP_EDIT&&"1"==this.settings.automatically_pan_to_users_location&&WPGMZA.getCurrentPosition(function(result){self.userLocationMarker||self.initUserLocationMarker(result),self.setCenter(new WPGMZA.LatLng({lat:result.coords.latitude,lng:result.coords.longitude})),self.settings.override_users_location_zoom_level&&self.setZoom(self.settings.override_users_location_zoom_levels)})},WPGMZA.ProMap.prototype.onMarkersPlaced=function(event){var self=this,jumpToNearestMarker=0==WPGMZA.is_admin&&1==self.settings.jump_to_nearest_marker_on_initialization;if(this.settings.order_markers_by!=WPGMZA.MarkerListing.ORDER_BY_DISTANCE&&1!=this.settings.show_distance_from_location&&!jumpToNearestMarker||WPGMZA.getCurrentPosition(function(location){location=new WPGMZA.LatLng({lat:location.coords.latitude,lng:location.coords.longitude});self.userLocation=location,self.userLocation.source=WPGMZA.ProMap.SHOW_DISTANCE_FROM_USER_LOCATION,self.showDistanceFromLocation=location,self.updateInfoWindowDistances(),self.markerListing&&(self.markersPlaced?self.markerListing.reload():self.on("markersplaced",function(event){self.markerListing.reload()})),jumpToNearestMarker&&self.panToNearestMarker(location)},function(error){self.markerListing&&self.markerListing.reload()}),self.settings.fit_maps_bounds_to_markers&&0<self.markers.length&&self.fitBoundsToMarkers(),self.initMarkerListing(),1==this.settings.mass_marker_support&&WPGMZA.MarkerClusterer){var options={};if(WPGMZA.settings.wpgmza_cluster_advanced_enabled){var styles=[];options.gridSize=parseInt(WPGMZA.settings.wpgmza_cluster_grid_size),options.maxZoom=parseInt(WPGMZA.settings.wpgmza_cluster_max_zoom),options.minClusterSize=parseInt(WPGMZA.settings.wpgmza_cluster_min_cluster_size),options.zoomOnClick=!!WPGMZA.settings.wpgmza_cluster_zoom_click;for(var i=1;i<=5;i++)level={},level.url=WPGMZA.settings["clusterLevel"+i].replace(/%2F/g,"/"),level.width=parseInt(WPGMZA.settings["clusterLevel"+i+"Width"]),level.height=parseInt(WPGMZA.settings["clusterLevel"+i+"Height"]),level.textColor=WPGMZA.settings.wpgmza_cluster_font_color,level.textSize=parseInt(WPGMZA.settings.wpgmza_cluster_font_size),styles.push(level);options.styles=styles}this.markerClusterer=new WPGMZA.MarkerClusterer(this,null,options),this.markerClusterer.addMarkers(this.markers)}},WPGMZA.ProMap.prototype.getRESTParameters=function(options){var params=WPGMZA.Map.prototype.getRESTParameters.apply(this,arguments);return this.settings.only_load_markers_within_viewport&&this.initialFetchCompleted&&(params.include="markers"),params},WPGMZA.ProMap.prototype.fetchFeatures=function(){var self=this;this.settings.only_load_markers_within_viewport?this.on("idle",function(event){self.fetchFeaturesViaREST(),self.initialFetchCompleted=!0}):WPGMZA.Map.prototype.fetchFeatures.apply(this,arguments)},WPGMZA.ProMap.prototype.onMarkersFetched=function(data,expectMoreBatches){this.settings.only_load_markers_within_viewport&&this.removeAllMarkers(),WPGMZA.Map.prototype.onMarkersFetched.apply(this,arguments)},WPGMZA.ProMap.prototype.panToNearestMarker=function(latlng){var closestMarker,distance=1/0;latlng=latlng||this.getCenter();for(var i=0;i<this.markers.length;i++){var distanceToMarker=WPGMZA.Distance.between(latlng,this.markers[i].getPosition());distanceToMarker<distance&&(closestMarker=this.markers[i],distance=distanceToMarker)}closestMarker&&this.panTo(closestMarker.getPosition(this.setZoom(7)))},WPGMZA.ProMap.prototype.fitBoundsToMarkers=function(markers){var bounds=new WPGMZA.LatLngBounds;markers=markers||this.markers;for(var i=0;i<markers.length;i++){if(!(markers[i]instanceof WPGMZA.Marker))throw new Error("Invalid input, not a WPGMZA.Marker");markers[i].isFiltered||bounds.extend(markers[i])}this.fitBounds(bounds)},WPGMZA.ProMap.prototype.fitMapBoundsToMarkers=WPGMZA.ProMap.prototype.fitBoundsToMarkers,WPGMZA.ProMap.prototype.resetBounds=function(){var latlng=new WPGMZA.LatLng(this.settings.map_start_lat,this.settings.map_start_lng);this.panTo(latlng),this.setZoom(this.settings.map_start_zoom)},WPGMZA.ProMap.prototype.onFilteringComplete=function(){if("1"==this.settings.fit_maps_bounds_to_markers_after_filtering){for(var areMarkersVisible=!1,i=0;i<this.markers.length;i++)if(!this.markers[i].isFiltered){areMarkersVisible=!0;break}areMarkersVisible&&this.fitBoundsToMarkers()}},WPGMZA.ProMap.prototype.initMarkerListing=function(){var markerListingElement;"1"!=WPGMZA.is_admin&&(markerListingElement=$("[data-wpgmza-marker-listing][id$='_"+this.id+"']"),this.markerListing=WPGMZA.MarkerListing.createInstance(this,markerListingElement[0]),this.off("markersplaced",this._onMarkersPlaced),delete this._onMarkersPlaced)},WPGMZA.ProMap.prototype.initCustomFieldFilterController=function(){this.customFieldFilterController=WPGMZA.CustomFieldFilterController.createInstance(this.id),WPGMZA.useLegacyGlobals&&wpgmzaLegacyGlobals.MYMAP[this.id]&&(wpgmzaLegacyGlobals.MYMAP[this.id].customFieldFilterController=this.customFieldFilterController)},WPGMZA.ProMap.prototype.initUserLocationMarker=function(cachedPos){var icon,options,marker,self=this;1==this.settings.show_user_location&&1!=parseInt(WPGMZA.is_admin)&&(icon=this.settings.upload_default_ul_marker,options={id:WPGMZA.guid(),animation:WPGMZA.Marker.ANIMATION_DROP,user_location:!0},icon&&icon.length&&(options.icon=icon),this.settings.upload_default_ul_marker_retina&&(options.retina=!0),(marker=WPGMZA.Marker.createInstance(options)).isFilterable=!1,marker.setOptions({zIndex:999999}),marker._icon.retina=marker.retina,cachedPos&&cachedPos.coords&&(marker.setPosition({lat:cachedPos.coords.latitude,lng:cachedPos.coords.longitude}),marker.map||self.addMarker(marker),self.userLocationMarker||(self.userLocationMarker=marker,self.trigger("userlocationmarkerplaced"))),WPGMZA.watchPosition(function(position){marker.setPosition({lat:position.coords.latitude,lng:position.coords.longitude}),marker.map||self.addMarker(marker),self.userLocationMarker||(self.userLocationMarker=marker,self.trigger("userlocationmarkerplaced"))}))},WPGMZA.ProMap.prototype.initDirectionsBox=function(){1!=WPGMZA.is_admin&&this.directionsEnabled&&(this.directionsBox=WPGMZA.DirectionsBox.createInstance(this))},WPGMZA.ProMap.prototype.addHeatmap=function(heatmap){if(!(heatmap instanceof WPGMZA.Heatmap))throw new Error("Argument must be an instance of WPGMZA.Heatmap");(heatmap.map=this).heatmaps.push(heatmap),this.dispatchEvent({type:"heatmapadded",heatmap:heatmap})},WPGMZA.ProMap.prototype.getHeatmapByID=function(id){for(var i=0;i<this.heatmaps.length;i++)if(this.heatmaps[i].id==id)return this.heatmaps[i];return null},WPGMZA.ProMap.prototype.removeHeatmap=function(heatmap){if(!(heatmap instanceof WPGMZA.Heatmap))throw new Error("Argument must be an instance of WPGMZA.Heatmap");if(heatmap.map!=this)throw new Error("Wrong map error");heatmap.map=null,heatmap instanceof WPGMZA.GoogleHeatmap&&heatmap.googleHeatmap.setMap(null),this.heatmaps.splice(this.heatmaps.indexOf(heatmap),1),this.dispatchEvent({type:"heatmapremoved",heatmap:heatmap})},WPGMZA.ProMap.prototype.removeHeatmapByID=function(heatmap){heatmap=this.getHeatmapByID(heatmap);heatmap&&this.removeHeatmap(heatmap)},WPGMZA.ProMap.prototype.getInfoWindowStyle=function(){if(!this.settings.other_settings)return WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE;var local=this.settings.other_settings.wpgmza_iw_type,global=WPGMZA.settings.wpgmza_iw_type;return"-1"==local&&"-1"==global?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:"-1"==local?global:local||WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE},WPGMZA.ProMap.prototype.getFilteringParameters=function(){},WPGMZA.ProMap.prototype.updateInfoWindowDistances=function(){this.showDistanceFromLocation;this.markers.forEach(function(marker){marker.infoWindow&&marker.infoWindow.updateDistanceFromLocation()})},WPGMZA.ProMap.prototype.hasVisibleMarkers=function(){for(var markers=this.markers,i=0;i<markers.length;i++)if(markers[i].isFilterable&&markers[i].getVisible())return!0;return!1},WPGMZA.ProMap.prototype.pushElementIntoMapPanel=function(element,position){},WPGMZA.ProMap.prototype.onClick=function(event){this.settings.close_infowindow_on_map_click&&event.target instanceof WPGMZA.Map&&void 0!==this.lastInteractedMarker&&this.lastInteractedMarker.infoWindow&&(this.lastInteractedMarker.infoWindow.close(),$(this.lastInteractedMarker.infoWindow.element).hasClass("wpgmza_modern_infowindow")&&$(this.lastInteractedMarker.infoWindow.element).remove())},jQuery(document).bind("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){var isFullScreen=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen,modernMarkerButton=jQuery(".wpgmza-modern-marker-open-button"),modernPopoutPanel=jQuery(".wpgmza-popout-panel"),modernStoreLocator=jQuery(".wpgmza-modern-store-locator"),fullScreenMap=void 0,fullScreenMap=(modernMarkerButton.length?modernMarkerButton:modernPopoutPanel.length?modernPopoutPanel:modernStoreLocator).parent(".wpgmza_map").children("div").first();isFullScreen&&void 0!==fullScreenMap&&fullScreenMap.append(modernMarkerButton,modernPopoutPanel,modernStoreLocator)})}),jQuery(function($){var Parent;WPGMZA.GoogleMap=function(element,options){var self=this;Parent.call(this,element,options),this.loadGoogleMap(),options?this.setOptions(options,!0):this.setOptions({},!0),google.maps.event.addListener(this.googleMap,"click",function(event){var wpgmzaEvent=new WPGMZA.Event("click");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"rightclick",function(event){var wpgmzaEvent=new WPGMZA.Event("rightclick");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"dragend",function(event){self.dispatchEvent("dragend")}),google.maps.event.addListener(this.googleMap,"zoom_changed",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged")}),google.maps.event.addListener(this.googleMap,"idle",function(event){self.onIdle(event)}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},WPGMZA.isProVersion()?(Parent=WPGMZA.ProMap,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.ProMap.prototype)):(Parent=WPGMZA.Map,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.Map.prototype)),WPGMZA.GoogleMap.prototype.constructor=WPGMZA.GoogleMap,WPGMZA.GoogleMap.parseThemeData=function(raw){var json;try{json=JSON.parse(raw)}catch(e){try{json=eval(raw)}catch(e){var str=raw,str=str.replace(/\\'/g,"'");str=str.replace(/\\"/g,'"'),str=str.replace(/\\0/g,"\0"),str=str.replace(/\\\\/g,"\\");try{json=eval(str)}catch(e){return console.warn("Couldn't parse theme data"),[]}}}return json},WPGMZA.GoogleMap.prototype.loadGoogleMap=function(){var self=this,options=this.settings.toGoogleMapsOptions();this.googleMap=new google.maps.Map(this.engineElement,options),google.maps.event.addListener(this.googleMap,"bounds_changed",function(){self.onBoundsChanged()}),1==this.settings.bicycle&&this.enableBicycleLayer(!0),1==this.settings.traffic&&this.enableTrafficLayer(!0),this.settings.transport_layer&&this.enablePublicTransportLayer(!0),this.showPointsOfInterest(this.settings.wpgmza_show_point_of_interest),$(this.engineElement).append($(this.element).find(".wpgmza-loader"))},WPGMZA.GoogleMap.prototype.setOptions=function(options,clone){Parent.prototype.setOptions.call(this,options),options.scrollwheel&&delete options.scrollwheel,clone?(clone=$.extend(options,this.settings.toGoogleMapsOptions()),!(clone=$.extend({},clone)).center instanceof google.maps.LatLng&&(clone.center instanceof WPGMZA.LatLng||"object"==typeof clone.center)&&(clone.center={lat:parseFloat(clone.center.lat),lng:parseFloat(clone.center.lng)}),this.settings.hide_point_of_interest&&(clone.styles||(clone.styles=[]),clone.styles.push({featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]})),this.googleMap.setOptions(clone)):this.googleMap.setOptions(options)},WPGMZA.GoogleMap.prototype.addMarker=function(marker){marker.googleMarker.setMap(this.googleMap),Parent.prototype.addMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.removeMarker=function(marker){marker.googleMarker.setMap(null),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.addPolygon=function(polygon){polygon.googlePolygon.setMap(this.googleMap),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.removePolygon=function(polygon){polygon.googlePolygon.setMap(null),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.addPolyline=function(polyline){polyline.googlePolyline.setMap(this.googleMap),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.removePolyline=function(polyline){polyline.googlePolyline.setMap(null),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.addCircle=function(circle){circle.googleCircle.setMap(this.googleMap),Parent.prototype.addCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.removeCircle=function(circle){circle.googleCircle.setMap(null),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.addRectangle=function(rectangle){rectangle.googleRectangle.setMap(this.googleMap),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.removeRectangle=function(rectangle){rectangle.googleRectangle.setMap(null),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.getCenter=function(){var latLng=this.googleMap.getCenter();return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.setCenter=function(latLng){WPGMZA.Map.prototype.setCenter.call(this,latLng),latLng instanceof WPGMZA.LatLng?this.googleMap.setCenter({lat:latLng.lat,lng:latLng.lng}):this.googleMap.setCenter(latLng)},WPGMZA.GoogleMap.prototype.panTo=function(latLng){latLng instanceof WPGMZA.LatLng?this.googleMap.panTo({lat:latLng.lat,lng:latLng.lng}):this.googleMap.panTo(latLng)},WPGMZA.GoogleMap.prototype.getZoom=function(){return this.googleMap.getZoom()},WPGMZA.GoogleMap.prototype.setZoom=function(value){if(isNaN(value))throw new Error("Value must not be NaN");return this.googleMap.setZoom(parseInt(value))},WPGMZA.GoogleMap.prototype.getBounds=function(){var nativeBounds=new WPGMZA.LatLngBounds({});try{var southWest=this.googleMap.getBounds(),northEast=southWest.getNorthEast(),southWest=southWest.getSouthWest();nativeBounds.north=northEast.lat(),nativeBounds.south=southWest.lat(),nativeBounds.west=southWest.lng(),nativeBounds.east=northEast.lng(),nativeBounds.topLeft={lat:northEast.lat(),lng:southWest.lng()},nativeBounds.bottomRight={lat:southWest.lat(),lng:northEast.lng()}}catch(ex){}return nativeBounds},WPGMZA.GoogleMap.prototype.fitBounds=function(southWest,nativeBounds){var bounds;southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),nativeBounds instanceof WPGMZA.LatLng?nativeBounds={lat:nativeBounds.lat,lng:nativeBounds.lng}:southWest instanceof WPGMZA.LatLngBounds&&(southWest={lat:(bounds=southWest).south,lng:bounds.west},nativeBounds={lat:bounds.north,lng:bounds.east});nativeBounds=new google.maps.LatLngBounds(southWest,nativeBounds);this.googleMap.fitBounds(nativeBounds)},WPGMZA.GoogleMap.prototype.fitBoundsToVisibleMarkers=function(){for(var bounds=new google.maps.LatLngBounds,i=0;i<this.markers.length;i++)markers[i].getVisible()&&bounds.extend(markers[i].getPosition());this.googleMap.fitBounds(bounds)},WPGMZA.GoogleMap.prototype.enableBicycleLayer=function(enable){this.bicycleLayer||(this.bicycleLayer=new google.maps.BicyclingLayer),this.bicycleLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enableTrafficLayer=function(enable){this.trafficLayer||(this.trafficLayer=new google.maps.TrafficLayer),this.trafficLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enablePublicTransportLayer=function(enable){this.publicTransportLayer||(this.publicTransportLayer=new google.maps.TransitLayer),this.publicTransportLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.showPointsOfInterest=function(show){var styles=$("textarea[name='theme_data']").val();styles&&((styles=JSON.parse(styles)).push({featureType:"poi",stylers:[{visibility:show?"on":"off"}]}),this.googleMap.setOptions({styles:styles}))},WPGMZA.GoogleMap.prototype.getMinZoom=function(){return parseInt(this.settings.min_zoom)},WPGMZA.GoogleMap.prototype.setMinZoom=function(value){this.googleMap.setOptions({minZoom:value,maxZoom:this.getMaxZoom()})},WPGMZA.GoogleMap.prototype.getMaxZoom=function(){return parseInt(this.settings.max_zoom)},WPGMZA.GoogleMap.prototype.setMaxZoom=function(value){this.googleMap.setOptions({minZoom:this.getMinZoom(),maxZoom:value})},WPGMZA.GoogleMap.prototype.latLngToPixels=function(scale){var map=this.googleMap,worldPoint=new google.maps.LatLng({lat:parseFloat(scale.lat),lng:parseFloat(scale.lng)}),topRight=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),worldPoint=map.getProjection().fromLatLngToPoint(worldPoint);return{x:(worldPoint.x-bottomLeft.x)*scale,y:(worldPoint.y-topRight.y)*scale}},WPGMZA.GoogleMap.prototype.pixelsToLatLng=function(x,y){null==y&&("x"in x&&"y"in x?(y=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));var map=this.googleMap,latLng=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),latLng=new google.maps.Point(x/scale+bottomLeft.x,y/scale+latLng.y),latLng=map.getProjection().fromPointToLatLng(latLng);return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.onElementResized=function(event){this.googleMap&&google.maps.event.trigger(this.googleMap,"resize")},WPGMZA.GoogleMap.prototype.enableAllInteractions=function(){var options={scrollwheel:!0,draggable:!0,disableDoubleClickZoom:!1};this.googleMap.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.OLMap=function(element,viewOptions){var self=this;Parent.call(this,element),this.setOptions(viewOptions);viewOptions=this.settings.toOLViewOptions();function isSettingDisabled(value){return"yes"===value||!!value}$(this.element).html(""),this.olMap=new ol.Map({target:$(element)[0],layers:[this.getTileLayer()],view:new ol.View(viewOptions)}),this.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_draggable)):interaction instanceof ol.interaction.DoubleClickZoom?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_clickzoom)):interaction instanceof ol.interaction.MouseWheelZoom&&interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_scroll))},this),"greedy"!=this.settings.wpgmza_force_greedy_gestures&&"yes"!=this.settings.wpgmza_force_greedy_gestures&&1!=this.settings.wpgmza_force_greedy_gestures&&(this.gestureOverlay=$("<div class='wpgmza-gesture-overlay'></div>"),this.gestureOverlayTimeoutID=null,WPGMZA.isTouchDevice()||(this.olMap.on("wheel",function(event){if(!ol.events.condition.platformModifierKeyOnly(event))return self.showGestureOverlay(),event.originalEvent.preventDefault(),!1}),this.gestureOverlay.text(WPGMZA.localized_strings.use_ctrl_scroll_to_zoom))),this.olMap.getControls().forEach(function(control){control instanceof ol.control.Zoom&&1==WPGMZA.settings.wpgmza_settings_map_zoom&&self.olMap.removeControl(control)},this),isSettingDisabled(WPGMZA.settings.wpgmza_settings_map_full_screen_control)||this.olMap.addControl(new ol.control.FullScreen),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(this.markerLayer=new ol.layer.Vector({source:new ol.source.Vector({features:[]})}),this.olMap.addLayer(this.markerLayer),this.olMap.on("click",function(marker){marker=self.olMap.getFeaturesAtPixel(marker.pixel);marker&&marker.length&&((marker=marker[0].wpgmzaMarker)&&(marker.trigger("click"),marker.trigger("select")))})),this.olMap.on("movestart",function(event){self.isBeingDragged=!0}),this.olMap.on("moveend",function(event){self.wrapLongitude(),self.isBeingDragged=!1,self.dispatchEvent("dragend"),self.onIdle()}),this.olMap.getView().on("change:resolution",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged"),setTimeout(function(){self.onIdle()},10)}),this.olMap.getView().on("change",function(){self.onBoundsChanged()}),self.onBoundsChanged(),this._mouseoverNativeFeatures=[],this.olMap.on("pointermove",function(event){if(!event.dragging){try{var featuresUnderPixel=event.target.getFeaturesAtPixel(event.pixel)}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];for(var props,nativeFeaturesUnderPixel=[],i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),-1==self._mouseoverNativeFeatures.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseover"),self._mouseoverNativeFeatures.push(nativeFeature)));for(i=self._mouseoverNativeFeatures.length-1;0<=i;i--)nativeFeature=self._mouseoverNativeFeatures[i],-1==nativeFeaturesUnderPixel.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseout"),self._mouseoverNativeFeatures.splice(i,1))}}),$(this.element).on("click contextmenu",function(event){var isRight;event=event||window.event;var latLng=self.pixelsToLatLng(event.offsetX,event.offsetY);if("which"in event?isRight=3==event.which:"button"in event&&(isRight=2==event.button),1==event.which||1==event.button){if(self.isBeingDragged)return;if($(event.target).closest(".ol-marker").length)return;try{var featuresUnderPixel=self.olMap.getFeaturesAtPixel([event.offsetX,event.offsetY])}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];for(var props,nativeFeaturesUnderPixel=[],i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),nativeFeature.trigger("click"));return 0<featuresUnderPixel.length?void 0:void self.trigger({type:"click",latLng:latLng})}if(isRight)return self.onRightClick(event)}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},Parent=WPGMZA.isProVersion()?WPGMZA.ProMap:WPGMZA.Map,WPGMZA.OLMap.prototype=Object.create(Parent.prototype),WPGMZA.OLMap.prototype.constructor=WPGMZA.OLMap,WPGMZA.OLMap.prototype.getTileLayer=function(){var options={};return WPGMZA.settings.tile_server_url&&(options.url=WPGMZA.settings.tile_server_url,"custom_override"===WPGMZA.settings.tile_server_url&&(WPGMZA.settings.tile_server_url_override&&""!==WPGMZA.settings.tile_server_url_override.trim()?options.url=WPGMZA.settings.tile_server_url_override.trim():options.url="https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png"),WPGMZA.settings.open_layers_api_key&&""!==WPGMZA.settings.open_layers_api_key&&(options.url+="?apikey="+WPGMZA.settings.open_layers_api_key.trim())),new ol.layer.Tile({source:new ol.source.OSM(options)})},WPGMZA.OLMap.prototype.wrapLongitude=function(){var center=ol.proj.transform(this.olMap.getView().getCenter(),"EPSG:3857","EPSG:4326"),center={lat:center[1],lng:center[0]};-180<=center.lng&&center.lng<=180||(center.lng=center.lng-360*Math.floor(center.lng/360),180<center.lng&&(center.lng-=360),this.setCenter(center))},WPGMZA.OLMap.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olMap.getView().getCenter());return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.setCenter=function(latLng){var view=this.olMap.getView();WPGMZA.Map.prototype.setCenter.call(this,latLng),view.setCenter(ol.proj.fromLonLat([latLng.lng,latLng.lat])),this.wrapLongitude(),this.onBoundsChanged()},WPGMZA.OLMap.prototype.getBounds=function(){var bottomRight=this.olMap.getView().calculateExtent(this.olMap.getSize()),nativeBounds=new WPGMZA.LatLngBounds,topLeft=ol.proj.toLonLat([bottomRight[0],bottomRight[1]]),bottomRight=ol.proj.toLonLat([bottomRight[2],bottomRight[3]]);return nativeBounds.north=topLeft[1],nativeBounds.south=bottomRight[1],nativeBounds.west=topLeft[0],nativeBounds.east=bottomRight[0],nativeBounds},WPGMZA.OLMap.prototype.fitBounds=function(southWest,extent){southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),extent instanceof WPGMZA.LatLng?extent={lat:extent.lat,lng:extent.lng}:southWest instanceof WPGMZA.LatLngBounds&&(southWest={lat:(view=southWest).south,lng:view.west},extent={lat:view.north,lng:view.east});var view=this.olMap.getView(),extent=ol.extent.boundingExtent([ol.proj.fromLonLat([parseFloat(southWest.lng),parseFloat(southWest.lat)]),ol.proj.fromLonLat([parseFloat(extent.lng),parseFloat(extent.lat)])]);view.fit(extent,this.olMap.getSize())},WPGMZA.OLMap.prototype.panTo=function(latLng,zoom){var view=this.olMap.getView(),options={center:ol.proj.fromLonLat([parseFloat(latLng.lng),parseFloat(latLng.lat)]),duration:500};1<arguments.length&&(options.zoom=parseInt(zoom)),view.animate(options)},WPGMZA.OLMap.prototype.getZoom=function(){return Math.round(this.olMap.getView().getZoom())},WPGMZA.OLMap.prototype.setZoom=function(value){this.olMap.getView().setZoom(value)},WPGMZA.OLMap.prototype.getMinZoom=function(){return this.olMap.getView().getMinZoom()},WPGMZA.OLMap.prototype.setMinZoom=function(value){this.olMap.getView().setMinZoom(value)},WPGMZA.OLMap.prototype.getMaxZoom=function(){return this.olMap.getView().getMaxZoom()},WPGMZA.OLMap.prototype.setMaxZoom=function(value){this.olMap.getView().setMaxZoom(value)},WPGMZA.OLMap.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.olMap&&this.olMap.getView().setProperties(this.settings.toOLViewOptions())},WPGMZA.OLMap.prototype.addMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.addOverlay(marker.overlay):(this.markerLayer.getSource().addFeature(marker.feature),marker.featureInSource=!0),Parent.prototype.addMarker.call(this,marker)},WPGMZA.OLMap.prototype.removeMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.removeOverlay(marker.overlay):(this.markerLayer.getSource().removeFeature(marker.feature),marker.featureInSource=!1),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.OLMap.prototype.addPolygon=function(polygon){this.olMap.addLayer(polygon.layer),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.OLMap.prototype.removePolygon=function(polygon){this.olMap.removeLayer(polygon.layer),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.OLMap.prototype.addPolyline=function(polyline){this.olMap.addLayer(polyline.layer),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.OLMap.prototype.removePolyline=function(polyline){this.olMap.removeLayer(polyline.layer),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.OLMap.prototype.addCircle=function(circle){this.olMap.addLayer(circle.layer),Parent.prototype.addCircle.call(this,circle)},WPGMZA.OLMap.prototype.removeCircle=function(circle){this.olMap.removeLayer(circle.layer),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.OLMap.prototype.addRectangle=function(rectangle){this.olMap.addLayer(rectangle.layer),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.removeRectangle=function(rectangle){this.olMap.removeLayer(rectangle.layer),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.pixelsToLatLng=function(x,lonLat){null==lonLat&&("x"in x&&"y"in x?(lonLat=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));lonLat=this.olMap.getCoordinateFromPixel([x,lonLat]);if(!lonLat)return{x:null,y:null};lonLat=ol.proj.toLonLat(lonLat);return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.latLngToPixels=function(pixel){pixel=ol.proj.fromLonLat([pixel.lng,pixel.lat]),pixel=this.olMap.getPixelFromCoordinate(pixel);return pixel?{x:pixel[0],y:pixel[1]}:{x:null,y:null}},WPGMZA.OLMap.prototype.enableBicycleLayer=function(value){value?(this.bicycleLayer||(this.bicycleLayer=new ol.layer.Tile({source:new ol.source.OSM({url:"http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png"})})),this.olMap.addLayer(this.bicycleLayer)):this.bicycleLayer&&this.olMap.removeLayer(this.bicycleLayer)},WPGMZA.OLMap.prototype.showGestureOverlay=function(){var self=this;clearTimeout(this.gestureOverlayTimeoutID),$(this.gestureOverlay).stop().animate({opacity:"100"}),$(this.element).append(this.gestureOverlay),$(this.gestureOverlay).css({"line-height":$(this.element).height()+"px",opacity:"1.0"}),$(this.gestureOverlay).show(),this.gestureOverlayTimeoutID=setTimeout(function(){self.gestureOverlay.fadeOut(2e3)},2e3)},WPGMZA.OLMap.prototype.onElementResized=function(event){this.olMap.updateSize()},WPGMZA.OLMap.prototype.onRightClick=function(event){if($(event.target).closest(".ol-marker, .wpgmza_modern_infowindow, .wpgmza-modern-store-locator").length)return!0;var latLng=$(this.element).offset(),relX=event.pageX-latLng.left,latLng=event.pageY-latLng.top,latLng=this.pixelsToLatLng(relX,latLng);return this.trigger({type:"rightclick",latLng:latLng}),$(this.element).trigger({type:"rightclick",latLng:latLng}),event.preventDefault(),!1},WPGMZA.OLMap.prototype.enableAllInteractions=function(){this.olMap.getInteractions().forEach(function(interaction){(interaction instanceof ol.interaction.DragPan||interaction instanceof ol.interaction.DoubleClickZoom||interaction instanceof ol.interaction.MouseWheelZoom)&&interaction.setActive(!0)},this)}}),jQuery(function($){WPGMZA.ProMarkerFilter=function(map){WPGMZA.MarkerFilter.call(this,map)},WPGMZA.ProMarkerFilter.prototype=Object.create(WPGMZA.MarkerFilter.prototype),WPGMZA.ProMarkerFilter.prototype.constructor=WPGMZA.ProMarkerFilter,WPGMZA.MarkerFilter.createInstance=function(map){return new WPGMZA.ProMarkerFilter(map)},WPGMZA.ProMarkerFilter.prototype.getFilteringParameters=function(){var bounds,params=WPGMZA.MarkerFilter.prototype.getFilteringParameters.call(this),mashupIDs=this.map.mashupIDs;return mashupIDs&&(params.mashupIDs=mashupIDs),this.map.markerListing&&(params=$.extend(params,this.map.markerListing.getFilteringParameters())),this.map.customFieldFilterController&&(bounds=this.map.customFieldFilterController.getAjaxRequestData().data.widgetData,params.customFields=bounds),this.map.settings.only_load_markers_within_viewport&&(bounds=this.map.getBounds(),params.bounds=bounds),params},WPGMZA.ProMarkerFilter.prototype.update=function(params,source){var self=this;function dispatchEvent(result){var event=new WPGMZA.Event("filteringcomplete");event.map=self.map,event.source=source,event.filteredMarkers=result,event.filteringParams=params,self.onFilteringComplete(event),self.trigger(event),self.map.trigger(event)}this.updateTimeoutID||(params=params||{},this.xhr&&(this.xhr.abort(),delete this.xhr),this.updateTimeoutID=setTimeout(function(){return(params=$.extend(self.getFilteringParameters(),params)).center instanceof WPGMZA.LatLng&&(params.center=params.center.toLatLngLiteral()),params.hideAll?dispatchEvent([]):(self.map.showPreloader(!0),self.xhr=WPGMZA.restAPI.call("/markers",{data:{fields:["id"],filter:JSON.stringify(params)},success:function(result,status,xhr){self.map.showPreloader(!1),dispatchEvent(result)},useCompressedPathVariable:!0})),void delete self.updateTimeoutID},0))},WPGMZA.ProMarkerFilter.prototype.onFilteringComplete=function(event){var map=[];event.filteredMarkers.forEach(function(data){map[data.id]=!0}),this.map.markers.forEach(function(marker){var allowByFilter;marker.isFilterable&&(allowByFilter=!!map[marker.id],marker.isFiltered=!allowByFilter,marker.setVisible(allowByFilter))})}}),jQuery(function($){WPGMZA.ProMarker=function(row){var currentMap,m,self=this;if(this._icon=WPGMZA.MarkerIcon.createInstance(),row&&row.map_id&&(currentMap=WPGMZA.getMapByID(row.map_id)),this.title="",this.description="",this.categories=[],this.approved=1,row&&row.retina?"object"==typeof row.icon&&row.icon.retina?this.retina=row.icon.retina:!0===row.retina?this.retina=row.retina:this.retina=row.retina&&"1"==row.retina?1:0:this.retina=0,currentMap&&currentMap.settings&&currentMap.settings.default_marker)try{var objtmp=JSON.parse(currentMap.settings.default_marker);"object"==typeof objtmp&&objtmp.retina&&1==objtmp.retina&&(this.retina=!0)}catch(e){}row&&row.category&&row.category.length&&((m=row.category.match(/\d+/g))&&(this.categories=m)),WPGMZA.Marker.call(this,row),this.on("mouseover",function(event){self.onMouseOver(event)})},WPGMZA.ProMarker.prototype=Object.create(WPGMZA.Marker.prototype),WPGMZA.ProMarker.prototype.constructor=WPGMZA.ProMarker,WPGMZA.ProMarker.STICKY_ZINDEX=999999,Object.defineProperty(WPGMZA.ProMarker.prototype,"isIntegrated",{get:function(){return/[^\d]/.test(this.id)}}),Object.defineProperty(WPGMZA.ProMarker.prototype,"icon",{get:function(){return this._icon.isDefault?this.map.defaultMarkerIcon:this._icon},set:function(value){if(value instanceof WPGMZA.MarkerIcon)this._icon=value,this.map&&this.updateIcon();else{if("object"!=typeof value&&"string"!=typeof value)throw new Error("Value must be an instance of WPGMZA.MarkerIcon, an icon literal, or a string");"object"==typeof value&&(value.retina=!(!this.retina||!0!==this.retina)||(this.retina&&"1"==this.retina?1:0)),this._icon=WPGMZA.MarkerIcon.createInstance(value),this.map&&this.updateIcon()}}}),WPGMZA.ProMarker.prototype.onAdded=function(event){if(WPGMZA.Marker.prototype.onAdded.call(this,event),this.updateIcon(),(!this.map.storeLocator||this!=this.map.storeLocator.marker)&&this!=this.map.userLocationMarker){if(1==this.map.settings.wpgmza_store_locator_hide_before_search&&1!=WPGMZA.is_admin&&this.isFilterable)return this.userCreated?void 0:(this.isFiltered=!0,void this.setVisible(!1));WPGMZA.getQueryParamValue("markerid")!=this.id&&this.map.shortcodeAttributes.marker!=this.id||(this.openInfoWindow(),this.map.setCenter(this.getPosition())),"approved"in this&&0==this.approved&&this.setOpacity(.6),1==this.sticky&&this.setOptions({zIndex:WPGMZA.ProMarker.STICKY_ZINDEX})}},WPGMZA.ProMarker.prototype.onClick=function(event){WPGMZA.Marker.prototype.onClick.apply(this,arguments),this.map.settings.wpgmza_zoom_on_marker_click&&this.map.settings.wpgmza_zoom_on_marker_click_slider&&(this.map.setZoom(this.map.settings.wpgmza_zoom_on_marker_click_slider),this.map.setCenter(this.getPosition())),1==this.map.settings.click_open_link&&this.link&&this.link.length&&("yes"==WPGMZA.settings.wpgmza_settings_infowindow_links?window.open(this.link):window.open(this.link,"_self"))},WPGMZA.ProMarker.prototype.onMouseOver=function(event){WPGMZA.settings.wpgmza_settings_map_open_marker_by==WPGMZA.ProInfoWindow.OPEN_BY_HOVER&&this.openInfoWindow()},WPGMZA.ProMarker.prototype.getIconFromCategory=function(){if(this.categories.length){var self=this,categoryIDs=this.categories.slice();categoryIDs.sort(function(categoryA,categoryB){categoryA=self.map.getCategoryByID(categoryA),categoryB=self.map.getCategoryByID(categoryB);return categoryA&&categoryB?categoryA.depth<categoryB.depth?-1:1:null});for(var i=0;i<categoryIDs.length;i++){var icon=this.map.getCategoryByID(categoryIDs[i]);if(icon){icon=icon.icon;if(icon&&icon.length)return icon}}}},WPGMZA.ProMarker.prototype.setIcon=function(icon){this.icon=icon},WPGMZA.ProMarker.prototype.openInfoWindow=function(autoOpen){return(!this.map.settings.wpgmza_listmarkers_by||6!=parseInt(this.map.settings.wpgmza_listmarkers_by))&&(WPGMZA.Marker.prototype.openInfoWindow.apply(this,arguments),!this.disableInfoWindow&&void((this.map&&this.map.userLocationMarker==this||void 0!==this.user_location&&this.user_location)&&this.infoWindow.setContent(WPGMZA.localized_strings.my_location)))}}),jQuery(function($){var Parent;WPGMZA.GoogleMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toGoogleLatLng():options[name]instanceof WPGMZA.Map||"icon"==name||(settings[name]=options[name]);this.googleMarker=new google.maps.Marker(settings),(this.googleMarker.wpgmzaMarker=this).googleFeature=this.googleMarker,this.googleMarker.setPosition(new google.maps.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})),this.anim&&this.googleMarker.setAnimation(this.anim),this.animation&&this.googleMarker.setAnimation(this.animation),google.maps.event.addListener(this.googleMarker,"click",function(){self.dispatchEvent("click"),self.dispatchEvent("select")}),google.maps.event.addListener(this.googleMarker,"mouseover",function(){self.dispatchEvent("mouseover")}),google.maps.event.addListener(this.googleMarker,"dragend",function(){var googleMarkerPosition=self.googleMarker.getPosition();self.setPosition({lat:googleMarkerPosition.lat(),lng:googleMarkerPosition.lng()}),self.dispatchEvent({type:"dragend",latLng:self.getPosition()}),self.trigger("change")}),this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.GoogleMarker.prototype=Object.create(Parent.prototype),WPGMZA.GoogleMarker.prototype.constructor=WPGMZA.GoogleMarker,Object.defineProperty(WPGMZA.GoogleMarker.prototype,"opacity",{get:function(){return this._opacity},set:function(value){this._opacity=value,this.googleMarker.setOpacity(value)}}),WPGMZA.GoogleMarker.prototype.setLabel=function(label){label?(this.googleMarker.setLabel({text:label}),this.googleMarker.getIcon()||this.googleMarker.setIcon(WPGMZA.settings.default_marker_icon)):this.googleMarker.setLabel(null)},WPGMZA.GoogleMarker.prototype.setPosition=function(latLng){Parent.prototype.setPosition.call(this,latLng),this.googleMarker.setPosition({lat:this.lat,lng:this.lng})},WPGMZA.GoogleMarker.prototype.updateOffset=function(){var self=this,icon=this.googleMarker.getIcon(),img=new Image,x=this._offset.x,y=this._offset.y,params="string"==typeof(icon=icon||WPGMZA.settings.default_marker_icon)?{url:icon}:icon;img.onload=function(){var defaultAnchor_x=img.width/2,defaultAnchor_y=img.height;params.anchor=new google.maps.Point(defaultAnchor_x-x,defaultAnchor_y-y),self.googleMarker.setIcon(params)},img.src=params.url},WPGMZA.GoogleMarker.prototype.setOptions=function(options){this.googleMarker.setOptions(options)},WPGMZA.GoogleMarker.prototype.setAnimation=function(animation){Parent.prototype.setAnimation.call(this,animation),this.googleMarker.setAnimation(animation)},WPGMZA.GoogleMarker.prototype.setVisible=function(visible){Parent.prototype.setVisible.call(this,visible),this.googleMarker.setVisible(!!visible)},WPGMZA.GoogleMarker.prototype.getVisible=function(visible){return this.googleMarker.getVisible()},WPGMZA.GoogleMarker.prototype.setDraggable=function(draggable){this.googleMarker.setDraggable(draggable)},WPGMZA.GoogleMarker.prototype.setOpacity=function(opacity){this.googleMarker.setOpacity(opacity)}}),jQuery(function($){var Parent;WPGMZA.OLMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toLatLngLiteral():options[name]instanceof WPGMZA.Map||(settings[name]=options[name]);var origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);if(WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT){var img=$("<img alt=''/>")[0];img.onload=function(event){self.updateElementHeight(),self.map&&self.map.olMap.updateSize()},img.src=WPGMZA.defaultMarkerIcon,this.element=$("<div class='ol-marker'></div>")[0],this.element.appendChild(img),this.element.wpgmzaMarker=this,$(this.element).on("mouseover",function(event){self.dispatchEvent("mouseover")}),this.overlay=new ol.Overlay({element:this.element,position:origin,positioning:"bottom-center",stopEvent:!1}),this.overlay.setPosition(origin),this.animation?this.setAnimation(this.animation):this.anim&&this.setAnimation(this.anim),options&&options.draggable&&this.setDraggable(!0),this.rebindClickListener()}else{if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)throw new Error("Invalid marker render mode");this.feature=new ol.Feature({geometry:new ol.geom.Point(origin)}),this.feature.setStyle(this.getVectorLayerStyle()),(this.feature.wpgmzaMarker=this).feature.wpgmzaFeature=this}this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.OLMarker.prototype=Object.create(Parent.prototype),WPGMZA.OLMarker.prototype.constructor=WPGMZA.OLMarker,WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT="element",WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER="vector",WPGMZA.OLMarker.renderMode=WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT,"open-layers"==WPGMZA.settings.engine&&WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(WPGMZA.OLMarker.defaultVectorLayerStyle=new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:WPGMZA.defaultMarkerIcon})}),WPGMZA.OLMarker.hiddenVectorLayerStyle=new ol.style.Style({})),WPGMZA.OLMarker.prototype.getVectorLayerStyle=function(){return this.vectorLayerStyle||WPGMZA.OLMarker.defaultVectorLayerStyle},WPGMZA.OLMarker.prototype.updateElementHeight=function(height,calledOnFocus){var self=this;0!=(height=height||$(this.element).find("img").height())||calledOnFocus||$(window).one("focus",function(event){self.updateElementHeight(!1,!0)}),$(this.element).css({height:height+"px"})},WPGMZA.OLMarker.prototype.addLabel=function(){this.setLabel(this.getLabelText())},WPGMZA.OLMarker.prototype.setLabel=function(label){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?label?(this.label||(this.label=$("<div class='ol-marker-label'/>"),$(this.element).append(this.label)),this.label.html(label)):this.label&&$(this.element).find(".ol-marker-label").remove():console.warn("Marker labels are not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.getVisible=function(visible){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)return"none"!=this.overlay.getElement().style.display},WPGMZA.OLMarker.prototype.setVisible=function(visible){var style;Parent.prototype.setVisible.call(this,visible),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?visible?(style=this.getVectorLayerStyle(),this.feature.setStyle(style)):this.feature.setStyle(null):this.overlay.getElement().style.display=visible?"block":"none"},WPGMZA.OLMarker.prototype.setPosition=function(origin){Parent.prototype.setPosition.call(this,origin);origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?this.feature.setGeometry(new ol.geom.Point(origin)):this.overlay.setPosition(origin)},WPGMZA.OLMarker.prototype.updateOffset=function(x,y){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?(x=this._offset.x,y=this._offset.y,this.element.style.position="relative",this.element.style.left=x+"px",this.element.style.top=y+"px"):console.warn("Marker offset is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setAnimation=function(anim){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)switch(Parent.prototype.setAnimation.call(this,anim),anim){case WPGMZA.Marker.ANIMATION_NONE:$(this.element).removeAttr("data-anim");break;case WPGMZA.Marker.ANIMATION_BOUNCE:$(this.element).attr("data-anim","bounce");break;case WPGMZA.Marker.ANIMATION_DROP:$(this.element).attr("data-anim","drop")}else console.warn("Marker animation is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setDraggable=function(options){var self=this;WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?options?(options={disabled:!1},this.jQueryDraggableInitialized||(options.start=function(event){self.onDragStart(event)},options.stop=function(event){self.onDragEnd(event)}),$(this.element).draggable(options),this.jQueryDraggableInitialized=!0,this.rebindClickListener()):$(this.element).draggable({disabled:!0}):console.warn("Marker dragging is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setOpacity=function(opacity){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?$(this.element).css({opacity:opacity}):console.warn("Marker opacity is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.onDragStart=function(event){this.isBeingDragged=!0,this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!1)})},WPGMZA.OLMarker.prototype.onDragEnd=function(event){var latLngAfterDrag=parseFloat($(this.element).css("top").match(/-?\d+/)[0]),offset_left=parseFloat($(this.element).css("left").match(/-?\d+/)[0]);$(this.element).css({top:"0px",left:"0px"});var pixelsBeforeDrag=this.getPosition(),pixelsBeforeDrag=this.map.latLngToPixels(pixelsBeforeDrag),latLngAfterDrag={x:pixelsBeforeDrag.x+offset_left,y:pixelsBeforeDrag.y+latLngAfterDrag},latLngAfterDrag=this.map.pixelsToLatLng(latLngAfterDrag);this.setPosition(latLngAfterDrag),this.isBeingDragged=!1,this.trigger({type:"dragend",latLng:latLngAfterDrag}),this.trigger("change"),"yes"!=this.map.settings.wpgmza_settings_map_draggable&&this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!0)})},WPGMZA.OLMarker.prototype.onElementClick=function(self){self=self.currentTarget.wpgmzaMarker;self.isBeingDragged||(self.dispatchEvent("click"),self.dispatchEvent("select"))},WPGMZA.OLMarker.prototype.rebindClickListener=function(){$(this.element).off("click",this.onElementClick),$(this.element).on("click",this.onElementClick)}}),jQuery(function($){var Parent;function compareMax(a,b){return b.max-a.max}function Cell(x,y,h,polygon){this.x=x,this.y=y,this.h=h,this.d=function(x,y,polygon){for(var inside=!1,minDistSq=1/0,k=0;k<polygon.length;k++)for(var ring=polygon[k],i=0,len=ring.length,j=len-1;i<len;j=i++){var a=ring[i],b=ring[j];a[1]>y!=b[1]>y&&x<(b[0]-a[0])*(y-a[1])/(b[1]-a[1])+a[0]&&(inside=!inside),minDistSq=Math.min(minDistSq,function(px,py,t,b){var x=t[0],y=t[1],dx=b[0]-x,dy=b[1]-y;0===dx&&0===dy||(1<(t=((px-x)*dx+(py-y)*dy)/(dx*dx+dy*dy))?(x=b[0],y=b[1]):0<t&&(x+=dx*t,y+=dy*t));return(dx=px-x)*dx+(dy=py-y)*dy}(x,y,a,b))}return(inside?1:-1)*Math.sqrt(minDistSq)}(x,y,polygon),this.max=this.d+this.h*Math.SQRT2}WPGMZA.ProPolygon=function(row,enginePolygon){var self=this;Parent.call(this,row,enginePolygon),this.on("mouseover",function(event){self.onMouseOver(event)}),this.on("mouseout",function(event){self.onMouseOut(event)}),this.on("click",function(event){self.onClick(event)}),this.initPolygonLabels()},Parent=WPGMZA.Polygon,WPGMZA.ProPolygon.prototype=Object.create(Parent.prototype),WPGMZA.ProPolygon.prototype.constructor=WPGMZA.ProPolygon,Object.defineProperty(WPGMZA.ProPolygon.prototype,"hoverFillColor",{enumerable:!0,get:function(){return this.ohfillcolor&&this.ohfillcolor.length?"#"+this.ohfillcolor.replace(/^#/,""):"#ff0000"},set:function(a){this.ohfillcolor=a}}),Object.defineProperty(WPGMZA.ProPolygon.prototype,"hoverStrokeColor",{enumerable:!0,get:function(){return this.ohlinecolor&&this.ohlinecolor.length?"#"+this.ohlinecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.ohlinecolor=a}}),Object.defineProperty(WPGMZA.ProPolygon.prototype,"hoverOpacity",{enumerable:!0,get:function(){return this.ohopacity||.6},set:function(a){this.ohopacity=a}}),WPGMZA.ProPolygon.getLabelPosition=function(bboxCell,precision,debug){var minX,minY,maxX,maxY,polygon=bboxCell;precision=precision||1;for(var i=0;i<polygon[0].length;i++){var p=polygon[0][i];(!i||p[0]<minX)&&(minX=p[0]),(!i||p[1]<minY)&&(minY=p[1]),(!i||p[0]>maxX)&&(maxX=p[0]),(!i||p[1]>maxY)&&(maxY=p[1])}var width=maxX-minX,bboxCell=maxY-minY,cellSize=Math.min(width,bboxCell),h=cellSize/2;if(0===cellSize)return[minX,minY];for(var cellQueue=new WPGMZA.Queue(null,compareMax),x=minX;x<maxX;x+=cellSize)for(var y=minY;y<maxY;y+=cellSize)cellQueue.push(new Cell(x+h,y+h,h,polygon));var bestCell=function(polygon){for(var area=0,x=0,y=0,points=polygon[0],i=0,len=points.length,j=len-1;i<len;j=i++){var a=points[i],b=points[j],f=a[0]*b[1]-b[0]*a[1];x+=(a[0]+b[0])*f,y+=(a[1]+b[1])*f,area+=3*f}return 0===area?new Cell(points[0][0],points[0][1],0,polygon):new Cell(x/area,y/area,0,polygon)}(polygon),bboxCell=new Cell(minX+width/2,minY+bboxCell/2,0,polygon);bboxCell.d>bestCell.d&&(bestCell=bboxCell);for(var numProbes=cellQueue.length;cellQueue.length;){var cell=cellQueue.pop();cell.d>bestCell.d&&(bestCell=cell,debug&&console.log("found best %d after %d probes",Math.round(1e4*cell.d)/1e4,numProbes)),cell.max-bestCell.d<=precision||(h=cell.h/2,cellQueue.push(new Cell(cell.x-h,cell.y-h,h,polygon)),cellQueue.push(new Cell(cell.x+h,cell.y-h,h,polygon)),cellQueue.push(new Cell(cell.x-h,cell.y+h,h,polygon)),cellQueue.push(new Cell(cell.x+h,cell.y+h,h,polygon)),numProbes+=4)}return debug&&(console.log("num probes: "+numProbes),console.log("best distance: "+bestCell.d)),[bestCell.x,bestCell.y]},WPGMZA.ProPolygon.prototype.onMouseOver=function(event){this.revertOptions=this.getScalarProperties();var options={fillColor:this.hoverFillColor,strokeColor:this.hoverStrokeColor,fillOpacity:this.hoverOpacity};this.setOptions(options)},WPGMZA.ProPolygon.prototype.onMouseOut=function(event){var options={fillColor:this.fillColor,strokeColor:this.strokeColor,fillOpacity:this.fillOpacity};this.revertOptions&&(options=this.revertOptions,this.revertOptions=!1),this.setOptions(options)},WPGMZA.ProPolygon.prototype.onClick=function(event){this.map.settings.disable_polygon_info_windows||this.openInfoWindow()},WPGMZA.ProPolygon.prototype.getPosition=function(){return this.getCentroid()},WPGMZA.ProPolygon.prototype.openInfoWindow=function(){this.map?(this.map.lastInteractedMarker&&this.map.lastInteractedMarker.infoWindow.close(),(this.map.lastInteractedMarker=this).initInfoWindow(),this.pic="",this.infoWindow.open(this.map,this),this.centroid=this.getCentroid(),this.infoWindow.setPosition(this.centroid),this.infoWindow.element.classList.add("ol-info-window-polygon"),1==this.map.settings.click_open_link&&this.link&&this.link.length&&("yes"==WPGMZA.settings.wpgmza_settings_infowindow_links?window.open(this.link):window.open(this.link,"_self"))):console.warn("Cannot open infowindow for polygon with no map")},WPGMZA.ProPolygon.prototype.initInfoWindow=function(){this.infoWindow||(this.infoWindow=WPGMZA.InfoWindow.createInstance())},WPGMZA.ProPolygon.prototype.getCentroid=function(){var i,geojson=[[]];for(i in this.polydata)geojson[0].push([parseFloat(this.polydata[i].lat),parseFloat(this.polydata[i].lng)]);var latLng=WPGMZA.ProPolygon.getLabelPosition(geojson);return new WPGMZA.LatLng({lat:latLng[0],lng:latLng[1]})},WPGMZA.ProPolygon.prototype.getCenterApprox=function(){var i,pos={lat:0,lng:0},n=this.polydata.length;for(i in this.polydata)pos.lat+=parseFloat(this.polydata[i].lat),pos.lng+=parseFloat(this.polydata[i].lng);return new WPGMZA.LatLng(pos.lat/n,pos.lng/n)},WPGMZA.ProPolygon.prototype.initPolygonLabels=function(){var settings;!WPGMZA.getMapByID(this.map_id)||(settings=WPGMZA.getMapByID(this.map_id).settings)&&settings.polygon_labels&&this.title&&WPGMZA.Text.createInstance({text:this.title,map:WPGMZA.getMapByID(this.map_id),position:this.getCentroid()})}}),jQuery(function($){var Parent;WPGMZA.GooglePolygon=function(options,googlePolygon){var self=this;options=options||{},Parent.call(this,options,googlePolygon),this.googlePolygon=googlePolygon||new google.maps.Polygon,this.googleFeature=this.googlePolygon,options&&options.polydata&&this.googlePolygon.setOptions({paths:this.parseGeometry(options.polydata)}),this.googlePolygon.wpgmzaPolygon=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolygon,"click",function(){self.dispatchEvent({type:"click"})})},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.GooglePolygon.prototype=Object.create(Parent.prototype),WPGMZA.GooglePolygon.prototype.constructor=WPGMZA.GooglePolygon,WPGMZA.GooglePolygon.prototype.updateNativeFeature=function(){this.googlePolygon.setOptions(this.getScalarProperties())},WPGMZA.GooglePolygon.prototype.getEditable=function(){return this.googlePolygon.getOptions().editable},WPGMZA.GooglePolygon.prototype.setEditable=function(value){var self=this;this.googlePolygon.setOptions({editable:value}),value&&(this.googlePolygon.getPaths().forEach(function(path,index){["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})})}),google.maps.event.addListener(this.googlePolygon,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolygon,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))}))},WPGMZA.GooglePolygon.prototype.setDraggable=function(value){this.googlePolygon.setDraggable(value)},WPGMZA.GooglePolygon.prototype.getGeometry=function(){for(var result=[],path=this.googlePolygon.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){var Parent;WPGMZA.OLPolygon=function(options,olFeature){if(Parent.call(this,options,olFeature),olFeature)this.olFeature=olFeature;else{var coordinates=[[]];if(options&&options.polydata)for(var paths=this.parseGeometry(options.polydata),i=0;i<=paths.length;i++)coordinates[0].push(ol.proj.fromLonLat([parseFloat(paths[i%paths.length].lng),parseFloat(paths[i%paths.length].lat)]));this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolygon:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.OLPolygon.prototype=Object.create(Parent.prototype),WPGMZA.OLPolygon.prototype.constructor=WPGMZA.OLPolygon,WPGMZA.OLPolygon.prototype.getGeometry=function(){for(var coordinates=this.olFeature.getGeometry().getCoordinates()[0],result=[],i=0;i<coordinates.length;i++){var latLng=ol.proj.toLonLat(coordinates[i]),latLng={lat:latLng[1],lng:latLng[0]};result.push(latLng)}return result},WPGMZA.OLPolygon.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.ProStoreLocator=function(map,element){WPGMZA.StoreLocator.call(this,map,element);var buttons=$(element).find("input[type='button'], button:not(.wpgmza-use-my-location)");buttons.prop("disabled",!0),map.on("markersplaced",function(event){buttons.prop("disabled",!1)}),map.settings.wpgmza_store_locator_use_their_location||$(this.element).find(".wpgmza-use-my-location").remove(),map.settings.store_locator_search_area==WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO&&$(this.element).find(".wpgmza_sl_radius_select").remove(),this.map.on("init",function(event){})},WPGMZA.ProStoreLocator.prototype=Object.create(WPGMZA.StoreLocator.prototype),WPGMZA.ProStoreLocator.prototype.constructor=WPGMZA.ProStoreLocator,WPGMZA.ProStoreLocator.SEARCH_AREA_RADIAL="radial",WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO="auto",WPGMZA.StoreLocator.createInstance=function(map,element){return new WPGMZA.ProStoreLocator(map,element)},Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"keywords",{get:function(){var legacy=$(".wpgmza_name_search_string + input").val();return legacy||$(this.map.element).find(".wpgmza-text-search").val()}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"categories",{configurable:!0,get:function(){var value,results;if(0<$(this.map.element).find(".wpgmza-modern-store-locator").length)$(this.map.element).find(".wpgmza-modern-store-locator [name='wpgmza_cat_checkbox']:checked").each(function(index,el){(results=results||[]).push($(el).val())});else{if((value=$(this.element).find(".wpgmza_sl_category_div > select")).length)return"0"==(value=value.val())?null:[value];$(this.element).find(".wpgmza_sl_category_div :checked").each(function(index,el){(results=results||[]).push($(el).val())})}return results}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"hideMarkersInInitialState",{get:function(){return 1==this.map.settings.wpgmza_store_locator_hide_before_search}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleStrokeColor",{get:function(){return this.map.settings.sl_stroke_color?"#"+this.map.settings.sl_stroke_color.replace(/^#/,""):"#ff0000"}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleFillColor",{get:function(){return this.map.settings.sl_fill_color?"#"+this.map.settings.sl_fill_color.replace(/^#/,""):"#ff0000"}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleStrokeOpacity",{get:function(){return void 0!==this.map.settings.sl_stroke_opacity&&""!==this.map.settings.sl_stroke_opacity?parseFloat(this.map.settings.sl_stroke_opacity):.25}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleFillOpacity",{get:function(){return void 0!==this.map.settings.sl_fill_opacity&&""!==this.map.settings.sl_fill_opacity?parseFloat(this.map.settings.sl_fill_opacity):.15}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circle",{get:function(){return this.map.settings.store_locator_search_area==WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO?null:this._circle||(WPGMZA.isDeviceiOS()||"modern"!=this.map.settings.wpgmza_store_locator_radius_style?this._circle=WPGMZA.Circle.createInstance({strokeColor:this.circleStrokeColor,strokeOpacity:this.circleStrokeOpacity,strokeWeight:2,fillColor:this.circleFillColor,fillOpacity:this.circleFillOpacity,visible:!1,clickable:!1,center:new WPGMZA.LatLng}):(this._circle=WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id),this._circle.settings.color=this.circleStrokeColor),this._circle)}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"marker",{get:function(){if(1!=this.map.settings.wpgmza_store_locator_bounce)return null;if(this._marker)return this._marker;var options={visible:!1};return this.map.settings.upload_default_sl_marker&&this.map.settings.upload_default_sl_marker.length&&(options.icon=this.map.settings.upload_default_sl_marker,this.map.settings.upload_default_sl_marker_retina&&(options.retina=!0)),this._marker=WPGMZA.Marker.createInstance(options),this._marker.disableInfoWindow=!0,this._marker.isFilterable=!1,this._marker._icon.retina=this._marker.retina,1==this.map.settings.wpgmza_sl_animation?this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE):2==this.map.settings.wpgmza_sl_animation&&this._marker.setAnimation(WPGMZA.Marker.ANIMATION_DROP),this._marker}}),WPGMZA.ProStoreLocator.prototype.getZoomFromRadius=function(radius){return this.distanceUnits==WPGMZA.Distance.MILES&&(radius*=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(14-Math.log(radius)/Math.LN2)},WPGMZA.ProStoreLocator.prototype.getFilteringParameters=function(){if(this.state==WPGMZA.StoreLocator.STATE_INITIAL)return this.hideMarkersInInitialState?{hideAll:!0}:{};var params=WPGMZA.StoreLocator.prototype.getFilteringParameters.call(this),proParams={};return this.map.settings.store_locator_search_area==WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO&&(delete params.center,delete params.radius),this.keywords&&(proParams.keywords=this.keywords),this.categories&&(proParams.categories=this.categories),$.extend(params,proParams)},WPGMZA.ProStoreLocator.prototype.onFilteringComplete=function(event){var params=event.filteringParams,circle=this.circle,factor=(this.marker,this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.Distance.KILOMETERS_PER_MILE:1);if(event.source instanceof WPGMZA.StoreLocator){switch(WPGMZA.StoreLocator.prototype.onFilteringComplete.apply(this,arguments),this.map.settings.store_locator_search_area){case WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO:if(!this.bounds||this.bounds.isInInitialState()){this.map.setZoom(this.map.settings.map_start_zoom);break}this.map.fitBounds(this.bounds);var maxZoom=this.map.settings.store_locator_auto_area_max_zoom;maxZoom&&this.map.getZoom()>=maxZoom&&this.map.setZoom(maxZoom);break;default:if(circle&&circle.setVisible(!1),params.center&&params.radius){this.map.setCenter(params.center),this.map.setZoom(this.getZoomFromRadius(params.radius)),circle&&(circle instanceof WPGMZA.ModernStoreLocatorCircle&&(circle.settings.radiusString=Math.round(params.radius)),circle.setRadius(params.radius*factor),circle.setCenter(params.center),circle.setVisible(!0),circle.map!=this.map&&this.map.addCircle(circle));break}}var storeLocatorResultEvent={type:"storelocatorresult"};event.center&&(storeLocatorResultEvent.center=event.center),this.map.trigger(storeLocatorResultEvent)}},WPGMZA.ProStoreLocator.prototype.onGeocodeComplete=function(event){var location;event.results&&event.results.length&&((location=new WPGMZA.LatLng({lat:event.results[0].lat,lng:event.results[0].lng})).source=WPGMZA.ProMap.SHOW_DISTANCE_FROM_SEARCHED_ADDRESS,this.map.showDistanceFromLocation=location),WPGMZA.StoreLocator.prototype.onGeocodeComplete.apply(this,arguments)},WPGMZA.ProStoreLocator.prototype.onReset=function(event){this.map.showDistanceFromLocation=this.map.userLocation,this.map.updateInfoWindowDistances(),WPGMZA.StoreLocator.prototype.onReset.apply(this,arguments)}}),jQuery(function($){function defaultCompare(a,b){return a<b?-1:b<a?1:0}WPGMZA.Queue=function(data,compare){if(data=data||[],compare=compare||defaultCompare,this.data=data,this.length=this.data.length,this.compare=compare,0<this.lenght)for(var i=(this.length>>1)-1;0<=i;i--)this._down(i)},WPGMZA.Queue.prototype.push=function(item){this.data.push(item),this.length++,this._up(this.length-1)},WPGMZA.Queue.prototype.pop=function(){if(0!==this.length){var top=this.data[0],bottom=this.data.pop();return this.length--,0<this.length&&(this.data[0]=bottom,this._down(0)),top}},WPGMZA.Queue.prototype.peek=function(){return this.data[0]},WPGMZA.Queue.prototype._up=function(pos){for(var data=this.data,compare=this.compare,item=data[pos];0<pos;){var parent=pos-1>>1,current=data[parent];if(0<=compare(item,current))break;data[pos]=current,pos=parent}data[pos]=item},WPGMZA.Queue.prototype._down=function(pos){for(var data=this.data,compare=this.compare,halfLength=this.length>>1,item=data[pos];pos<halfLength;){var left=1+(pos<<1),best=data[left],right=left+1;if(right<this.length&&compare(data[right],best)<0&&(best=data[left=right]),0<=compare(best,item))break;data[pos]=best,pos=left}data[pos]=item}}),jQuery(function($){WPGMZA.UseMyLocationButton=function(target,options){var self=this;this.options={},options&&(this.options=options),this.target=$(target),this.element=$("<button class='wpgmza-use-my-location button-secondary' type='button' title='"+WPGMZA.localized_strings.use_my_location+"'><i class='fa fa-crosshairs' aria-hidden='true'></i></button>"),this.element.on("click",function(event){self.onClick(event)})},WPGMZA.UseMyLocationButton.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.UseMyLocationButton.prototype.constructor=WPGMZA.UseMyLocationButton,WPGMZA.UseMyLocationButton.prototype.onClick=function(event){var self=this;WPGMZA.getCurrentPosition(function(lng){var lat=lng.coords.latitude,lng=lng.coords.longitude;self.target.val(lat+", "+lng),self.target.trigger("change"),WPGMZA.Geocoder.createInstance().geocode({latLng:{lat:lat,lng:lng}},function(results){results&&results.length&&self.target.val(results[0])})})}}),jQuery(function($){WPGMZA.ModernStoreLocator=function(map_id){var original,inner,placeholder,button,container,items,numCategories,icons,self=this,map=WPGMZA.getMapByID(map_id);WPGMZA.assertInstanceOf(this,"ModernStoreLocator"),(original=(WPGMZA.isProVersion()?$(".wpgmza_sl_search_button[mid='"+map_id+"'], .wpgmza_sl_search_button_"+map_id):$(".wpgmza_sl_search_button")).closest(".wpgmza_sl_main_div")).length&&(this.element=$("<div class='wpgmza-modern-store-locator'><div class='wpgmza-inner wpgmza-modern-hover-opaque'/></div>")[0],inner=$(this.element).find(".wpgmza-inner"),items=WPGMZA.isProVersion()?$(original).find(".addressInput"):$(original).find("#addressInput"),map.settings.store_locator_query_string&&map.settings.store_locator_query_string.length&&items.attr("placeholder",map.settings.store_locator_query_string),inner.append(items),(button=$(original).find("[id='nameInput_"+map_id+"']")).length&&((placeholder=map.settings.store_locator_name_string)&&placeholder.length&&button.attr("placeholder",placeholder),inner.append(button)),(button=$(original).find("button.wpgmza-use-my-location"))&&inner.append(button),$(items).on("keydown keypress",function(event){13==event.keyCode&&self.searchButton.is(":visible")&&self.searchButton.trigger("click")}),$(items).on("input",function(event){self.searchButton.show(),self.resetButton.hide()}),inner.append($(original).find("select.wpgmza_sl_radius_select")),this.searchButton=$(original).find(".wpgmza_sl_search_button, .wpgmza_sl_search_button_div"),inner.append(this.searchButton),this.resetButton=$(original).find(".wpgmza_sl_reset_button_div"),inner.append(this.resetButton),this.resetButton.on("click",function(event){resetLocations(map_id)}),this.resetButton.hide(),WPGMZA.isProVersion()&&(this.searchButton.on("click",function(event){0!=$("addressInput_"+map_id).val()&&(self.searchButton.hide(),self.resetButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_APPLIED)}),this.resetButton.on("click",function(event){self.resetButton.hide(),self.searchButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_INITIAL})),inner.append($("#wpgmza_distance_type_"+map_id)),container=$(original).find(".wpgmza_cat_checkbox_holder"),$(container).children("ul"),items=$(container).find("li"),numCategories=0,icons=[],items.each(function(index,el){var category_id,id=$(el).attr("class").match(/\d+/);for(category_id in wpgmza_category_data)if(id==category_id){var src=wpgmza_category_data[category_id].image,icon=$('<div class="wpgmza-chip-icon"/>');icon.css({"background-image":"url('"+src+"')",width:$("#wpgmza_cat_checkbox_"+category_id+" + label").height()+"px"}),icons.push(icon),null!=src&&""!=src&&$("#wpgmza_cat_checkbox_"+category_id+" + label").prepend(icon),numCategories++;break}}),$(this.element).append(container),numCategories&&(this.optionsButton=$('<span class="wpgmza_store_locator_options_button"><i class="fa fa-list"></i></span>'),$(this.searchButton).before(this.optionsButton)),setInterval(function(){icons.forEach(function(icon){var height=$(icon).height();$(icon).css({width:height+"px"}),$(icon).closest("label").css({"padding-left":height+8+"px"})}),$(container).css("width",$(self.element).find(".wpgmza-inner").outerWidth()+"px")},1e3),$(this.element).find(".wpgmza_store_locator_options_button").on("click",function(event){container.hasClass("wpgmza-open")?container.removeClass("wpgmza-open"):container.addClass("wpgmza-open")}),$(original).remove(),$(this.element).find("input, select").on("focus",function(){$(inner).addClass("active")}),$(this.element).find("input, select").on("blur",function(){$(inner).removeClass("active")}),$(this.element).on("mouseover","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseOverCategory(event)}),$(this.element).on("mouseleave","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseLeaveCategory(event)}),$("body").on("click",".wpgmza_store_locator_options_button",function(event){setTimeout(function(){var position_cat,$p_map;$(".wpgmza_cat_checkbox_holder").hasClass("wpgmza-open")&&(position_cat=($p_map=$(".wpgmza_cat_checkbox_holder")).position().top+$p_map.outerHeight(!0)+$(".wpgmza-modern-store-locator").height(),($p_map=$(".wpgmza_map")).position().top+$p_map.outerHeight(!0)<=position_cat&&($(".wpgmza_cat_ul").css("overflow","scroll "),$(".wpgmza_cat_ul").css("height","100%"),$(".wpgmza-modern-store-locator").css("height","100%"),$(".wpgmza_cat_checkbox_holder.wpgmza-open").css({"padding-bottom":"50px",height:"100%"})))},500)}))},WPGMZA.ModernStoreLocator.createInstance=function(map_id){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleModernStoreLocator:WPGMZA.OLModernStoreLocator)(map_id)},WPGMZA.ModernStoreLocator.prototype.onMouseOverCategory=function(li){li=li.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeIn()},WPGMZA.ModernStoreLocator.prototype.onMouseLeaveCategory=function(li){li=li.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeOut()}}),jQuery(function($){WPGMZA.GoogleModernStoreLocator=function(map_id){var restrict=this.map=WPGMZA.getMapByID(map_id);WPGMZA.ModernStoreLocator.call(this,map_id);restrict=restrict.settings.wpgmza_store_locator_restrict;this.addressInput=$(this.element).find(".addressInput, #addressInput")[0],this.addressInput&&restrict&&restrict.length,this.map.googleMap.controls[google.maps.ControlPosition.TOP_CENTER].push(this.element)},WPGMZA.GoogleModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator.prototype),WPGMZA.GoogleModernStoreLocator.prototype.constructor=WPGMZA.GoogleModernStoreLocator}),jQuery(function($){WPGMZA.OLModernStoreLocator=function(map_id){WPGMZA.ModernStoreLocator.call(this,map_id),(WPGMZA.isProVersion()?$(".wpgmza_map[data-map-id='"+map_id+"']"):$("#wpgmza_map")).append(this.element)},WPGMZA.OLModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator),WPGMZA.OLModernStoreLocator.prototype.constructor=WPGMZA.OLModernStoreLocator}),jQuery(function($){var __,InspectorControls,_wp$components,PanelBody,SelectControl,RangeControl;window.wp&&wp.i18n&&wp.blocks&&wp.editor&&wp.components&&(__=wp.i18n.__,wp.blocks.registerBlockType,_wp$components=wp.editor,InspectorControls=_wp$components.InspectorControls,_wp$components.BlockControls,(_wp$components=wp.components).Dashicon,_wp$components.Toolbar,_wp$components.Button,_wp$components.Tooltip,PanelBody=_wp$components.PanelBody,_wp$components.TextareaControl,_wp$components.TextControl,_wp$components.RichText,SelectControl=_wp$components.SelectControl,RangeControl=_wp$components.RangeControl,WPGMZA.Integration.ProGutenberg=function(){WPGMZA.Integration.Gutenberg.call(this)},WPGMZA.Integration.ProGutenberg.prototype=Object.create(WPGMZA.Integration.Gutenberg.prototype),WPGMZA.Integration.ProGutenberg.prototype.constructor=WPGMZA.Integration.ProGutenberg,WPGMZA.Integration.Gutenberg.getConstructor=function(){return WPGMZA.Integration.ProGutenberg},WPGMZA.Integration.ProGutenberg.prototype.getMapSelectOptions=function(){var result=[];return WPGMZA.gutenbergData.maps.forEach(function(el){result.push({key:el.id,value:el.id,label:el.map_title+" ("+el.id+")"})}),result},WPGMZA.Integration.ProGutenberg.prototype.updateMarkerSelectOptions=function(props){var select=$("select[name='marker']"),mashup_ids=$("select[name='mashup_ids']").val(),none=$("<option value='none'></option>"),request={fields:["id","address","title"],filter:{map_id:$("select[name='map_id']").val()}};none.text(__("None")),mashup_ids&&(request.filter.mashup_ids=mashup_ids),select.prop("disabled",!0),WPGMZA.restAPI.call("/markers/",{success:function(response){select.html(""),select.append(none),response.forEach(function(data){var option=$("<option/>");option.val(data.id),option.prop("value",data.id),option.text((data.title.length?data.title:data.address)+" ("+data.id+")"),select.append(option)}),select.prop("disabled",!1),props.attributes.marker&&select.val(props.attributes.marker)},data:request})},WPGMZA.Integration.ProGutenberg.prototype.updateCategorySelectOptions=function(props){var select=$("select[name='cat']"),none=$("<option value='none'></option>"),request={filter:{map_id:$("select[name='map_id']").val()}};none.text(__("None")),select.prop("disabled",!0),WPGMZA.restAPI.call("/categories/",{success:function(response){select.html(""),select.append(none),function addNodeChildren(node,depth){depth=depth||0,node.children&&node.children.forEach(function(child){for(var prefix="",option=$("<option/>"),i=0;i<depth;i++)prefix+="&nbsp;&nbsp;&nbsp;&nbsp;";option.val(child.id),option.prop(child.id),option.html(prefix+child.name+" ("+child.id+")"),select.append(option),addNodeChildren(child,depth+1)})}(response),select.prop("disabled",!1),props.attributes.cat&&select.val(props.attributes.cat)},data:request})},WPGMZA.Integration.ProGutenberg.prototype.getBlockInspectorControls=function(props){var self=this,selectedMapID="1";return props.attributes.id?selectedMapID=props.attributes.id:WPGMZA.gutenbergData.maps.length&&(selectedMapID=WPGMZA.gutenbergData.maps[0].id),setTimeout(function(){self.updateMarkerSelectOptions(props),self.updateCategorySelectOptions(props)},100),React.createElement(InspectorControls,{key:"inspector"},React.createElement(PanelBody,{title:__("Map Settings")},React.createElement(SelectControl,{name:"map_id",label:__("Map"),value:selectedMapID,options:this.getMapSelectOptions(),onChange:function(value){props.setAttributes({id:value})}}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("a",{href:WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu",onClick:function(event){var map_id=$("select[name='map_id']").val();return window.open(WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu&action=edit&map_id="+map_id),event.preventDefault(),!1},target:"_blank",className:"button button-primary"},React.createElement("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"}),__("Go to Map Editor"))),React.createElement(SelectControl,{name:"mashup_ids",label:__("Mashup IDs"),value:props.attributes.mashup_ids||[],options:this.getMapSelectOptions(),multiple:!0,onChange:function(value){props.setAttributes({mashup_ids:value})}}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("button",{className:"button button-primary",onClick:function(){$("select[name='mashup_ids']").val(null),props.setAttributes({mashup_ids:[]})}},React.createElement("i",{className:"fa fa-times","aria-hidden":"true"}),__("Reset Mashup IDs"))),React.createElement(SelectControl,{name:"marker",label:__("Focused Marker"),value:"none",options:[{key:"none",value:"none",label:__("None")}],onChange:function(value){props.setAttributes({marker:value})}}),React.createElement(RangeControl,{name:"zoom",label:__("Override Zoom"),onChange:function(value){props.setAttributes({zoom:value})},min:1,max:21,step:1,value:parseInt(props.attributes.zoom)}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("button",{className:"button button-primary",onClick:function(){props.setAttributes({zoom:""})}},React.createElement("i",{className:"fa fa-times","aria-hidden":"true"}),__("Reset Override Zoom"))),React.createElement(SelectControl,{name:"cat",label:__("Initial Category"),value:"none",options:[{key:"none",value:"none",label:__("None")}],onChange:function(value){props.setAttributes({cat:value})}}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("a",{href:"https://www.wpgmaps.com/documentation/creating-your-first-map/",target:"_blank",className:"button button-primary"},React.createElement("i",{className:"fa fa-book","aria-hidden":"true"}),__("View Documentation")))))},WPGMZA.Integration.ProGutenberg.prototype.getBlockAttributes=function(props){return{id:{type:"string"},mashup_ids:{type:"array"},marker:{type:"string"},zoom:{type:"string"},cat:{type:"string"}}},WPGMZA.Integration.ProGutenberg.prototype.getBlockDefinition=function(props){return WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition.call(this,props)},WPGMZA.integrationModules.gutenberg=WPGMZA.Integration.Gutenberg.createInstance())}),jQuery(function($){WPGMZA.CloudAPI=function(){},WPGMZA.CloudAPI.createInstance=function(){return new WPGMZA.CloudAPI},Object.defineProperty(WPGMZA.CloudAPI,"url",{value:"https://www.wpgmaps.com/cloud/public",writable:!1}),Object.defineProperty(WPGMZA.CloudAPI,"isBeingUsed",{get:function(){return/^wpgmza[a-f0-9]+$/.test(WPGMZA.settings.wpgmza_google_maps_api_key)}}),Object.defineProperty(WPGMZA.CloudAPI,"key",{get:function(){return WPGMZA.settings.wpgmza_google_maps_api_key}});var nativeCallFunction=WPGMZA.CloudAPI.call;WPGMZA.CloudAPI.call=function(){console.warn("WPGMZA.CloudAPI.call was called statically, did you mean to call the function on WPGMZA.cloudAPI?"),nativeCallFunction.apply(this,arguments)},WPGMZA.CloudAPI.prototype.call=function(url,options){var sessionToken;(options=options||{}).data||(options.data={});var language=WPGMZA.locale.substr(0,2);options.data.sessiontoken&&(sessionToken=options.data.sessiontoken,delete options.data.sessiontoken),"he_IL"==WPGMZA.locale&&(language="iw"),options.url=WPGMZA.CloudAPI.url+url,options.beforeSend=function(xhr){xhr.setRequestHeader("X-WPGMZA-CLOUD-API-KEY",WPGMZA.CloudAPI.key),sessionToken&&xhr.setRequestHeader("X-WPGMZA-CLOUD-API-SESSION-TOKEN",sessionToken)},options.data.language=language,$.ajax(options)}}),jQuery(function($){WPGMZA.CloudAutocomplete=function(element,options){var self=this;WPGMZA.EventDispatcher.apply(this,arguments),this.element=element,this.options=options,$(this.element).wrap("<div class='wpgmza-cloud-address-input-wrapper'></div>"),this.wrapper=$(this.element).parent(),this.preloader=$(WPGMZA.loadingHTML),$(this.element).after(this.preloader),$(this.preloader).hide(),this.session={guid:null,expires:0},$(element).autocomplete({open:function(event,ui){self.onOpen(event,ui)},select:function(event,ui){self.onSelect(event,ui)},source:function(request,response){var data=(new Date).getTime();self.session.expires<data&&(self.session.guid=WPGMZA.guid()),self.session.expires=data+3e4;data={input:$(self.element).val(),sessiontoken:self.session.guid};options.country&&(data.components="country:"+options.country);data=$.extend(data,self.options);self.showPreloader(!0),WPGMZA.cloudAPI.call("/autocomplete",{data:data,success:function(data){var items=[];data.predictions.forEach(function(prediction){items.push({id:prediction.id,value:prediction.description})}),response(items),self.showPreloader(!1)}})}}),this.widget=$(element).autocomplete("widget"),this.widget.addClass("wpgmza-cloud-autocomplete")},WPGMZA.extend(WPGMZA.CloudAutocomplete,WPGMZA.EventDispatcher),WPGMZA.CloudAutocomplete.prototype.onOpen=function(event,ui){this.widget.css({width:$(this.element).outerWidth()+"px"})},WPGMZA.CloudAutocomplete.prototype.onSelect=function(event,ui){this.session.expires=0},WPGMZA.CloudAutocomplete.prototype.showPreloader=function(show){show?$(this.preloader).show():$(this.preloader).hide()}}),jQuery(function($){WPGMZA.CloudDirectionsRenderer=function(map){WPGMZA.DirectionsRenderer.apply(this,arguments),this.panel=$("#directions_panel_"+map.id)},WPGMZA.extend(WPGMZA.CloudDirectionsRenderer,WPGMZA.DirectionsRenderer),WPGMZA.CloudDirectionsRenderer.maneuverToClassName=function(maneuver){var map={"turn-slight-left":"slight-left","turn-sharp-left":"sharp-left","uturn-left":"sharp-left","turn-left":"left","turn-slight-right":"slight-right","turn-sharp-right":"sharp-right","uturn-right":"sharp-right","turn-right":"right",straight:"straight","ramp-left":"keep-left","ramp-right":"keep-right","fork-left":"keep-left","fork-right":"keep-right","roundabout-left":"enter-roundabout","roundabout-right":"enter-roundabout"};return map[maneuver]?"wpgmza-instruction-type-"+map[maneuver]:""},WPGMZA.CloudDirectionsRenderer.prototype.clear=function(){this.removeMarkers(),this.polyline&&(this.map.removePolyline(this.polyline),delete this.polyline),this.panel.html("")},WPGMZA.CloudDirectionsRenderer.prototype.setDirections=function(settings){var path,points,steps,self=this,route=settings.routes[0];this.clear(),route&&(path=[],points=[],window.polyline.decode(route.overview_polyline.points).forEach(function(arr){path.push(new google.maps.LatLng({lat:arr[0],lng:arr[1]})),points.push(new WPGMZA.LatLng({lat:arr[0],lng:arr[1]}))}),settings=this.getPolylineOptions(),this.polyline=WPGMZA.Polyline.createInstance({settings:settings}),this.polyline.googlePolyline.setOptions({path:path}),this.map.addPolyline(this.polyline),this.addMarkers(points),steps=[],route.legs&&route.legs.forEach(function(leg){steps=steps.concat(leg.steps)}),steps.forEach(function(step){var div=$("<div class='wpgmza-directions-step'></div>");div[0].wpgmzaDirectionsStep=step,div.html(step.html_instructions),div.addClass(WPGMZA.CloudDirectionsRenderer.maneuverToClassName(step.maneuver)),self.panel.append(div)}))}}),jQuery(function($){WPGMZA.CloudDirectionsService=function(map){WPGMZA.DirectionsService.apply(this,arguments)},WPGMZA.extend(WPGMZA.CloudDirectionsService,WPGMZA.DirectionsService),WPGMZA.CloudDirectionsService.prototype.route=function(request,callback){WPGMZA.cloudAPI.call("/directions",{data:request,success:function(response,status,xhr){for(var key in request)response[key]=request[key];callback(response)}})}}),jQuery(function($){WPGMZA.CloudGeocoder=function(){},WPGMZA.CloudGeocoder.SUCCESS="success",WPGMZA.CloudGeocoder.prototype.geocode=function(options,callback){WPGMZA.cloudAPI.call("/geocode",{data:options,success:function(results,status){results?(results.forEach(function(result){result.geometry.location=new google.maps.LatLng(result.geometry.location.lat,result.geometry.location.lng)}),0==results.length&&(status=WPGMZA.Geocoder.ZERO_RESULTS),callback(results,status)):callback(results,WPGMZA.GeocoderStatus.FAIL)}})}}),jQuery(function($){WPGMZA.GoogleDirectionsRenderer=function(map){WPGMZA.DirectionsRenderer.apply(this,arguments),this.map=map,this.googleDirectionsDisplay=new google.maps.DirectionsRenderer({map:map.googleMap,preserveViewport:!0,draggable:!0,suppressMarkers:!0}),this.googleDirectionsDisplay.setPanel($("#directions_panel_"+map.id)[0])},WPGMZA.extend(WPGMZA.GoogleDirectionsRenderer,WPGMZA.DirectionsRenderer),WPGMZA.GoogleDirectionsRenderer.prototype.setDirections=function(options){this.googleDirectionsDisplay.setDirections(options.originalResponse),options.routes&&options.routes[0]&&options.routes[0].legs&&options.routes[0].legs[0]&&(this.directionLeg=options.routes[0].legs[0],this.directionStartMarker=WPGMZA.Marker.createInstance({position:new WPGMZA.LatLng(this.directionLeg.start_location.lat(),this.directionLeg.start_location.lng()),icon:this.map.settings.directions_route_origin_icon||"",retina:this.map.settings.directions_origin_retina,disableInfoWindow:!0}),this.directionStartMarker._icon.retina=this.directionStartMarker.retina,this.map.addMarker(this.directionStartMarker),this.directionEndMarker=WPGMZA.Marker.createInstance({position:new WPGMZA.LatLng(this.directionLeg.end_location.lat(),this.directionLeg.end_location.lng()),icon:this.map.settings.directions_route_destination_icon||"",retina:this.map.settings.directions_destination_retina,disableInfoWindow:!0}),this.directionEndMarker._icon.retina=this.directionEndMarker.retina,this.map.addMarker(this.directionEndMarker));options={polylineOptions:{strokeColor:"#4285F4"}};this.map.settings.directions_route_stroke_color&&(options.polylineOptions.strokeColor=this.map.settings.directions_route_stroke_color),this.map.settings.directions_route_stroke_weight&&(options.polylineOptions.strokeWeight=parseFloat(this.map.settings.directions_route_stroke_weight)),this.map.settings.directions_route_stroke_opacity&&(options.polylineOptions.strokeOpacity=parseFloat(this.map.settings.directions_route_stroke_opacity)),this.googleDirectionsDisplay.setMap(this.map.googleMap),this.googleDirectionsDisplay.setOptions(options),this.map.settings.directions_fit_bounds_to_route&&this.directionStartMarker&&this.directionEndMarker&&this.fitBoundsToRoute(this.directionStartMarker.getPosition(),this.directionEndMarker.getPosition())},WPGMZA.GoogleDirectionsRenderer.prototype.clear=function(){this.googleDirectionsDisplay.setMap(null),this.directionStartMarker&&this.map.removeMarker(this.directionStartMarker),this.directionEndMarker&&this.map.removeMarker(this.directionEndMarker)}}),jQuery(function($){WPGMZA.GoogleDirectionsService=function(map){WPGMZA.DirectionsService.apply(this,arguments),WPGMZA.CloudAPI.isBeingUsed?this.googleDirectionsService=new WPGMZA.CloudDirectionsService:this.googleDirectionsService=new google.maps.DirectionsService},WPGMZA.extend(WPGMZA.GoogleDirectionsService,WPGMZA.DirectionsService),WPGMZA.GoogleDirectionsService.prototype.route=function(request,callback){var self=this;request.travelMode=request.travelMode.toUpperCase(),request.unitSystem===WPGMZA.Distance.KILOMETERS?request.unitSystem=google.maps.UnitSystem.METRIC:request.unitSystem=google.maps.UnitSystem.IMPERIAL,this.googleDirectionsService.route(request,function(response){var status;switch(response.originalResponse=$.extend({},response),response.status){case google.maps.DirectionsStatus.OK:status=WPGMZA.DirectionsService.SUCCESS;break;case google.maps.DirectionsStatus.ZERO_RESULTS:status=WPGMZA.DirectionsService.ZERO_RESULTS;break;case google.maps.DirectionsStatus.NOT_FOUND:status=WPGMZA.DirectionsService.NOT_FOUND;break;default:return void console.warn("Failed to get directions from Google: "+response.status)}callback(response,status);var event=new WPGMZA.Event({type:"directionsserviceresult",response:response,status:status});self.map.trigger(event)})}}),jQuery(function($){WPGMZA.GoogleHeatmap=function(options){WPGMZA.Heatmap.call(this,options),google.maps.visualization?(this.googleHeatmap=new google.maps.visualization.HeatmapLayer,this.googleFeature=this.googleHeatmap,this.updateGoogleHeatmap()):console.warn("Heatmaps disabled. You must include the visualization library in the Google Maps API")},WPGMZA.GoogleHeatmap.prototype=Object.create(WPGMZA.Heatmap.prototype),WPGMZA.GoogleHeatmap.prototype.constructor=WPGMZA.GoogleHeatmap,WPGMZA.GoogleHeatmap.prototype.updateGoogleHeatmap=function(){for(var points=this.parseGeometry(this.dataset),len=points.length,data=[],i=0;i<len;i++)data.push(new google.maps.LatLng(parseFloat(points[i].lat),parseFloat(points[i].lng)));this.googleHeatmap.setData(data),this.gradient&&this.googleHeatmap.set("gradient",this.gradient),this.radius&&this.googleHeatmap.set("radius",parseFloat(this.radius)),this.heatmap_radius&&this.googleHeatmap.set("radius",parseFloat(this.heatmap_radius)),this.opacity&&this.googleHeatmap.set("opacity",parseFloat(this.opacity)),this.heatmap_opacity&&this.googleHeatmap.set("opacity",parseFloat(this.heatmap_opacity)),this.map&&!this.googleHeatmap.getMap()&&this.googleHeatmap.setMap(this.map.googleMap)},WPGMZA.GoogleHeatmap.prototype.update=function(){this.updateGoogleHeatmap()},WPGMZA.GoogleHeatmap.prototype.updateDatasetFromMarkers=function(){WPGMZA.Heatmap.prototype.updateDatasetFromMarkers.apply(this,arguments),this.updateGoogleHeatmap()},WPGMZA.GoogleHeatmap.prototype.onMapMouseDown=function(event){2==event.button&&this.map.googleMap.setOptions({draggable:!1}),WPGMZA.Heatmap.prototype.onMapMouseDown.apply(this,arguments)},WPGMZA.GoogleHeatmap.prototype.onWindowMouseUp=function(event){2==event.button&&this.map.googleMap.setOptions({draggable:!0}),WPGMZA.Heatmap.prototype.onWindowMouseUp.apply(this,arguments)}}),jQuery(function($){WPGMZA.GoogleProDrawingManager=function(map){WPGMZA.ProDrawingManager.apply(this,arguments)},WPGMZA.extend(WPGMZA.GoogleProDrawingManager,WPGMZA.ProDrawingManager)}),jQuery(function($){WPGMZA.GoogleProInfoWindow=function(feature){WPGMZA.GoogleInfoWindow.call(this,feature)},WPGMZA.GoogleProInfoWindow.prototype=Object.create(WPGMZA.GoogleInfoWindow.prototype),WPGMZA.GoogleProInfoWindow.prototype.constructor=WPGMZA.GoogleProInfoWindow,WPGMZA.GoogleProInfoWindow.prototype.open=function(map,feature){switch(this.feature=feature,"map-edit"==WPGMZA.currentPage?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:this.style){case WPGMZA.ProInfoWindow.STYLE_MODERN:case WPGMZA.ProInfoWindow.STYLE_MODERN_PLUS:case WPGMZA.ProInfoWindow.STYLE_MODERN_CIRCULAR:case WPGMZA.ProInfoWindow.STYLE_TEMPLATE:return WPGMZA.ProInfoWindow.prototype.open.call(this,map,feature);default:var result=WPGMZA.GoogleInfoWindow.prototype.open.call(this,map,feature);return this.maxWidth&&this.googleInfoWindow&&this.googleInfoWindow.setOptions({maxWidth:this.maxWidth}),result}},WPGMZA.GoogleProInfoWindow.prototype.setPosition=function(position){this.googleInfoWindow&&this.googleInfoWindow.setPosition(position.toGoogleLatLng())}}),jQuery(function($){WPGMZA.GoogleProMap=function(element,options){WPGMZA.GoogleMap.call(this,element,options),this.loadKMLLayers(),this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded")},WPGMZA.GoogleProMap.prototype=Object.create(WPGMZA.GoogleMap.prototype),WPGMZA.GoogleProMap.prototype.constructor=WPGMZA.GoogleProMap.prototype,WPGMZA.GoogleProMap.prototype.addHeatmap=function(heatmap){heatmap.googleHeatmap.setMap(this.googleMap),WPGMZA.ProMap.prototype.addHeatmap.call(this,heatmap)},WPGMZA.GoogleProMap.prototype.loadKMLLayers=function(){if(this.kmlLayers)for(var i=0;i<this.kmlLayers.length;i++)this.kmlLayers[i].setMap(null);if(this.kmlLayers=[],this.settings.kml)for(var urls=this.settings.kml.split(","),cachebuster=(new Date).getTime(),i=0;i<urls.length;i++)this.kmlLayers.push(new google.maps.KmlLayer(urls[i]+"?cachebuster="+cachebuster,{map:this.googleMap,preserveViewport:!0}))},WPGMZA.GoogleProMap.prototype.loadFusionTableLayer=function(){this.settings.fusion&&(console.warn("Fusion Table Layers are deprecated and will cease functioning from 2019/12/03"),this.fusionLayer=new google.maps.FusionTablesLayer(this.settings.fusion,{map:this.googleMap,surpressInfoWindows:!0}))},WPGMZA.GoogleProMap.prototype.setStreetView=function(options){var latLng=this.getCenter();"marker"in(options=options||{bearing:0,pitch:10})&&(marker=this.getMarkerByID(options.marker))?latLng=marker.getPosition().toLatLngLiteral():"lat"in options&&"lng"in options&&(latLng={lat:parseFloat(options.lat),lng:parseFloat(options.lng)}),"bearing"in options&&(options.bearing=parseInt(options.bearing),isNaN(options.bearing)&&console.warn("Invalid bearing")),"pitch"in options&&(options.pitch=parseInt(options.pitch),isNaN(options.pitch)&&console.warn("Invalid pitch")),this.panorama=new google.maps.StreetViewPanorama(this.element,{position:latLng,pov:{heading:parseInt(options.bearing),pitch:parseInt(options.pitch)}})},WPGMZA.GoogleProMap.prototype.onInit=function(event){WPGMZA.GoogleMap.prototype.onInit.call(this,event),this.shortcodeAttributes.streetview&&!this.shortcodeAttributes.marker&&this.setStreetView(this.shortcodeAttributes)},WPGMZA.GoogleProMap.prototype.onMarkersPlaced=function(event){WPGMZA.GoogleMap.prototype.onMarkersPlaced.call(this,event),this.shortcodeAttributes.streetview&&this.shortcodeAttributes.marker&&this.setStreetView(this.shortcodeAttributes)}}),jQuery(function($){WPGMZA.GoogleProMarker=function(row){WPGMZA.GoogleMarker.call(this,row)},WPGMZA.GoogleProMarker.prototype=Object.create(WPGMZA.GoogleMarker.prototype),WPGMZA.GoogleProMarker.prototype.constructor=WPGMZA.GoogleProMarker,WPGMZA.GoogleProMarker.prototype.onAdded=function(event){WPGMZA.GoogleMarker.prototype.onAdded.apply(this,arguments),this.map.settings.wpgmza_settings_disable_infowindows&&this.googleMarker.setOptions({clickable:!1})},WPGMZA.GoogleProMarker.prototype.updateIcon=function(){var img,self=this,icon=this._icon;icon.retina?((img=new Image).onload=function(event){var size=new google.maps.Size(WPGMZA.settings.retinaWidth?parseInt(WPGMZA.settings.retinaWidth):Math.round(img.width/2),WPGMZA.settings.retinaHeight?parseInt(WPGMZA.settings.retinaHeight):Math.round(img.height/2));self.googleMarker.setIcon(new google.maps.MarkerImage(icon.url,null,null,null,size))},img.src=icon.isDefault?WPGMZA.defaultMarkerIcon:icon.url):this.googleMarker.setIcon(icon.url)}}),jQuery(function($){WPGMZA.GoogleProPolygon=function(row,googlePolygon){var self=this;WPGMZA.GooglePolygon.call(this,row,googlePolygon),google.maps.event.addListener(this.googlePolygon,"mouseover",function(event){self.trigger("mouseover")}),google.maps.event.addListener(this.googlePolygon,"mouseout",function(event){self.trigger("mouseout")})},WPGMZA.GoogleProPolygon.prototype=Object.create(WPGMZA.GooglePolygon.prototype),WPGMZA.GoogleProPolygon.prototype.constructor=WPGMZA.GoogleProPolygon}),jQuery(function($){WPGMZA.HeatmapPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.HeatmapPanel,WPGMZA.FeaturePanel),WPGMZA.HeatmapPanel.createInstance=function(element,mapEditPage){return new WPGMZA.HeatmapPanel(element,mapEditPage)},WPGMZA.HeatmapPanel.prototype.reset=function(event){WPGMZA.FeaturePanel.prototype.reset.apply(this,arguments),$(this.element).find("[data-ajax-name='gradient']").prop("checked",!1),$($(this.element).find("[data-ajax-name='gradient']")[0]).prop("checked",!0)},WPGMZA.HeatmapPanel.prototype.populate=function(data){var str;WPGMZA.FeaturePanel.prototype.populate.apply(this,arguments),data.gradient&&(str=JSON.stringify(JSON.parse(data.gradient)),$(this.element).find("input[data-ajax-name='gradient']").each(function(index,el){var compare=JSON.stringify(JSON.parse($(el).val()));if(str==compare)return $(el).prop("checked",!0),!1}))},WPGMZA.HeatmapPanel.prototype.onPropertyChanged=function(value){var name;this.drawingManager.mode==WPGMZA.DrawingManager.MODE_HEATMAP?this.drawingManager.onHeatmapPropertyChanged(value):this.feature&&(name=$(value.target).attr("data-ajax-name"),value=$(value.target).val(),"gradient"===name&&(value=JSON.parse(value)),this.feature[name]=value,this.feature.update())},WPGMZA.HeatmapPanel.prototype.onFeatureChanged=function(event){var geometryField=$(this.element).find("[data-ajax-name='dataset']");geometryField.length&&geometryField.val(JSON.stringify(this.feature.getGeometry()))}}),jQuery(function($){WPGMZA.ProCirclePanel=function(element){WPGMZA.CirclePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProCirclePanel,WPGMZA.CirclePanel)}),jQuery(function($){WPGMZA.ProMarkerPanel=function(element){WPGMZA.MarkerPanel.apply(this,arguments),this.initMarkerIconPicker(),this.initMarkerGalleryInput(),this.initCategoryPicker()},WPGMZA.extend(WPGMZA.ProMarkerPanel,WPGMZA.MarkerPanel),WPGMZA.ProMarkerPanel.prototype.initMarkerIconPicker=function(){this.markerIconPicker=new WPGMZA.MarkerIconPicker($(this.element).find(".wpgmza-marker-icon-picker"))},WPGMZA.ProMarkerPanel.prototype.initMarkerGalleryInput=function(){this.markerGalleryInput=new WPGMZA.MarkerGalleryInput($(this.element).find("input[data-ajax-name='gallery']"))},WPGMZA.ProMarkerPanel.prototype.initCategoryPicker=function(){this.categoryPicker=new WPGMZA.CategoryPicker($(this.element).find(".wpgmza-category-picker"))},WPGMZA.ProMarkerPanel.prototype.focusMapOnFeature=function(marker){this.map.panTo(marker.getPosition())},WPGMZA.ProMarkerPanel.prototype.reset=function(){WPGMZA.MarkerPanel.prototype.reset.apply(this,arguments),this.categoryPicker.setSelection(null),this.markerGalleryInput.clear(),this.markerIconPicker.reset()},WPGMZA.ProMarkerPanel.prototype.initDefaults=function(){var self=this,args=arguments;$(this.element).find(".wpgmza-category-picker").on("loaded.jstree",function(){WPGMZA.MarkerPanel.prototype.initDefaults.apply(self,args)})},WPGMZA.ProMarkerPanel.prototype.populate=function(data){for(var name in WPGMZA.FeaturePanel.prototype.populate.apply(this,arguments),data)switch(name){case"description":var tinyMCEInstance,tinyMCEModeToggled;tinyMCE.get("wpgmza-description-editor")?(tinyMCEModeToggled=!1,(tinyMCEInstance=tinyMCE.get("wpgmza-description-editor")).isHidden()&&(tinyMCEInstance.show(),tinyMCEModeToggled=!0),tinyMCEInstance.setContent(data.description),tinyMCEModeToggled&&tinyMCEInstance.hide()):$("#wpgmza-description-editor").val(data.description);break;case"icon":this.markerIconPicker.setIcon(data.icon);break;case"categories":this.categoryPicker.setSelection(data.categories);break;case"gallery":data.gallery&&this.markerGalleryInput.populate(data.gallery);break;case"custom_field_data":data.custom_field_data.forEach(function(field){$("fieldset[data-custom-field-id='"+field.id+"'] input[data-ajax-name]").val(field.value)})}!data.pic||!data.pic.length||data.gallery&&data.gallery.length||this.markerGalleryInput.addPicture({url:data.pic})},WPGMZA.ProMarkerPanel.prototype.serializeFormData=function(){var data=WPGMZA.MarkerPanel.prototype.serializeFormData.apply(this,arguments);return 0<$("#wpgmza-description-editor-tmce").length&&$("#wpgmza-description-editor-tmce").click(),tinyMCE.get("wpgmza-description-editor")?data.description=tinyMCE.get("wpgmza-description-editor").getContent():data.description=$("#wpgmza-description-editor").val(),data.gallery=this.markerGalleryInput.toJSON(),data},WPGMZA.ProMarkerPanel.prototype.onSave=function(event){var addressUnchanged,self=this,address=$(this.element).find("[data-ajax-name='address']").val();0!=address.length?(this.showPreloader(!0),addressUnchanged=!1,this.feature&&this.feature.address&&address&&"string"==typeof this.feature.address&&"string"==typeof address&&this.feature.address.trim()===address.trim()&&(addressUnchanged=!0),this.adjustSubMode||addressUnchanged?WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments):WPGMZA.Geocoder.createInstance().geocode({address:address},function(results,status){switch(status){case WPGMZA.Geocoder.SUCCESS:var latLng=results[0].latLng;$(self.element).find("[data-ajax-name='lat']").val(latLng.lat),$(self.element).find("[data-ajax-name='lng']").val(latLng.lng),WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments);break;case WPGMZA.Geocoder.ZERO_RESULTS:alert(WPGMZA.localized_strings.zero_results);break;default:alert(WPGMZA.localized_strings.geocode_fail)}})):alert(WPGMZA.localized_strings.no_address_specified)}}),jQuery(function($){WPGMZA.ProPolygonPanel=function(element){WPGMZA.PolygonPanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProPolygonPanel,WPGMZA.PolygonPanel)}),jQuery(function($){WPGMZA.ProPolylinePanel=function(element){WPGMZA.PolylinePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProPolylinePanel,WPGMZA.PolylinePanel)}),jQuery(function($){WPGMZA.ProRectanglePanel=function(element){WPGMZA.RectanglePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProRectanglePanel,WPGMZA.RectanglePanel)}),jQuery(function($){WPGMZA.AdvancedTableDataTable=function(element,listing){var self=this;this.element=element,this.listing=listing,WPGMZA.DataTable.apply(this,arguments),this.overrideListingOrderSettings=!1,$(this.dataTableElement).on("click","th",function(event){self.onUserChangedOrder(event)})},WPGMZA.AdvancedTableDataTable.prototype=Object.create(WPGMZA.DataTable.prototype),WPGMZA.AdvancedTableDataTable.prototype.constructor=WPGMZA.AdvancedTableDataTable,WPGMZA.AdvancedTableDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.apply(this,arguments);(languageURL=$(this.element).attr("data-order-json"))&&(options.order=JSON.parse(languageURL)),options.drawCallback=function(settings){var ths=$(self.element).find(".wpgmza_table > thead th");self.lastResponse&&self.lastResponse.meta&&(0!=self.lastResponse.meta.length&&($(self.element).find(".wpgmza_table > tbody > tr").each(function(meta,tr){meta=self.lastResponse.meta[meta];$(tr).addClass("wpgmaps_mlist_row"),$(tr).attr("mid",meta.id),$(tr).attr("mapid",self.map.id),$(tr).children("td").each(function(wpgmza_class,td){wpgmza_class=ths[wpgmza_class].className.match(/wpgmza_\w+/)[0];$(td).addClass(wpgmza_class)})}),$(self.element).find("[data-marker-icon-src]").each(function(index,el){var data,src=$(el).attr("data-marker-icon-src");try{data=JSON.parse(src)}catch(e){data=src}WPGMZA.MarkerIcon.createInstance(data).applyToElement(el)})),self.map.markerListing.trigger("markerlistingupdated"))},options.language={};var search_string,start,string_of,string_to,total,show,entries,languageURL=this.getLanguageURL();switch(languageURL&&(options.language={url:languageURL}),""!=this.listing.map.settings.datatable_no_result_message&&(search_string=this.listing.map.settings.datatable_no_result_message,options.language.zeroRecords=search_string),1==this.listing.map.settings.remove_search_box_datables&&(options.searching=!1),this.listing.map.settings.dataTable_pagination_style){case"page-number-buttons-only":options.pagingType="numbers";break;case"prev-and-next-buttons-only":options.pagingType="simple";break;case"prev-and-next-buttons-plus-page-numbers":options.pagingType="simple_numbers";break;case"first-prev-next-and-last-buttons":options.pagingType="full";break;case"first-prev-next-and-last-buttons-plus-page-numbers":options.pagingType="full_numbers";break;case"first-and-last-buttons-plus-page-numbers":options.pagingType="fist_last_numbers"}return""!=this.listing.map.settings.datatable_search_string&&(search_string=this.listing.map.settings.datatable_search_string,options.language.search=search_string),this.listing.map.settings.datatable_result&&(""!=this.listing.map.settings.datatable_result_start&&(start=this.listing.map.settings.datatable_result_start),""!=this.listing.map.settings.datatable_result_of&&(string_of=this.listing.map.settings.datatable_result_of),""!=this.listing.map.settings.datatable_result_to&&(string_to=this.listing.map.settings.datatable_result_to),""!=this.listing.map.settings.datatable_result_total&&(total=this.listing.map.settings.datatable_result_total),options.language.sInfo=start+" _START_ "+string_of+" _END_ "+string_to+" _TOTAL_ "+total),this.listing.map.settings.datatable_result_page&&(""!=this.listing.map.settings.datatable_result_show&&(show=this.listing.map.settings.datatable_result_show),""!=this.listing.map.settings.datatable_result_to&&(entries=this.listing.map.settings.datatable_result_entries),options.language.sLengthMenu=show+" _MENU_ "+entries),options},WPGMZA.AdvancedTableDataTable.prototype.onAJAXRequest=function(data,settings){var request=this.listing.getAJAXRequestParameters().data,listingFilteringParams=request.filteringParams;request.overrideMarkerIDs;return delete request.filteringParams,delete request.overrideMarkerIDs,(request=$.extend({},request,WPGMZA.DataTable.prototype.onAJAXRequest.apply(this,arguments))).filteringParams=$.extend({},listingFilteringParams,this.filteringParams),this.filteredMarkerIDs&&(request.markerIDs=this.filteredMarkerIDs.join(",")),void 0!==this.overrideListingOrderSettings&&(request.overrideListingOrderSettings=this.overrideListingOrderSettings),request},WPGMZA.AdvancedTableDataTable.prototype.getLanguageURL=function(){return WPGMZA.DataTable.prototype.getLanguageURL.apply(this,arguments)},WPGMZA.AdvancedTableDataTable.prototype.onMarkerFilterFilteringComplete=function(event){var self=this;this.filteredMarkerIDs=[],event.filteredMarkers.forEach(function(data){self.filteredMarkerIDs.push(data.id)}),self.filteringParams=event.filteringParams},WPGMZA.AdvancedTableDataTable.prototype.onUserChangedOrder=function(event){this.overrideListingOrderSettings=!0}}),jQuery(function($){WPGMZA.MarkerListing=function(map,element,options){var self=this;if(WPGMZA.EventDispatcher.apply(this),this._paginationEnabled=!0,this.map=this.parent=map,this.element=element,this.element?this.element.wpgmzaMarkerListing=this:WPGMZA.isDeveloperMode()&&console.warn("Marker listing initialised with null element. This is presently supported to allow the marker listing category filter to still function, however this will be removed in the future."),options)for(var key in options)this[key]=options[key];this.categoryDropdown=$(".wpgmza-marker-listing-category-filter[data-map-id='"+this.map.id+"'] select"),$(this.categoryDropdown).closest(".wpgmza-store-locator").length||this.categoryDropdown.on("change",function(event){WPGMZA.getMapByID(self.map.id).markerFilter.update()}),this.categoryCheckboxes=$(".wpgmza-marker-listing-category-filter[data-map-id='"+this.map.id+"'] input[type='checkbox']"),this.categoryCheckboxes.on("change",function(event){WPGMZA.getMapByID(self.map.id).markerFilter.update()}),1==map.settings.wpgmza_store_locator_hide_before_search&&(this.showOnFilteringComplete=!0,$(this.element).hide()),void 0!==map.settings.push_in_map&&void 0===map.settings.wpgmza_push_in_map&&(map.settings.wpgmza_push_in_map=map.settings.push_in_map,map.settings.wpgmza_push_in_map_placement=map.settings.push_in_map_placement),map.settings.wpgmza_push_in_map&&this.pushIntoMap(),$(this.element).on("click",".wpgmaps_mlist_row, .wpgmaps_blist_row",function(event){self.onItemClick(event)}),$(document.body).on("filteringcomplete.wpgmza",function(event){event.map.id==self.map.id&&self.onFilteringComplete(event)}),this.reload()},WPGMZA.extend(WPGMZA.MarkerListing,WPGMZA.EventDispatcher),WPGMZA.MarkerListing.createInstance=function(map,element,options){switch(void 0!==map.settings.list_markers_by&&void 0===map.settings.wpgmza_listmarkers_by&&(map.settings.wpgmza_listmarkers_by=parseInt(map.settings.list_markers_by)),map.settings.wpgmza_listmarkers_by){case WPGMZA.MarkerListing.STYLE_ADVANCED_TABLE:return new WPGMZA.AdvancedTableMarkerListing(map,element,options);case WPGMZA.MarkerListing.STYLE_CAROUSEL:return new WPGMZA.CarouselMarkerListing(map,element,options);case WPGMZA.MarkerListing.STYLE_MODERN:return new WPGMZA.ModernMarkerListing(map,element,options);default:return new WPGMZA.MarkerListing(map,element,options)}},WPGMZA.MarkerListing.STYLE_NONE=0,WPGMZA.MarkerListing.STYLE_BASIC_TABLE=1,WPGMZA.MarkerListing.STYLE_BASIC_LIST=4,WPGMZA.MarkerListing.STYLE_ADVANCED_TABLE=2,WPGMZA.MarkerListing.STYLE_CAROUSEL=3,WPGMZA.MarkerListing.STYLE_MODERN=6,WPGMZA.MarkerListing.ORDER_BY_ID=1,WPGMZA.MarkerListing.ORDER_BY_TITLE=2,WPGMZA.MarkerListing.ORDER_BY_ADDRESS=3,WPGMZA.MarkerListing.ORDER_BY_DESCRIPTION=4,WPGMZA.MarkerListing.ORDER_BY_CATEGORY=5,WPGMZA.MarkerListing.ORDER_BY_CATEGORY_PRIORITY=6,WPGMZA.MarkerListing.ORDER_BY_DISTANCE=7,WPGMZA.MarkerListing.ORDER_BY_RATING=8,Object.defineProperty(WPGMZA.MarkerListing.prototype,"mapID",{get:function(){return this.map.id}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"paginationEnabled",{get:function(){return this._paginationEnabled},set:function(value){this._paginationEnabled=!!value}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"pageSize",{get:function(){if(!WPGMZA.settings.wpgmza_default_items)return 10;var pageSize=parseInt(WPGMZA.settings.wpgmza_default_items);return isNaN(pageSize)?null:pageSize},set:function(value){this.pagination("pageSize",value)}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"currentPage",{get:function(){if(!this.paginationElement)return 0;try{return $(this.paginationElement).pagination("getSelectedPageNum")-1}catch(e){return 0}},set:function(value){throw new Error("Not yet implemented")}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"imageWidth",{get:function(){var width=WPGMZA.settings.wpgmza_settings_image_width;return!(!width||!/^\d+$/.test(width))&&width}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"imageHeight",{get:function(){var height=WPGMZA.settings.wpgmza_settings_image_height;return!(!height||!/^\d+$/.test(height))&&height}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"style",{get:function(){return this.map.settings.list_markers_by}}),WPGMZA.MarkerListing.prototype.initPagination=function(){if(this.paginationElement){try{$(this.paginationElement).pagination("destroy")}catch(e){}$(this.paginationElement).remove()}var position;this.paginationEnabled&&!this.showOnFilteringComplete&&this.pageSize&&(position=this.getPaginationOptions(),this.lastAJAXResponse.recordsFiltered<=position.pageSize||(this.paginationElement=$("<div class='wpgmza-pagination'/>"),this.pagination=$(this.paginationElement).pagination(this.getPaginationOptions()),$(this.element).after(this.paginationElement),this.map.settings.wpgmza_push_in_map&&this.paginationElement&&"google-maps"===WPGMZA.settings.engine&&($(this.paginationElement).css({zIndex:"999"}),position=parseInt(this.map.settings.wpgmza_push_in_map_placement),this.paginationElement.style?this.map.googleMap.controls[position].push(this.paginationElement):this.paginationElement[0]&&this.map.googleMap.controls[position].push(this.paginationElement[0]))))},WPGMZA.MarkerListing.prototype.getPaginationOptions=function(){var self=this,options={triggerPagingOnInit:!1,pageSize:this.pageSize,dataSource:function(done){done(self.getPaginationDataSource())},callback:function(data,pagination){self.pageOnPaginationReinit=$(self.paginationElement).pagination("getSelectedPageNum"),$(self.paginationElement).pagination("disable"),self.reload()}};return this.pageOnPaginationReinit&&(options.pageNumber=this.pageOnPaginationReinit),options},WPGMZA.MarkerListing.prototype.getPaginationDataSource=function(){var source=[];if(!this.lastAJAXResponse)return source;for(var i=0;i<this.lastAJAXResponse.recordsFiltered;i++)source.push(i);return source},WPGMZA.MarkerListing.prototype.getAJAXRequestParameters=function(params){var self=this;(params=params||{}).data||(params.data={}),params.method="POST",params.useCompressedPathVariable=!0,params.cache=!0;var location=$(this.element).attr("data-wpgmza-ajax-parameters");if(!location||!location.length)throw new Error("No AJAX parameters specified on Marker Listing attribute");location=JSON.parse(location);return $.extend(params.data,{phpClass:$(this.element).attr("data-wpgmza-php-class"),start:this.currentPage*this.pageSize,length:this.pageSize},location),this.overrideMarkerIDs&&(params.data.overrideMarkerIDs=this.overrideMarkerIDs.join(",")),this.lastFilteringParams&&(params.data.filteringParams=this.lastFilteringParams),this.map.showDistanceFromLocation&&(params.data.filteringParams||(params.data.filteringParams={}),location=this.map.showDistanceFromLocation,params.data.filteringParams.center={lat:location.lat,lng:location.lng,source:location.source}),params.success=function(response,textStatus,xhr){self.onAJAXResponse(response,textStatus,xhr)},params},WPGMZA.MarkerListing.prototype.onAJAXResponse=function(response,textStatus,xhr){this.map.showPreloader(!1),this.lastAJAXResponse=response,this.onHTMLResponse(response.html),this.initPagination(),void 0!==this.map.settings.directions_enabled&&0==parseInt(this.map.settings.directions_enabled)&&$(".wpgmza_marker_directions_link").remove(),this.trigger("markerlistingupdated")},WPGMZA.MarkerListing.prototype.onHTMLResponse=function(html){var self=this;$(this.element).html(html),$(this.element).find(".wpgmza-gallery-container").each(function(index,el){var map=self.map,gallery=$(el).closest("[data-marker-id]").attr("data-marker-id"),gallery=map.getMarkerByID(gallery);gallery.gallery&&(gallery=new WPGMZA.MarkerGallery(gallery,self),$(el).html(""),$(el).append(gallery.element))}),$(this.element).find("[data-marker-icon-src]").each(function(index,el){var data,src=$(el).attr("data-marker-icon-src");try{data=JSON.parse(src)}catch(e){data=src}WPGMZA.MarkerIcon.createInstance(data).applyToElement(el)})},WPGMZA.MarkerListing.prototype.getImageElementFromURL=function(url){var img=$("<img class='wpgmza_map_image'/>");return $(img).attr("src",url),this.imageWidth&&$(img).css({width:this.imageWidth+"px"}),this.imageHeight&&$(img).css({height:this.imageHeight+"px"}),img},WPGMZA.MarkerListing.prototype.getRatingWidget=function(marker){var options={type:"marker",id:marker.id};return marker.rating&&(options.averageRating=marker.rating.average,options.numRatings=marker.rating.count),WPGMZA.RatingWidget.createInstance(options)},WPGMZA.MarkerListing.prototype.reload=function(){var route,params;this.element&&(this.prevXHRRequest&&this.prevXHRRequest.abort(),route=$(this.element).attr("data-wpgmza-rest-api-route"),params=this.getAJAXRequestParameters(),this.map.showPreloader(!0),this.prevXHRRequest=WPGMZA.restAPI.call(route,params))},WPGMZA.MarkerListing.prototype.enable=function(value){value?this.pagination("enable"):this.pagination("disable")},WPGMZA.MarkerListing.prototype.getFilteringParameters=function(){var params={};return this.categoryDropdown.length&&"0"!=this.categoryDropdown.val()&&(params.categories=[this.categoryDropdown.val()]),this.categoryCheckboxes.length&&(params.categories=[],this.categoryCheckboxes.each(function(index,el){$(el).prop("checked")&&params.categories.push($(el).val())})),params},WPGMZA.MarkerListing.prototype.pushIntoMap=function(){var setting,width="30%",position="50%";return!!this.element&&("open-layers"==WPGMZA.settings.engine?(console.warn("Push into map is not yet supported when using OpenLayers engine"),!1):this.map.settings.list_markers_by==WPGMZA.MarkerListing.STYLE_MODERN?(console.warn("Push into map is not available with modern style marker listing"),!1):((setting=this.map.settings.wpgmza_push_in_map_width)&&setting.length&&(width=setting),(setting=this.map.settings.wpgmza_push_in_map_height)&&setting.length&&(position=setting),$(this.element).css({margin:"15px",overflow:"auto",zIndex:"999",width:width,height:position}),$(this.element).addClass("wpgmza-shadow-sm wpgmza_innermap_holder"),"open-layers"===WPGMZA.settings.engine||(position=parseInt(this.map.settings.wpgmza_push_in_map_placement),this.element.style?this.map.googleMap.controls[position].push(this.element):this.element[0]&&this.map.googleMap.controls[position].push(this.element[0])),!0))},WPGMZA.MarkerListing.prototype.onFilteringComplete=function(event){var self=this;this.showOnFilteringComplete&&($(this.element).show(),delete this.showOnFilteringComplete),this.overrideMarkerIDs=[],event.filteredMarkers.forEach(function(data){self.overrideMarkerIDs.push(data.id)}),this.lastFilteringParams=event.filteringParams,this.pageOnPaginationReinit=1,this.reload()},WPGMZA.MarkerListing.prototype.onItemClick=function(zoomLevelOnClick){var clickedGetDirections=$(zoomLevelOnClick.currentTarget).attr("mid"),marker=this.map.getMarkerByID(clickedGetDirections),offset=WPGMZA.maps[0].settings.push_in_map&&WPGMZA.maps[0].settings.push_in_map.length,clickedGetDirections=$(zoomLevelOnClick.target).hasClass("wpgmza_gd"),zoomLevelOnClick=13;marker.trigger("select"),this.style==WPGMZA.MarkerListing.STYLE_MODERN||WPGMZA.settings.disable_scroll_on_marker_listing_click||clickedGetDirections||offset||(offset=0,WPGMZA.settings.marker_listing_item_click_scroll_offset&&(offset=parseInt(WPGMZA.settings.marker_listing_item_click_scroll_offset)),this.map.settings.wpgmza_push_in_map||$("html, body").animate({scrollTop:$(this.map.element).offset().top-offset},500)),this.map.settings.zoom_level_on_marker_listing_override&&this.map.settings.zoom_level_on_marker_listing_click?zoomLevelOnClick=this.map.settings.zoom_level_on_marker_listing_click:this.map.settings.mass_marker_support&&WPGMZA.settings.clusterAdvancedEnabled&&WPGMZA.settings.clusterMaxZoom&&(zoomLevelOnClick=parseInt(WPGMZA.settings.clusterMaxZoom)),this.map instanceof WPGMZA.GoogleMap?(this.map.panTo(marker.getPosition()),this.map.setZoom(zoomLevelOnClick)):this.map.panTo(marker.getPosition(),zoomLevelOnClick)}}),jQuery(function($){WPGMZA.AdvancedTableMarkerListing=function(map,element,options){this.element=element=$("#wpgmza_marker_holder_"+map.id+", #wpgmza_marker_list_"+map.id),WPGMZA.MarkerListing.apply(this,arguments),this.dataTable=new WPGMZA.AdvancedTableDataTable(element,this),this.dataTable.map=map},WPGMZA.AdvancedTableMarkerListing.prototype=Object.create(WPGMZA.MarkerListing.prototype),WPGMZA.AdvancedTableMarkerListing.prototype.constructor=WPGMZA.AdvancedTableMarkerListing,WPGMZA.AdvancedTableMarkerListing.prototype.reload=function(){this.dataTable&&this.dataTable.reload()},WPGMZA.AdvancedTableMarkerListing.prototype.onFilteringComplete=function(event){this.dataTable.onMarkerFilterFilteringComplete(event),WPGMZA.MarkerListing.prototype.onFilteringComplete.apply(this,arguments)},WPGMZA.AdvancedTableMarkerListing.prototype.onItemClick=function(event){var isFirstCell=$(event.target).is(":first-child");$(event.target).closest(".dataTable").is(".collapsed")&&isFirstCell||WPGMZA.MarkerListing.prototype.onItemClick.call(this,event)}}),jQuery(function($){WPGMZA.CarouselMarkerListing=function(map,element,options){WPGMZA.MarkerListing.call(this,map,element,$.extend({paginationEnabled:!1},options))},WPGMZA.CarouselMarkerListing.prototype=Object.create(WPGMZA.MarkerListing.prototype),WPGMZA.CarouselMarkerListing.prototype.constructor=WPGMZA.CarouselMarkerListing,WPGMZA.CarouselMarkerListing.createInstance=function(el){return new WPGMZA.CarouselMarkerListing(el)},WPGMZA.CarouselMarkerListing.prototype.getOwlCarouselOptions=function(){var options={autoplay:!0,autoplayTimeout:5e3,lazyLoad:!1,autoHeight:!1,dots:!1,nav:!1,loop:!0,responsive:{0:{items:1},500:{items:3},800:{items:5}}};return WPGMZA.settings.carousel_lazyload&&(options.lazyLoad=!0),WPGMZA.settings.carouselAutoplay&&!isNaN(WPGMZA.settings.carouselAutoplay)&&(options.autoplayTimeout=parseInt(WPGMZA.settings.carouselAutoplay)),WPGMZA.settings.carousel_autoheight&&(options.autoHeight=!0),WPGMZA.settings.carousel_pagination&&(options.dots=!0),WPGMZA.settings.carousel_navigation&&(options.nav=!0),WPGMZA.settings.carousel_items&&!isNaN(WPGMZA.settings.carousel_items)&&(options.responsive[800].items=parseInt(WPGMZA.settings.carousel_items)),WPGMZA.settings.carousel_items_tablet&&!isNaN(WPGMZA.settings.carousel_items_tablet)&&(options.responsive[500].items=parseInt(WPGMZA.settings.carousel_items_tablet)),WPGMZA.settings.carousel_items_mobile&&!isNaN(WPGMZA.settings.carousel_items_mobile)&&(options.responsive[0].items=parseInt(WPGMZA.settings.carousel_items_mobile)),options},WPGMZA.CarouselMarkerListing.prototype.getAJAXRequestParameters=function(params){return delete(params=WPGMZA.MarkerListing.prototype.getAJAXRequestParameters.call(this,params)).data.start,delete params.data.length,params},WPGMZA.CarouselMarkerListing.prototype.onHTMLResponse=function(html){WPGMZA.MarkerListing.prototype.onHTMLResponse.call(this,html),$(this.element).trigger("destroy.owl.carousel"),$(this.element).owlCarousel(this.getOwlCarouselOptions())}}),jQuery(function($){WPGMZA.ModernMarkerListing=function(map,element,options){var self=this,map_id=map.id,container=$("#wpgmza_map_"+map_id);container.attr("data-mashup-ids");WPGMZA.MarkerListing.apply(this,arguments),this.map=map,this.element=element,this.openButton=$('<div class="wpgmza-modern-marker-open-button wpgmza-modern-shadow wpgmza-modern-hover-opaque"><i class="fa fa-map-marker"></i> <i class="fa fa-list"></i></div>'),container.append(this.openButton),container.append(this.element),this.popoutPanel=new WPGMZA.PopoutPanel,this.popoutPanel.element=this.element,map.on("init",function(event){container.append(self.element),container.append(self.openButton)}),self.openButton.on("click",function(event){self.open(),$("#wpgmza_map_"+map_id+" .wpgmza-modern-store-locator").addClass("wpgmza_sl_offset")}),this.markerView=new WPGMZA.ModernMarkerListingMarkerView(map),this.markerView.parent=this,$(this.element).find(".wpgmza-close-container").on("click",function(event){self.close(),$("#wpgmza_map_"+self.map.id+" .wpgmza-modern-store-locator").removeClass("wpgmza_sl_offset")}),$(this.element).on("click","li",function(event){self.markerView.open($(event.currentTarget).attr("mid"))}),$(document.body).on("click",".wpgmza_sl_reset_button_"+map_id,function(event){$(self.element).find("li[mid]").show()}),$(document.body).on("filteringcomplete.wpgmza",function(event){event.map.id==self._mapID&&self.onFilteringComplete(event)})},WPGMZA.ModernMarkerListing.prototype=Object.create(WPGMZA.MarkerListing.prototype),WPGMZA.ModernMarkerListing.prototype.constructor=WPGMZA.ModernMarkerListing,WPGMZA.ModernMarkerListing.prototype.initPagination=function(){WPGMZA.MarkerListing.prototype.initPagination.apply(this,arguments),this.pageSize&&$(this.element).find("ul").after(this.paginationElement)},WPGMZA.ModernMarkerListing.prototype.onHTMLResponse=function(html){$(this.element).find("ul.wpgmza-modern-marker-listing-list-item-container").html(html)},WPGMZA.ModernMarkerListing.prototype.open=function(){this.popoutPanel.open()},WPGMZA.ModernMarkerListing.prototype.close=function(){this.popoutPanel.close()}}),jQuery(function($){WPGMZA.OLDirectionsRenderer=function(map){var self=this;WPGMZA.DirectionsRenderer.apply(this,arguments),this.panel=$("#directions_panel_"+map.id),this.panel.on("click",".wpgmza-directions-step",function(event){self.onStepClicked(event)})},WPGMZA.extend(WPGMZA.OLDirectionsRenderer,WPGMZA.DirectionsRenderer),WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_LEFT=0,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_RIGHT=1,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SHARP_LEFT=2,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SHARP_RIGHT=3,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SLIGHT_LEFT=4,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SLIGHT_RIGHT=5,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_STRAIGHT=6,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_ENTER_ROUNDABOUT=7,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_EXIT_ROUNDABOUT=8,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_U_TURN=9,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_GOAL=10,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_DEPART=11,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_KEEP_LEFT=12,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_KEEP_RIGHT=13,WPGMZA.OLDirectionsRenderer.instructionTypeToClassName=function(type){for(var name in WPGMZA.OLDirectionsRenderer)if(name.match(/^INSTRUCTION_TYPE_/)&&WPGMZA.OLDirectionsRenderer[name]==type)return"wpgmza-"+name.replace(/_/g,"-").toLowerCase()},WPGMZA.OLDirectionsRenderer.prototype.clear=function(){this.polyline&&(this.map.removePolyline(this.polyline),delete this.polyline),this.stepHighlightPolyline&&(this.map.removePolyline(this.stepHighlightPolyline),delete this.stepHighlightPolyline),this.panel.html("")},WPGMZA.OLDirectionsRenderer.prototype.setDirections=function(settings){var self=this,route=settings.routes[0],settings=window.polyline.decode(route.geometry),points=[];this.clear(),settings.forEach(function(arr){points.push({lat:arr[0],lng:arr[1]})});settings={linecolor:"#4285F4",linethickness:4,opacity:.8};this.map.settings.directions_route_stroke_color&&(settings.linecolor=this.map.settings.directions_route_stroke_color),this.map.settings.directions_route_stroke_weight&&(settings.linethickness=this.map.settings.directions_route_stroke_weight),this.map.settings.directions_route_stroke_opacity&&(settings.opacity=this.map.settings.directions_route_stroke_opacity),this.polyline=WPGMZA.Polyline.createInstance({polydata:points,strokeWeight:settings.linethickness,strokeOpacity:settings.opacity,strokeColor:settings.linecolor}),this.polyline.map=this.map,this.map.addPolyline(this.polyline),this.directionStartMarker&&this.map.removeMarker(this.directionStartMarker),this.directionEndMarker&&this.map.removeMarker(this.directionEndMarker),this.directionStartMarker=WPGMZA.Marker.createInstance({position:points[0],icon:this.map.settings.directions_route_origin_icon,retina:this.map.settings.directions_origin_retina,disableInfoWindow:!0}),this.directionStartMarker._icon.retina=this.directionStartMarker.retina,this.map.addMarker(this.directionStartMarker),this.directionEndMarker=WPGMZA.Marker.createInstance({position:points[points.length-1],icon:this.map.settings.directions_route_destination_icon,retina:this.map.settings.directions_destination_retina,disableInfoWindow:!0}),this.directionEndMarker._icon.retina=this.directionEndMarker.retina,this.map.addMarker(this.directionEndMarker);var steps=[];route.segments&&route.segments.forEach(function(segment){steps=steps.concat(segment.steps)}),steps.forEach(function(step){var div=$("<div class='wpgmza-directions-step'></div>");div[0].wpgmzaDirectionsStep=step,div.html(step.instruction),div.addClass(WPGMZA.OLDirectionsRenderer.instructionTypeToClassName(step.type)),self.panel.append(div)}),this.map.settings.directions_fit_bounds_to_route&&this.fitBoundsToRoute(points[0],points[points.length-1])},WPGMZA.OLDirectionsRenderer.prototype.onStepClicked=function(polyline){var step=polyline.currentTarget.wpgmzaDirectionsStep,bounds=new WPGMZA.LatLngBounds,polyline=step.way_points[0],endIndex=step.way_points[step.way_points.length-1];if(this.stepHighlightPolyline&&(this.map.removePolyline(this.stepHighlightPolyline),delete this.stepHighlightPolyline),polyline!=endIndex){for(var points=[],i=polyline;i<=endIndex;i++){var vertex=this.polyline.polydata[i];points.push(vertex),bounds.extend(vertex)}polyline={strokeColor:"#ff0000",strokeWeight:4,strokeOpacity:.8};this.map.settings.directions_route_stroke_weight&&(polyline.linethickness=this.map.settings.directions_route_stroke_weight),this.map.settings.directions_route_stroke_opacity&&(polyline.opacity=this.map.settings.directions_route_stroke_opacity);polyline=WPGMZA.Polyline.createInstance({polydata:points,settings:polyline});this.stepHighlightPolyline=polyline,this.map.addPolyline(this.stepHighlightPolyline),this.map.fitBounds(bounds),WPGMZA.animateScroll(this.map.element)}}}),jQuery(function($){WPGMZA.OLDirectionsService=function(map){WPGMZA.DirectionsService.apply(this,arguments),this.apiKey=WPGMZA.settings.open_route_service_key},WPGMZA.extend(WPGMZA.OLDirectionsService,WPGMZA.DirectionsService),WPGMZA.OLDirectionsService.prototype.geocodeWaypoints=function(waypoints,callback){var geocoder=WPGMZA.Geocoder.createInstance(),index=0,coordinates=[];!function geocodeNextWaypoint(){geocoder.geocode({address:waypoints[index]},function(results){results.length?coordinates.push([results[0].latLng.lng,results[0].latLng.lat]):coordinates.push(WPGMZA.DirectionsService.NOT_FOUND),++index==waypoints.length?callback(coordinates):geocodeNextWaypoint()})}()},WPGMZA.OLDirectionsService.prototype.route=function(request,callback){var profile,url,self=this,translated={};switch(request.travelMode){case WPGMZA.DirectionsService.WALKING:profile="foot-walking";break;case WPGMZA.DirectionsService.BICYCLING:profile="cycling-regular";break;case WPGMZA.DirectionsService.TRANSIT:console.warn("Public transport profile is not supported by OpenRouteService");default:profile="driving-car"}request.unitSystem===WPGMZA.Distance.KILOMETERS?translated.units="km":translated.units="mi",url="https://api.openrouteservice.org/v2/directions/"+profile;var waypoints=[request.origin];request.waypoints&&request.waypoints.forEach(function(obj){waypoints.push(obj.location)}),waypoints.push(request.destination),this.geocodeWaypoints(waypoints,function(coordinates){for(var i=0;i<coordinates.length;i++)if(coordinates[i]==WPGMZA.DirectionsService.NOT_FOUND){for(var response={geocoded_waypoints:[]},i=0;i<waypoints.length;i++)response.geocoded_waypoints.push({geocoder_status:coordinates[i]});return void callback(response,WPGMZA.DirectionsService.NOT_FOUND)}switch(translated.coordinates=coordinates,WPGMZA.locale.substr(0,2)){case"de":case"en":case"pt":case"ru":case"hu":case"fr":case"it":case"cn":case"dk":case"de":translated.language=WPGMZA.locale.substr(0,2)}$.ajax(url,{method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(translated),beforeSend:function(xhr){xhr.setRequestHeader("Authorization",self.apiKey)},success:function(response,event,xhr){event=response.routes&&0<response.routes.length?WPGMZA.DirectionsService.SUCCESS:WPGMZA.DirectionsService.ZERO_RESULTS,callback(response,event);event=new WPGMZA.Event({type:"directionsserviceresult",response:response,status:event});self.map.trigger(event)}})})}}),jQuery(function($){WPGMZA.OLHeatmap=function(settings){WPGMZA.Heatmap.call(this,settings),this._removeListenerBound=!1;settings=this.getOLHeatmapSettings();this.olHeatmap=new ol.layer.Heatmap(settings)},WPGMZA.OLHeatmap.prototype=Object.create(WPGMZA.Heatmap.prototype),WPGMZA.OLHeatmap.prototype.constructor=WPGMZA.OLHeatmap,WPGMZA.OLHeatmap.prototype.getOLHeatmapSettings=function(){var settings={source:this.getSource()};return this.opacity&&(settings.opacity=parseFloat(this.opacity)),this.radius&&(settings.radius=parseFloat(this.radius)),this.heatmap_opacity&&(settings.opacity=parseFloat(this.heatmap_opacity)),this.heatmap_radius&&(settings.radius=parseFloat(this.heatmap_radius)),this.gradient&&(settings.gradient=this.gradient),settings},WPGMZA.OLHeatmap.prototype.removeLayer=function(){this.olHeatmap&&(this.olHeatmap.getSource().dispose(),this.olHeatmap.renderer_&&this.olHeatmap.renderer_.dispose(),this.olHeatmap.setMap(null),this.olHeatmap.dispose(),delete this.olHeatmap)},WPGMZA.OLHeatmap.prototype.updateOLHeatmap=function(){var self=this;this.olHeatmap&&this.removeLayer();var settings=this.getOLHeatmapSettings();this.olHeatmap=new ol.layer.Heatmap(settings),this.map&&(this.olHeatmap.setMap(this.map.olMap),this._removeListenerBound||this.map.on("heatmapremoved",function(event){event.heatmap===self&&self.removeLayer()}))},WPGMZA.OLHeatmap.prototype.getSource=function(){for(var points=this.parseGeometry(this.dataset),len=points.length,features=[],i=0;i<len;i++)features.push(new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([parseFloat(points[i].lng),parseFloat(points[i].lat)]))}));return new ol.source.Vector({features:features})},WPGMZA.OLHeatmap.prototype.setDraggable=function(){},WPGMZA.OLHeatmap.prototype.update=function(){this.updateOLHeatmap()},WPGMZA.OLHeatmap.prototype.updateDatasetFromMarkers=function(){WPGMZA.Heatmap.prototype.updateDatasetFromMarkers.apply(this,arguments),this.updateOLHeatmap()}}),jQuery(function($){WPGMZA.OLProDrawingManager=function(){WPGMZA.ProDrawingManager.apply(this,arguments)},WPGMZA.extend(WPGMZA.OLProDrawingManager,WPGMZA.ProDrawingManager)}),jQuery(function($){WPGMZA.OLProInfoWindow=function(feature){WPGMZA.OLInfoWindow.call(this,feature);var self=this;$(this.element).on("click",function(event){self.feature.map.settings.close_infowindow_on_map_click&&(event.stopPropagation(),event.stopImmediatePropagation())})},WPGMZA.OLProInfoWindow.prototype=Object.create(WPGMZA.OLInfoWindow.prototype),WPGMZA.OLProInfoWindow.prototype.constructor=WPGMZA.OLProInfoWindow,Object.defineProperty(WPGMZA.OLProInfoWindow.prototype,"panIntoViewOnOpen",{get:function(){return this.style==WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE}}),WPGMZA.OLProInfoWindow.prototype.open=function(map,feature){switch(this.feature=feature,"map-edit"==WPGMZA.currentPage?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:this.style){case WPGMZA.ProInfoWindow.STYLE_MODERN:case WPGMZA.ProInfoWindow.STYLE_MODERN_PLUS:case WPGMZA.ProInfoWindow.STYLE_MODERN_CIRCULAR:case WPGMZA.ProInfoWindow.STYLE_TEMPLATE:return WPGMZA.ProInfoWindow.prototype.open.call(this,map,feature);default:return WPGMZA.OLInfoWindow.prototype.open.call(this,map,feature)}},WPGMZA.OLProInfoWindow.prototype.setPosition=function(latLng){latLng=latLng.toLatLngLiteral();this.overlay.setPosition(ol.proj.fromLonLat([latLng.lng,latLng.lat]))}}),jQuery(function($){WPGMZA.OLProMap=function(element,options){WPGMZA.OLMap.call(this,element,options);this.loadKMLLayers(),this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded")},WPGMZA.OLProMap.prototype=Object.create(WPGMZA.OLMap.prototype),WPGMZA.OLProMap.prototype.constructor=WPGMZA.OLMap.prototype,WPGMZA.OLMap.prototype.addHeatmap=function(heatmap){heatmap.olHeatmap.setMap(this.olMap),WPGMZA.ProMap.prototype.addHeatmap.call(this,heatmap)},WPGMZA.OLProMap.prototype.loadKMLLayers=function(){if(this.kmlLayers)for(var i=0;i<this.kmlLayers.length;i++)this.olMap.removeLayer(this.kmlLayers[i]);if(this.kmlLayers=[],this.settings.kml)for(var urls=this.settings.kml.split(","),i=((new Date).getTime(),0);i<urls.length;i++){var layer=new ol.layer.Vector({source:new ol.source.Vector({url:urls[i],format:new ol.format.KML({extractAttributes:!0})})});this.kmlLayers.push(layer),this.olMap.addLayer(layer)}}}),jQuery(function($){WPGMZA.OLProMarker=function(row){WPGMZA.OLMarker.call(this,row)},WPGMZA.OLProMarker.prototype=Object.create(WPGMZA.OLMarker.prototype),WPGMZA.OLProMarker.prototype.constructor=WPGMZA.OLProMarker,WPGMZA.OLProMarker.prototype.updateIcon=function(){var self=this,icon=this._icon;WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?(icon.applyToElement($(this.element).find("img")),WPGMZA.getImageDimensions(icon.url,function(dimensions){self.updateElementHeight(dimensions.height)})):(this.vectorLayerStyle=new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:icon.url})}),this.feature.setStyle(this.vectorLayerStyle))}}),jQuery(function($){WPGMZA.OLProPolygon=function(row,olFeature){WPGMZA.OLPolygon.call(this,row,olFeature)},WPGMZA.OLProPolygon.prototype=Object.create(WPGMZA.OLPolygon.prototype),WPGMZA.OLProPolygon.prototype.constructor=WPGMZA.OLProPolygon});
;(function($, window, document, undefined){
function Owl(element, options){
this.settings=null;
this.options=$.extend({}, Owl.Defaults, options);
this.$element=$(element);
this._handlers={};
this._plugins={};
this._supress={};
this._current=null;
this._speed=null;
this._coordinates=[];
this._breakpoint=null;
this._width=null;
this._items=[];
this._clones=[];
this._mergers=[];
this._widths=[];
this._invalidated={};
this._pipe=[];
this._drag={
time: null,
target: null,
pointer: null,
stage: {
start: null,
current: null
},
direction: null
};
this._states={
current: {},
tags: {
'initializing': [ 'busy' ],
'animating': [ 'busy' ],
'dragging': [ 'interacting' ]
}};
$.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler){
this._handlers[handler]=$.proxy(this[handler], this);
}, this));
$.each(Owl.Plugins, $.proxy(function(key, plugin){
this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
= new plugin(this);
}, this));
$.each(Owl.Workers, $.proxy(function(priority, worker){
this._pipe.push({
'filter': worker.filter,
'run': $.proxy(worker.run, this)
});
}, this));
this.setup();
this.initialize();
}
Owl.Defaults={
items: 3,
loop: false,
center: false,
rewind: false,
checkVisibility: true,
mouseDrag: true,
touchDrag: true,
pullDrag: true,
freeDrag: false,
margin: 0,
stagePadding: 0,
merge: false,
mergeFit: true,
autoWidth: false,
startPosition: 0,
rtl: false,
smartSpeed: 250,
fluidSpeed: false,
dragEndSpeed: false,
responsive: {},
responsiveRefreshRate: 200,
responsiveBaseElement: window,
fallbackEasing: 'swing',
slideTransition: '',
info: false,
nestedItemSelector: false,
itemElement: 'div',
stageElement: 'div',
refreshClass: 'owl-refresh',
loadedClass: 'owl-loaded',
loadingClass: 'owl-loading',
rtlClass: 'owl-rtl',
responsiveClass: 'owl-responsive',
dragClass: 'owl-drag',
itemClass: 'owl-item',
stageClass: 'owl-stage',
stageOuterClass: 'owl-stage-outer',
grabClass: 'owl-grab'
};
Owl.Width={
Default: 'default',
Inner: 'inner',
Outer: 'outer'
};
Owl.Type={
Event: 'event',
State: 'state'
};
Owl.Plugins={};
Owl.Workers=[ {
filter: [ 'width', 'settings' ],
run: function(){
this._width=this.$element.width();
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
cache.current=this._items&&this._items[this.relative(this._current)];
}}, {
filter: [ 'items', 'settings' ],
run: function(){
this.$stage.children('.cloned').remove();
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
var margin=this.settings.margin||'',
grid = !this.settings.autoWidth,
rtl=this.settings.rtl,
css={
'width': 'auto',
'margin-left': rtl ? margin:'',
'margin-right': rtl ? '':margin
};
!grid&&this.$stage.children().css(css);
cache.css=css;
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
var width=(this.width() / this.settings.items).toFixed(3) - this.settings.margin,
merge=null,
iterator=this._items.length,
grid = !this.settings.autoWidth,
widths=[];
cache.items={
merge: false,
width: width
};
while (iterator--){
merge=this._mergers[iterator];
merge=this.settings.mergeFit&&Math.min(merge, this.settings.items)||merge;
cache.items.merge=merge > 1||cache.items.merge;
widths[iterator] = !grid ? this._items[iterator].width():width * merge;
}
this._widths=widths;
}}, {
filter: [ 'items', 'settings' ],
run: function(){
var clones=[],
items=this._items,
settings=this.settings,
view=Math.max(settings.items * 2, 4),
size=Math.ceil(items.length / 2) * 2,
repeat=settings.loop&&items.length ? settings.rewind ? view:Math.max(view, size):0,
append='',
prepend='';
repeat /=2;
while (repeat > 0){
clones.push(this.normalize(clones.length / 2, true));
append=append + items[clones[clones.length - 1]][0].outerHTML;
clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
prepend=items[clones[clones.length - 1]][0].outerHTML + prepend;
repeat -=1;
}
this._clones=clones;
$(append).addClass('cloned').appendTo(this.$stage);
$(prepend).addClass('cloned').prependTo(this.$stage);
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(){
var rtl=this.settings.rtl ? 1:-1,
size=this._clones.length + this._items.length,
iterator=-1,
previous=0,
current=0,
coordinates=[];
while (++iterator < size){
previous=coordinates[iterator - 1]||0;
current=this._widths[this.relative(iterator)] + this.settings.margin;
coordinates.push(previous + current * rtl);
}
this._coordinates=coordinates;
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(){
var padding=this.settings.stagePadding,
coordinates=this._coordinates,
css={
'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
'padding-left': padding||'',
'padding-right': padding||''
};
this.$stage.css(css);
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
var iterator=this._coordinates.length,
grid = !this.settings.autoWidth,
items=this.$stage.children();
if(grid&&cache.items.merge){
while (iterator--){
cache.css.width=this._widths[this.relative(iterator)];
items.eq(iterator).css(cache.css);
}}else if(grid){
cache.css.width=cache.items.width;
items.css(cache.css);
}}
}, {
filter: [ 'items' ],
run: function(){
this._coordinates.length < 1&&this.$stage.removeAttr('style');
}}, {
filter: [ 'width', 'items', 'settings' ],
run: function(cache){
cache.current=cache.current ? this.$stage.children().index(cache.current):0;
cache.current=Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
this.reset(cache.current);
}}, {
filter: [ 'position' ],
run: function(){
this.animate(this.coordinates(this._current));
}}, {
filter: [ 'width', 'position', 'items', 'settings' ],
run: function(){
var rtl=this.settings.rtl ? 1:-1,
padding=this.settings.stagePadding * 2,
begin=this.coordinates(this.current()) + padding,
end=begin + this.width() * rtl,
inner, outer, matches=[], i, n;
for (i=0, n=this._coordinates.length; i < n; i++){
inner=this._coordinates[i - 1]||0;
outer=Math.abs(this._coordinates[i]) + padding * rtl;
if((this.op(inner, '<=', begin)&&(this.op(inner, '>', end)))
|| (this.op(outer, '<', begin)&&this.op(outer, '>', end))){
matches.push(i);
}}
this.$stage.children('.active').removeClass('active');
this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
this.$stage.children('.center').removeClass('center');
if(this.settings.center){
this.$stage.children().eq(this.current()).addClass('center');
}}
} ];
Owl.prototype.initializeStage=function(){
this.$stage=this.$element.find('.' + this.settings.stageClass);
if(this.$stage.length){
return;
}
this.$element.addClass(this.options.loadingClass);
this.$stage=$('<' + this.settings.stageElement + '>', {
"class": this.settings.stageClass
}).wrap($('<div/>', {
"class": this.settings.stageOuterClass
}));
this.$element.append(this.$stage.parent());
};
Owl.prototype.initializeItems=function(){
var $items=this.$element.find('.owl-item');
if($items.length){
this._items=$items.get().map(function(item){
return $(item);
});
this._mergers=this._items.map(function(){
return 1;
});
this.refresh();
return;
}
this.replace(this.$element.children().not(this.$stage.parent()));
if(this.isVisible()){
this.refresh();
}else{
this.invalidate('width');
}
this.$element
.removeClass(this.options.loadingClass)
.addClass(this.options.loadedClass);
};
Owl.prototype.initialize=function(){
this.enter('initializing');
this.trigger('initialize');
this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
if(this.settings.autoWidth&&!this.is('pre-loading')){
var imgs, nestedSelector, width;
imgs=this.$element.find('img');
nestedSelector=this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector:undefined;
width=this.$element.children(nestedSelector).width();
if(imgs.length&&width <=0){
this.preloadAutoWidthImages(imgs);
}}
this.initializeStage();
this.initializeItems();
this.registerEventHandlers();
this.leave('initializing');
this.trigger('initialized');
};
Owl.prototype.isVisible=function(){
return this.settings.checkVisibility
? this.$element.is(':visible')
: true;
};
Owl.prototype.setup=function(){
var viewport=this.viewport(),
overwrites=this.options.responsive,
match=-1,
settings=null;
if(!overwrites){
settings=$.extend({}, this.options);
}else{
$.each(overwrites, function(breakpoint){
if(breakpoint <=viewport&&breakpoint > match){
match=Number(breakpoint);
}});
settings=$.extend({}, this.options, overwrites[match]);
if(typeof settings.stagePadding==='function'){
settings.stagePadding=settings.stagePadding();
}
delete settings.responsive;
if(settings.responsiveClass){
this.$element.attr('class',
this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
);
}}
this.trigger('change', { property: { name: 'settings', value: settings }});
this._breakpoint=match;
this.settings=settings;
this.invalidate('settings');
this.trigger('changed', { property: { name: 'settings', value: this.settings }});
};
Owl.prototype.optionsLogic=function(){
if(this.settings.autoWidth){
this.settings.stagePadding=false;
this.settings.merge=false;
}};
Owl.prototype.prepare=function(item){
var event=this.trigger('prepare', { content: item });
if(!event.data){
event.data=$('<' + this.settings.itemElement + '/>')
.addClass(this.options.itemClass).append(item)
}
this.trigger('prepared', { content: event.data });
return event.data;
};
Owl.prototype.update=function(){
var i=0,
n=this._pipe.length,
filter=$.proxy(function(p){ return this[p] }, this._invalidated),
cache={};
while (i < n){
if(this._invalidated.all||$.grep(this._pipe[i].filter, filter).length > 0){
this._pipe[i].run(cache);
}
i++;
}
this._invalidated={};
!this.is('valid')&&this.enter('valid');
};
Owl.prototype.width=function(dimension){
dimension=dimension||Owl.Width.Default;
switch (dimension){
case Owl.Width.Inner:
case Owl.Width.Outer:
return this._width;
default:
return this._width - this.settings.stagePadding * 2 + this.settings.margin;
}};
Owl.prototype.refresh=function(){
this.enter('refreshing');
this.trigger('refresh');
this.setup();
this.optionsLogic();
this.$element.addClass(this.options.refreshClass);
this.update();
this.$element.removeClass(this.options.refreshClass);
this.leave('refreshing');
this.trigger('refreshed');
};
Owl.prototype.onThrottledResize=function(){
window.clearTimeout(this.resizeTimer);
this.resizeTimer=window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
};
Owl.prototype.onResize=function(){
if(!this._items.length){
return false;
}
if(this._width===this.$element.width()){
return false;
}
if(!this.isVisible()){
return false;
}
this.enter('resizing');
if(this.trigger('resize').isDefaultPrevented()){
this.leave('resizing');
return false;
}
this.invalidate('width');
this.refresh();
this.leave('resizing');
this.trigger('resized');
};
Owl.prototype.registerEventHandlers=function(){
if($.support.transition){
this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
}
if(this.settings.responsive!==false){
this.on(window, 'resize', this._handlers.onThrottledResize);
}
if(this.settings.mouseDrag){
this.$element.addClass(this.options.dragClass);
this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
this.$stage.on('dragstart.owl.core selectstart.owl.core', function(){ return false });
}
if(this.settings.touchDrag){
this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
}};
Owl.prototype.onDragStart=function(event){
var stage=null;
if(event.which===3){
return;
}
if($.support.transform){
stage=this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
stage={
x: stage[stage.length===16 ? 12:4],
y: stage[stage.length===16 ? 13:5]
};}else{
stage=this.$stage.position();
stage={
x: this.settings.rtl ?
stage.left + this.$stage.width() - this.width() + this.settings.margin :
stage.left,
y: stage.top
};}
if(this.is('animating')){
$.support.transform ? this.animate(stage.x):this.$stage.stop()
this.invalidate('position');
}
this.$element.toggleClass(this.options.grabClass, event.type==='mousedown');
this.speed(0);
this._drag.time=new Date().getTime();
this._drag.target=$(event.target);
this._drag.stage.start=stage;
this._drag.stage.current=stage;
this._drag.pointer=this.pointer(event);
$(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
$(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event){
var delta=this.difference(this._drag.pointer, this.pointer(event));
$(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
if(Math.abs(delta.x) < Math.abs(delta.y)&&this.is('valid')){
return;
}
event.preventDefault();
this.enter('dragging');
this.trigger('drag');
}, this));
};
Owl.prototype.onDragMove=function(event){
var minimum=null,
maximum=null,
pull=null,
delta=this.difference(this._drag.pointer, this.pointer(event)),
stage=this.difference(this._drag.stage.start, delta);
if(!this.is('dragging')){
return;
}
event.preventDefault();
if(this.settings.loop){
minimum=this.coordinates(this.minimum());
maximum=this.coordinates(this.maximum() + 1) - minimum;
stage.x=(((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
}else{
minimum=this.settings.rtl ? this.coordinates(this.maximum()):this.coordinates(this.minimum());
maximum=this.settings.rtl ? this.coordinates(this.minimum()):this.coordinates(this.maximum());
pull=this.settings.pullDrag ? -1 * delta.x / 5:0;
stage.x=Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
}
this._drag.stage.current=stage;
this.animate(stage.x);
};
Owl.prototype.onDragEnd=function(event){
var delta=this.difference(this._drag.pointer, this.pointer(event)),
stage=this._drag.stage.current,
direction=delta.x > 0 ^ this.settings.rtl ? 'left':'right';
$(document).off('.owl.core');
this.$element.removeClass(this.options.grabClass);
if(delta.x!==0&&this.is('dragging')||!this.is('valid')){
this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed);
this.current(this.closest(stage.x, delta.x!==0 ? direction:this._drag.direction));
this.invalidate('position');
this.update();
this._drag.direction=direction;
if(Math.abs(delta.x) > 3||new Date().getTime() - this._drag.time > 300){
this._drag.target.one('click.owl.core', function(){ return false; });
}}
if(!this.is('dragging')){
return;
}
this.leave('dragging');
this.trigger('dragged');
};
Owl.prototype.closest=function(coordinate, direction){
var position=-1,
pull=30,
width=this.width(),
coordinates=this.coordinates();
if(!this.settings.freeDrag){
$.each(coordinates, $.proxy(function(index, value){
if(direction==='left'&&coordinate > value - pull&&coordinate < value + pull){
position=index;
}else if(direction==='right'&&coordinate > value - width - pull&&coordinate < value - width + pull){
position=index + 1;
}else if(this.op(coordinate, '<', value)
&& this.op(coordinate, '>', coordinates[index + 1]!==undefined ? coordinates[index + 1]:value - width)){
position=direction==='left' ? index + 1:index;
}
return position===-1;
}, this));
}
if(!this.settings.loop){
if(this.op(coordinate, '>', coordinates[this.minimum()])){
position=coordinate=this.minimum();
}else if(this.op(coordinate, '<', coordinates[this.maximum()])){
position=coordinate=this.maximum();
}}
return position;
};
Owl.prototype.animate=function(coordinate){
var animate=this.speed() > 0;
this.is('animating')&&this.onTransitionEnd();
if(animate){
this.enter('animating');
this.trigger('translate');
}
if($.support.transform3d&&$.support.transition){
this.$stage.css({
transform: 'translate3d(' + coordinate + 'px,0px,0px)',
transition: (this.speed() / 1000) + 's' + (
this.settings.slideTransition ? ' ' + this.settings.slideTransition:''
)
});
}else if(animate){
this.$stage.animate({
left: coordinate + 'px'
}, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
}else{
this.$stage.css({
left: coordinate + 'px'
});
}};
Owl.prototype.is=function(state){
return this._states.current[state]&&this._states.current[state] > 0;
};
Owl.prototype.current=function(position){
if(position===undefined){
return this._current;
}
if(this._items.length===0){
return undefined;
}
position=this.normalize(position);
if(this._current!==position){
var event=this.trigger('change', { property: { name: 'position', value: position }});
if(event.data!==undefined){
position=this.normalize(event.data);
}
this._current=position;
this.invalidate('position');
this.trigger('changed', { property: { name: 'position', value: this._current }});
}
return this._current;
};
Owl.prototype.invalidate=function(part){
if($.type(part)==='string'){
this._invalidated[part]=true;
this.is('valid')&&this.leave('valid');
}
return $.map(this._invalidated, function(v, i){ return i });
};
Owl.prototype.reset=function(position){
position=this.normalize(position);
if(position===undefined){
return;
}
this._speed=0;
this._current=position;
this.suppress([ 'translate', 'translated' ]);
this.animate(this.coordinates(position));
this.release([ 'translate', 'translated' ]);
};
Owl.prototype.normalize=function(position, relative){
var n=this._items.length,
m=relative ? 0:this._clones.length;
if(!this.isNumeric(position)||n < 1){
position=undefined;
}else if(position < 0||position >=n + m){
position=((position - m / 2) % n + n) % n + m / 2;
}
return position;
};
Owl.prototype.relative=function(position){
position -=this._clones.length / 2;
return this.normalize(position, true);
};
Owl.prototype.maximum=function(relative){
var settings=this.settings,
maximum=this._coordinates.length,
iterator,
reciprocalItemsWidth,
elementWidth;
if(settings.loop){
maximum=this._clones.length / 2 + this._items.length - 1;
}else if(settings.autoWidth||settings.merge){
iterator=this._items.length;
if(iterator){
reciprocalItemsWidth=this._items[--iterator].width();
elementWidth=this.$element.width();
while (iterator--){
reciprocalItemsWidth +=this._items[iterator].width() + this.settings.margin;
if(reciprocalItemsWidth > elementWidth){
break;
}}
}
maximum=iterator + 1;
}else if(settings.center){
maximum=this._items.length - 1;
}else{
maximum=this._items.length - settings.items;
}
if(relative){
maximum -=this._clones.length / 2;
}
return Math.max(maximum, 0);
};
Owl.prototype.minimum=function(relative){
return relative ? 0:this._clones.length / 2;
};
Owl.prototype.items=function(position){
if(position===undefined){
return this._items.slice();
}
position=this.normalize(position, true);
return this._items[position];
};
Owl.prototype.mergers=function(position){
if(position===undefined){
return this._mergers.slice();
}
position=this.normalize(position, true);
return this._mergers[position];
};
Owl.prototype.clones=function(position){
var odd=this._clones.length / 2,
even=odd + this._items.length,
map=function(index){ return index % 2===0 ? even + index / 2:odd - (index + 1) / 2 };
if(position===undefined){
return $.map(this._clones, function(v, i){ return map(i) });
}
return $.map(this._clones, function(v, i){ return v===position ? map(i):null });
};
Owl.prototype.speed=function(speed){
if(speed!==undefined){
this._speed=speed;
}
return this._speed;
};
Owl.prototype.coordinates=function(position){
var multiplier=1,
newPosition=position - 1,
coordinate;
if(position===undefined){
return $.map(this._coordinates, $.proxy(function(coordinate, index){
return this.coordinates(index);
}, this));
}
if(this.settings.center){
if(this.settings.rtl){
multiplier=-1;
newPosition=position + 1;
}
coordinate=this._coordinates[position];
coordinate +=(this.width() - coordinate + (this._coordinates[newPosition]||0)) / 2 * multiplier;
}else{
coordinate=this._coordinates[newPosition]||0;
}
coordinate=Math.ceil(coordinate);
return coordinate;
};
Owl.prototype.duration=function(from, to, factor){
if(factor===0){
return 0;
}
return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor||this.settings.smartSpeed));
};
Owl.prototype.to=function(position, speed){
var current=this.current(),
revert=null,
distance=position - this.relative(current),
direction=(distance > 0) - (distance < 0),
items=this._items.length,
minimum=this.minimum(),
maximum=this.maximum();
if(this.settings.loop){
if(!this.settings.rewind&&Math.abs(distance) > items / 2){
distance +=direction * -1 * items;
}
position=current + distance;
revert=((position - minimum) % items + items) % items + minimum;
if(revert!==position&&revert - distance <=maximum&&revert - distance > 0){
current=revert - distance;
position=revert;
this.reset(current);
}}else if(this.settings.rewind){
maximum +=1;
position=(position % maximum + maximum) % maximum;
}else{
position=Math.max(minimum, Math.min(maximum, position));
}
this.speed(this.duration(current, position, speed));
this.current(position);
if(this.isVisible()){
this.update();
}};
Owl.prototype.next=function(speed){
speed=speed||false;
this.to(this.relative(this.current()) + 1, speed);
};
Owl.prototype.prev=function(speed){
speed=speed||false;
this.to(this.relative(this.current()) - 1, speed);
};
Owl.prototype.onTransitionEnd=function(event){
if(event!==undefined){
event.stopPropagation();
if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){
return false;
}}
this.leave('animating');
this.trigger('translated');
};
Owl.prototype.viewport=function(){
var width;
if(this.options.responsiveBaseElement!==window){
width=$(this.options.responsiveBaseElement).width();
}else if(window.innerWidth){
width=window.innerWidth;
}else if(document.documentElement&&document.documentElement.clientWidth){
width=document.documentElement.clientWidth;
}else{
console.warn('Can not detect viewport width.');
}
return width;
};
Owl.prototype.replace=function(content){
this.$stage.empty();
this._items=[];
if(content){
content=(content instanceof jQuery) ? content:$(content);
}
if(this.settings.nestedItemSelector){
content=content.find('.' + this.settings.nestedItemSelector);
}
content.filter(function(){
return this.nodeType===1;
}).each($.proxy(function(index, item){
item=this.prepare(item);
this.$stage.append(item);
this._items.push(item);
this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1);
}, this));
this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition:0);
this.invalidate('items');
};
Owl.prototype.add=function(content, position){
var current=this.relative(this._current);
position=position===undefined ? this._items.length:this.normalize(position, true);
content=content instanceof jQuery ? content:$(content);
this.trigger('add', { content: content, position: position });
content=this.prepare(content);
if(this._items.length===0||position===this._items.length){
this._items.length===0&&this.$stage.append(content);
this._items.length!==0&&this._items[position - 1].after(content);
this._items.push(content);
this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1);
}else{
this._items[position].before(content);
this._items.splice(position, 0, content);
this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1||1);
}
this._items[current]&&this.reset(this._items[current].index());
this.invalidate('items');
this.trigger('added', { content: content, position: position });
};
Owl.prototype.remove=function(position){
position=this.normalize(position, true);
if(position===undefined){
return;
}
this.trigger('remove', { content: this._items[position], position: position });
this._items[position].remove();
this._items.splice(position, 1);
this._mergers.splice(position, 1);
this.invalidate('items');
this.trigger('removed', { content: null, position: position });
};
Owl.prototype.preloadAutoWidthImages=function(images){
images.each($.proxy(function(i, element){
this.enter('pre-loading');
element=$(element);
$(new Image()).one('load', $.proxy(function(e){
element.attr('src', e.target.src);
element.css('opacity', 1);
this.leave('pre-loading');
!this.is('pre-loading')&&!this.is('initializing')&&this.refresh();
}, this)).attr('src', element.attr('src')||element.attr('data-src')||element.attr('data-src-retina'));
}, this));
};
Owl.prototype.destroy=function(){
this.$element.off('.owl.core');
this.$stage.off('.owl.core');
$(document).off('.owl.core');
if(this.settings.responsive!==false){
window.clearTimeout(this.resizeTimer);
this.off(window, 'resize', this._handlers.onThrottledResize);
}
for (var i in this._plugins){
this._plugins[i].destroy();
}
this.$stage.children('.cloned').remove();
this.$stage.unwrap();
this.$stage.children().contents().unwrap();
this.$stage.children().unwrap();
this.$stage.remove();
this.$element
.removeClass(this.options.refreshClass)
.removeClass(this.options.loadingClass)
.removeClass(this.options.loadedClass)
.removeClass(this.options.rtlClass)
.removeClass(this.options.dragClass)
.removeClass(this.options.grabClass)
.attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
.removeData('owl.carousel');
};
Owl.prototype.op=function(a, o, b){
var rtl=this.settings.rtl;
switch (o){
case '<':
return rtl ? a > b:a < b;
case '>':
return rtl ? a < b:a > b;
case '>=':
return rtl ? a <=b:a >=b;
case '<=':
return rtl ? a >=b:a <=b;
default:
break;
}};
Owl.prototype.on=function(element, event, listener, capture){
if(element.addEventListener){
element.addEventListener(event, listener, capture);
}else if(element.attachEvent){
element.attachEvent('on' + event, listener);
}};
Owl.prototype.off=function(element, event, listener, capture){
if(element.removeEventListener){
element.removeEventListener(event, listener, capture);
}else if(element.detachEvent){
element.detachEvent('on' + event, listener);
}};
Owl.prototype.trigger=function(name, data, namespace, state, enter){
var status={
item: { count: this._items.length, index: this.current() }}, handler=$.camelCase($.grep([ 'on', name, namespace ], function(v){ return v })
.join('-').toLowerCase()
), event=$.Event([ name, 'owl', namespace||'carousel' ].join('.').toLowerCase(),
$.extend({ relatedTarget: this }, status, data)
);
if(!this._supress[name]){
$.each(this._plugins, function(name, plugin){
if(plugin.onTrigger){
plugin.onTrigger(event);
}});
this.register({ type: Owl.Type.Event, name: name });
this.$element.trigger(event);
if(this.settings&&typeof this.settings[handler]==='function'){
this.settings[handler].call(this, event);
}}
return event;
};
Owl.prototype.enter=function(name){
$.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){
if(this._states.current[name]===undefined){
this._states.current[name]=0;
}
this._states.current[name]++;
}, this));
};
Owl.prototype.leave=function(name){
$.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){
this._states.current[name]--;
}, this));
};
Owl.prototype.register=function(object){
if(object.type===Owl.Type.Event){
if(!$.event.special[object.name]){
$.event.special[object.name]={};}
if(!$.event.special[object.name].owl){
var _default=$.event.special[object.name]._default;
$.event.special[object.name]._default=function(e){
if(_default&&_default.apply&&(!e.namespace||e.namespace.indexOf('owl')===-1)){
return _default.apply(this, arguments);
}
return e.namespace&&e.namespace.indexOf('owl') > -1;
};
$.event.special[object.name].owl=true;
}}else if(object.type===Owl.Type.State){
if(!this._states.tags[object.name]){
this._states.tags[object.name]=object.tags;
}else{
this._states.tags[object.name]=this._states.tags[object.name].concat(object.tags);
}
this._states.tags[object.name]=$.grep(this._states.tags[object.name], $.proxy(function(tag, i){
return $.inArray(tag, this._states.tags[object.name])===i;
}, this));
}};
Owl.prototype.suppress=function(events){
$.each(events, $.proxy(function(index, event){
this._supress[event]=true;
}, this));
};
Owl.prototype.release=function(events){
$.each(events, $.proxy(function(index, event){
delete this._supress[event];
}, this));
};
Owl.prototype.pointer=function(event){
var result={ x: null, y: null };
event=event.originalEvent||event||window.event;
event=event.touches&&event.touches.length ?
event.touches[0]:event.changedTouches&&event.changedTouches.length ?
event.changedTouches[0]:event;
if(event.pageX){
result.x=event.pageX;
result.y=event.pageY;
}else{
result.x=event.clientX;
result.y=event.clientY;
}
return result;
};
Owl.prototype.isNumeric=function(number){
return !isNaN(parseFloat(number));
};
Owl.prototype.difference=function(first, second){
return {
x: first.x - second.x,
y: first.y - second.y
};};
$.fn.owlCarousel=function(option){
var args=Array.prototype.slice.call(arguments, 1);
return this.each(function(){
var $this=$(this),
data=$this.data('owl.carousel');
if(!data){
data=new Owl(this, typeof option=='object'&&option);
$this.data('owl.carousel', data);
$.each([
'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
], function(i, event){
data.register({ type: Owl.Type.Event, name: event });
data.$element.on(event + '.owl.carousel.core', $.proxy(function(e){
if(e.namespace&&e.relatedTarget!==this){
this.suppress([ event ]);
data[event].apply(this, [].slice.call(arguments, 1));
this.release([ event ]);
}}, data));
});
}
if(typeof option=='string'&&option.charAt(0)!=='_'){
data[option].apply(data, args);
}});
};
$.fn.owlCarousel.Constructor=Owl;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var AutoRefresh=function(carousel){
this._core=carousel;
this._interval=null;
this._visible=null;
this._handlers={
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoRefresh){
this.watch();
}}, this)
};
this._core.options=$.extend({}, AutoRefresh.Defaults, this._core.options);
this._core.$element.on(this._handlers);
};
AutoRefresh.Defaults={
autoRefresh: true,
autoRefreshInterval: 500
};
AutoRefresh.prototype.watch=function(){
if(this._interval){
return;
}
this._visible=this._core.isVisible();
this._interval=window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
};
AutoRefresh.prototype.refresh=function(){
if(this._core.isVisible()===this._visible){
return;
}
this._visible = !this._visible;
this._core.$element.toggleClass('owl-hidden', !this._visible);
this._visible&&(this._core.invalidate('width')&&this._core.refresh());
};
AutoRefresh.prototype.destroy=function(){
var handler, property;
window.clearInterval(this._interval);
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.AutoRefresh=AutoRefresh;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Lazy=function(carousel){
this._core=carousel;
this._loaded=[];
this._handlers={
'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e){
if(!e.namespace){
return;
}
if(!this._core.settings||!this._core.settings.lazyLoad){
return;
}
if((e.property&&e.property.name=='position')||e.type=='initialized'){
var settings=this._core.settings,
n=(settings.center&&Math.ceil(settings.items / 2)||settings.items),
i=((settings.center&&n * -1)||0),
position=(e.property&&e.property.value!==undefined ? e.property.value:this._core.current()) + i,
clones=this._core.clones().length,
load=$.proxy(function(i, v){ this.load(v) }, this);
if(settings.lazyLoadEager > 0){
n +=settings.lazyLoadEager;
if(settings.loop){
position -=settings.lazyLoadEager;
n++;
}}
while (i++ < n){
this.load(clones / 2 + this._core.relative(position));
clones&&$.each(this._core.clones(this._core.relative(position)), load);
position++;
}}
}, this)
};
this._core.options=$.extend({}, Lazy.Defaults, this._core.options);
this._core.$element.on(this._handlers);
};
Lazy.Defaults={
lazyLoad: false,
lazyLoadEager: 0
};
Lazy.prototype.load=function(position){
var $item=this._core.$stage.children().eq(position),
$elements=$item&&$item.find('.owl-lazy');
if(!$elements||$.inArray($item.get(0), this._loaded) > -1){
return;
}
$elements.each($.proxy(function(index, element){
var $element=$(element), image,
url=(window.devicePixelRatio > 1&&$element.attr('data-src-retina'))||$element.attr('data-src')||$element.attr('data-srcset');
this._core.trigger('load', { element: $element, url: url }, 'lazy');
if($element.is('img')){
$element.one('load.owl.lazy', $.proxy(function(){
$element.css('opacity', 1);
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
}, this)).attr('src', url);
}else if($element.is('source')){
$element.one('load.owl.lazy', $.proxy(function(){
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
}, this)).attr('srcset', url);
}else{
image=new Image();
image.onload=$.proxy(function(){
$element.css({
'background-image': 'url("' + url + '")',
'opacity': '1'
});
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
}, this);
image.src=url;
}}, this));
this._loaded.push($item.get(0));
};
Lazy.prototype.destroy=function(){
var handler, property;
for (handler in this.handlers){
this._core.$element.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Lazy=Lazy;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var AutoHeight=function(carousel){
this._core=carousel;
this._previousHeight=null;
this._handlers={
'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoHeight){
this.update();
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoHeight&&e.property.name==='position'){
this.update();
}}, this),
'loaded.owl.lazy': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoHeight
&& e.element.closest('.' + this._core.settings.itemClass).index()===this._core.current()){
this.update();
}}, this)
};
this._core.options=$.extend({}, AutoHeight.Defaults, this._core.options);
this._core.$element.on(this._handlers);
this._intervalId=null;
var refThis=this;
$(window).on('load', function(){
if(refThis._core.settings.autoHeight){
refThis.update();
}});
$(window).resize(function(){
if(refThis._core.settings.autoHeight){
if(refThis._intervalId!=null){
clearTimeout(refThis._intervalId);
}
refThis._intervalId=setTimeout(function(){
refThis.update();
}, 250);
}});
};
AutoHeight.Defaults={
autoHeight: false,
autoHeightClass: 'owl-height'
};
AutoHeight.prototype.update=function(){
var start=this._core._current,
end=start + this._core.settings.items,
lazyLoadEnabled=this._core.settings.lazyLoad,
visible=this._core.$stage.children().toArray().slice(start, end),
heights=[],
maxheight=0;
$.each(visible, function(index, item){
heights.push($(item).height());
});
maxheight=Math.max.apply(null, heights);
if(maxheight <=1&&lazyLoadEnabled&&this._previousHeight){
maxheight=this._previousHeight;
}
this._previousHeight=maxheight;
this._core.$stage.parent()
.height(maxheight)
.addClass(this._core.settings.autoHeightClass);
};
AutoHeight.prototype.destroy=function(){
var handler, property;
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!=='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.AutoHeight=AutoHeight;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Video=function(carousel){
this._core=carousel;
this._videos={};
this._playing=null;
this._handlers={
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace){
this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
}}, this),
'resize.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.video&&this.isInFullScreen()){
e.preventDefault();
}}, this),
'refreshed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.is('resizing')){
this._core.$stage.find('.cloned .owl-video-frame').remove();
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name==='position'&&this._playing){
this.stop();
}}, this),
'prepared.owl.carousel': $.proxy(function(e){
if(!e.namespace){
return;
}
var $element=$(e.content).find('.owl-video');
if($element.length){
$element.css('display', 'none');
this.fetch($element, $(e.content));
}}, this)
};
this._core.options=$.extend({}, Video.Defaults, this._core.options);
this._core.$element.on(this._handlers);
this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e){
this.play(e);
}, this));
};
Video.Defaults={
video: false,
videoHeight: false,
videoWidth: false
};
Video.prototype.fetch=function(target, item){
var type=(function(){
if(target.attr('data-vimeo-id')){
return 'vimeo';
}else if(target.attr('data-vzaar-id')){
return 'vzaar'
}else{
return 'youtube';
}})(),
id=target.attr('data-vimeo-id')||target.attr('data-youtube-id')||target.attr('data-vzaar-id'),
width=target.attr('data-width')||this._core.settings.videoWidth,
height=target.attr('data-height')||this._core.settings.videoHeight,
url=target.attr('href');
if(url){
id=url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
if(id[3].indexOf('youtu') > -1){
type='youtube';
}else if(id[3].indexOf('vimeo') > -1){
type='vimeo';
}else if(id[3].indexOf('vzaar') > -1){
type='vzaar';
}else{
throw new Error('Video URL not supported.');
}
id=id[6];
}else{
throw new Error('Missing video URL.');
}
this._videos[url]={
type: type,
id: id,
width: width,
height: height
};
item.attr('data-video', url);
this.thumbnail(target, this._videos[url]);
};
Video.prototype.thumbnail=function(target, video){
var tnLink,
icon,
path,
dimensions=video.width&&video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;':'',
customTn=target.find('img'),
srcType='src',
lazyClass='',
settings=this._core.settings,
create=function(path){
icon='<div class="owl-video-play-icon"></div>';
if(settings.lazyLoad){
tnLink=$('<div/>',{
"class": 'owl-video-tn ' + lazyClass,
"srcType": path
});
}else{
tnLink=$('<div/>', {
"class": "owl-video-tn",
"style": 'opacity:1;background-image:url(' + path + ')'
});
}
target.after(tnLink);
target.after(icon);
};
target.wrap($('<div/>', {
"class": "owl-video-wrapper",
"style": dimensions
}));
if(this._core.settings.lazyLoad){
srcType='data-src';
lazyClass='owl-lazy';
}
if(customTn.length){
create(customTn.attr(srcType));
customTn.remove();
return false;
}
if(video.type==='youtube'){
path="//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
create(path);
}else if(video.type==='vimeo'){
$.ajax({
type: 'GET',
url: '//vimeo.com/api/v2/video/' + video.id + '.json',
jsonp: 'callback',
dataType: 'jsonp',
success: function(data){
path=data[0].thumbnail_large;
create(path);
}});
}else if(video.type==='vzaar'){
$.ajax({
type: 'GET',
url: '//vzaar.com/api/videos/' + video.id + '.json',
jsonp: 'callback',
dataType: 'jsonp',
success: function(data){
path=data.framegrab_url;
create(path);
}});
}};
Video.prototype.stop=function(){
this._core.trigger('stop', null, 'video');
this._playing.find('.owl-video-frame').remove();
this._playing.removeClass('owl-video-playing');
this._playing=null;
this._core.leave('playing');
this._core.trigger('stopped', null, 'video');
};
Video.prototype.play=function(event){
var target=$(event.target),
item=target.closest('.' + this._core.settings.itemClass),
video=this._videos[item.attr('data-video')],
width=video.width||'100%',
height=video.height||this._core.$stage.height(),
html,
iframe;
if(this._playing){
return;
}
this._core.enter('playing');
this._core.trigger('play', null, 'video');
item=this._core.items(this._core.relative(item.index()));
this._core.reset(item.index());
html=$('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>');
html.attr('height', height);
html.attr('width', width);
if(video.type==='youtube'){
html.attr('src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id);
}else if(video.type==='vimeo'){
html.attr('src', '//player.vimeo.com/video/' + video.id + '?autoplay=1');
}else if(video.type==='vzaar'){
html.attr('src', '//view.vzaar.com/' + video.id + '/player?autoplay=true');
}
iframe=$(html).wrap('<div class="owl-video-frame" />').insertAfter(item.find('.owl-video'));
this._playing=item.addClass('owl-video-playing');
};
Video.prototype.isInFullScreen=function(){
var element=document.fullscreenElement||document.mozFullScreenElement ||
document.webkitFullscreenElement;
return element&&$(element).parent().hasClass('owl-video-frame');
};
Video.prototype.destroy=function(){
var handler, property;
this._core.$element.off('click.owl.video');
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Video=Video;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Animate=function(scope){
this.core=scope;
this.core.options=$.extend({}, Animate.Defaults, this.core.options);
this.swapping=true;
this.previous=undefined;
this.next=undefined;
this.handlers={
'change.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name=='position'){
this.previous=this.core.current();
this.next=e.property.value;
}}, this),
'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e){
if(e.namespace){
this.swapping=e.type=='translated';
}}, this),
'translate.owl.carousel': $.proxy(function(e){
if(e.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){
this.swap();
}}, this)
};
this.core.$element.on(this.handlers);
};
Animate.Defaults={
animateOut: false,
animateIn: false
};
Animate.prototype.swap=function(){
if(this.core.settings.items!==1){
return;
}
if(!$.support.animation||!$.support.transition){
return;
}
this.core.speed(0);
var left,
clear=$.proxy(this.clear, this),
previous=this.core.$stage.children().eq(this.previous),
next=this.core.$stage.children().eq(this.next),
incoming=this.core.settings.animateIn,
outgoing=this.core.settings.animateOut;
if(this.core.current()===this.previous){
return;
}
if(outgoing){
left=this.core.coordinates(this.previous) - this.core.coordinates(this.next);
previous.one($.support.animation.end, clear)
.css({ 'left': left + 'px' })
.addClass('animated owl-animated-out')
.addClass(outgoing);
}
if(incoming){
next.one($.support.animation.end, clear)
.addClass('animated owl-animated-in')
.addClass(incoming);
}};
Animate.prototype.clear=function(e){
$(e.target).css({ 'left': '' })
.removeClass('animated owl-animated-out owl-animated-in')
.removeClass(this.core.settings.animateIn)
.removeClass(this.core.settings.animateOut);
this.core.onTransitionEnd();
};
Animate.prototype.destroy=function(){
var handler, property;
for (handler in this.handlers){
this.core.$element.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Animate=Animate;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Autoplay=function(carousel){
this._core=carousel;
this._call=null;
this._time=0;
this._timeout=0;
this._paused=true;
this._handlers={
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name==='settings'){
if(this._core.settings.autoplay){
this.play();
}else{
this.stop();
}}else if(e.namespace&&e.property.name==='position'&&this._paused){
this._time=0;
}}, this),
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.autoplay){
this.play();
}}, this),
'play.owl.autoplay': $.proxy(function(e, t, s){
if(e.namespace){
this.play(t, s);
}}, this),
'stop.owl.autoplay': $.proxy(function(e){
if(e.namespace){
this.stop();
}}, this),
'mouseover.owl.autoplay': $.proxy(function(){
if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){
this.pause();
}}, this),
'mouseleave.owl.autoplay': $.proxy(function(){
if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){
this.play();
}}, this),
'touchstart.owl.core': $.proxy(function(){
if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){
this.pause();
}}, this),
'touchend.owl.core': $.proxy(function(){
if(this._core.settings.autoplayHoverPause){
this.play();
}}, this)
};
this._core.$element.on(this._handlers);
this._core.options=$.extend({}, Autoplay.Defaults, this._core.options);
};
Autoplay.Defaults={
autoplay: false,
autoplayTimeout: 5000,
autoplayHoverPause: false,
autoplaySpeed: false
};
Autoplay.prototype._next=function(speed){
this._call=window.setTimeout($.proxy(this._next, this, speed),
this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
);
if(this._core.is('interacting')||document.hidden){
return;
}
this._core.next(speed||this._core.settings.autoplaySpeed);
}
Autoplay.prototype.read=function(){
return new Date().getTime() - this._time;
};
Autoplay.prototype.play=function(timeout, speed){
var elapsed;
if(!this._core.is('rotating')){
this._core.enter('rotating');
}
timeout=timeout||this._core.settings.autoplayTimeout;
elapsed=Math.min(this._time % (this._timeout||timeout), timeout);
if(this._paused){
this._time=this.read();
this._paused=false;
}else{
window.clearTimeout(this._call);
}
this._time +=this.read() % timeout - elapsed;
this._timeout=timeout;
this._call=window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
};
Autoplay.prototype.stop=function(){
if(this._core.is('rotating')){
this._time=0;
this._paused=true;
window.clearTimeout(this._call);
this._core.leave('rotating');
}};
Autoplay.prototype.pause=function(){
if(this._core.is('rotating')&&!this._paused){
this._time=this.read();
this._paused=true;
window.clearTimeout(this._call);
}};
Autoplay.prototype.destroy=function(){
var handler, property;
this.stop();
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
'use strict';
var Navigation=function(carousel){
this._core=carousel;
this._initialized=false;
this._pages=[];
this._controls={};
this._templates=[];
this.$element=this._core.$element;
this._overrides={
next: this._core.next,
prev: this._core.prev,
to: this._core.to
};
this._handlers={
'prepared.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.dotsData){
this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
}}, this),
'added.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.dotsData){
this._templates.splice(e.position, 0, this._templates.pop());
}}, this),
'remove.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.dotsData){
this._templates.splice(e.position, 1);
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name=='position'){
this.draw();
}}, this),
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&!this._initialized){
this._core.trigger('initialize', null, 'navigation');
this.initialize();
this.update();
this.draw();
this._initialized=true;
this._core.trigger('initialized', null, 'navigation');
}}, this),
'refreshed.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._initialized){
this._core.trigger('refresh', null, 'navigation');
this.update();
this.draw();
this._core.trigger('refreshed', null, 'navigation');
}}, this)
};
this._core.options=$.extend({}, Navigation.Defaults, this._core.options);
this.$element.on(this._handlers);
};
Navigation.Defaults={
nav: false,
navText: [
'<span aria-label="' + 'Previous' + '">&#x2039;</span>',
'<span aria-label="' + 'Next' + '">&#x203a;</span>'
],
navSpeed: false,
navElement: 'button type="button" role="presentation"',
navContainer: false,
navContainerClass: 'owl-nav',
navClass: [
'owl-prev',
'owl-next'
],
slideBy: 1,
dotClass: 'owl-dot',
dotsClass: 'owl-dots',
dots: true,
dotsEach: false,
dotsData: false,
dotsSpeed: false,
dotsContainer: false
};
Navigation.prototype.initialize=function(){
var override,
settings=this._core.settings;
this._controls.$relative=(settings.navContainer ? $(settings.navContainer)
: $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
this._controls.$previous=$('<' + settings.navElement + '>')
.addClass(settings.navClass[0])
.html(settings.navText[0])
.prependTo(this._controls.$relative)
.on('click', $.proxy(function(e){
this.prev(settings.navSpeed);
}, this));
this._controls.$next=$('<' + settings.navElement + '>')
.addClass(settings.navClass[1])
.html(settings.navText[1])
.appendTo(this._controls.$relative)
.on('click', $.proxy(function(e){
this.next(settings.navSpeed);
}, this));
if(!settings.dotsData){
this._templates=[ $('<button role="button">')
.addClass(settings.dotClass)
.append($('<span>'))
.prop('outerHTML') ];
}
this._controls.$absolute=(settings.dotsContainer ? $(settings.dotsContainer)
: $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
this._controls.$absolute.on('click', 'button', $.proxy(function(e){
var index=$(e.target).parent().is(this._controls.$absolute)
? $(e.target).index():$(e.target).parent().index();
e.preventDefault();
this.to(index, settings.dotsSpeed);
}, this));
/*$el.on('focusin', function(){
$(document).off(".carousel");
$(document).on('keydown.carousel', function(e){
if(e.keyCode==37){
$el.trigger('prev.owl')
}
if(e.keyCode==39){
$el.trigger('next.owl')
}});
});*/
for (override in this._overrides){
this._core[override]=$.proxy(this[override], this);
}};
Navigation.prototype.destroy=function(){
var handler, control, property, override, settings;
settings=this._core.settings;
for (handler in this._handlers){
this.$element.off(handler, this._handlers[handler]);
}
for (control in this._controls){
if(control==='$relative'&&settings.navContainer){
this._controls[control].html('');
}else{
this._controls[control].remove();
}}
for (override in this.overides){
this._core[override]=this._overrides[override];
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
Navigation.prototype.update=function(){
var i, j, k,
lower=this._core.clones().length / 2,
upper=lower + this._core.items().length,
maximum=this._core.maximum(true),
settings=this._core.settings,
size=settings.center||settings.autoWidth||settings.dotsData
? 1:settings.dotsEach||settings.items;
if(settings.slideBy!=='page'){
settings.slideBy=Math.min(settings.slideBy, settings.items);
}
if(settings.dots||settings.slideBy=='page'){
this._pages=[];
for (i=lower, j=0, k=0; i < upper; i++){
if(j >=size||j===0){
this._pages.push({
start: Math.min(maximum, i - lower),
end: i - lower + size - 1
});
if(Math.min(maximum, i - lower)===maximum){
break;
}
j=0, ++k;
}
j +=this._core.mergers(this._core.relative(i));
}}
};
Navigation.prototype.draw=function(){
var difference,
settings=this._core.settings,
disabled=this._core.items().length <=settings.items,
index=this._core.relative(this._core.current()),
loop=settings.loop||settings.rewind;
this._controls.$relative.toggleClass('disabled', !settings.nav||disabled);
if(settings.nav){
this._controls.$previous.toggleClass('disabled', !loop&&index <=this._core.minimum(true));
this._controls.$next.toggleClass('disabled', !loop&&index >=this._core.maximum(true));
}
this._controls.$absolute.toggleClass('disabled', !settings.dots||disabled);
if(settings.dots){
difference=this._pages.length - this._controls.$absolute.children().length;
if(settings.dotsData&&difference!==0){
this._controls.$absolute.html(this._templates.join(''));
}else if(difference > 0){
this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
}else if(difference < 0){
this._controls.$absolute.children().slice(difference).remove();
}
this._controls.$absolute.find('.active').removeClass('active');
this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
}};
Navigation.prototype.onTrigger=function(event){
var settings=this._core.settings;
event.page={
index: $.inArray(this.current(), this._pages),
count: this._pages.length,
size: settings&&(settings.center||settings.autoWidth||settings.dotsData
? 1:settings.dotsEach||settings.items)
};};
Navigation.prototype.current=function(){
var current=this._core.relative(this._core.current());
return $.grep(this._pages, $.proxy(function(page, index){
return page.start <=current&&page.end >=current;
}, this)).pop();
};
Navigation.prototype.getPosition=function(successor){
var position, length,
settings=this._core.settings;
if(settings.slideBy=='page'){
position=$.inArray(this.current(), this._pages);
length=this._pages.length;
successor ? ++position:--position;
position=this._pages[((position % length) + length) % length].start;
}else{
position=this._core.relative(this._core.current());
length=this._core.items().length;
successor ? position +=settings.slideBy:position -=settings.slideBy;
}
return position;
};
Navigation.prototype.next=function(speed){
$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
};
Navigation.prototype.prev=function(speed){
$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
};
Navigation.prototype.to=function(position, speed, standard){
var length;
if(!standard&&this._pages.length){
length=this._pages.length;
$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
}else{
$.proxy(this._overrides.to, this._core)(position, speed);
}};
$.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
'use strict';
var Hash=function(carousel){
this._core=carousel;
this._hashes={};
this.$element=this._core.$element;
this._handlers={
'initialized.owl.carousel': $.proxy(function(e){
if(e.namespace&&this._core.settings.startPosition==='URLHash'){
$(window).trigger('hashchange.owl.navigation');
}}, this),
'prepared.owl.carousel': $.proxy(function(e){
if(e.namespace){
var hash=$(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
if(!hash){
return;
}
this._hashes[hash]=e.content;
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.namespace&&e.property.name==='position'){
var current=this._core.items(this._core.relative(this._core.current())),
hash=$.map(this._hashes, function(item, hash){
return item===current ? hash:null;
}).join();
if(!hash||window.location.hash.slice(1)===hash){
return;
}
window.location.hash=hash;
}}, this)
};
this._core.options=$.extend({}, Hash.Defaults, this._core.options);
this.$element.on(this._handlers);
$(window).on('hashchange.owl.navigation', $.proxy(function(e){
var hash=window.location.hash.substring(1),
items=this._core.$stage.children(),
position=this._hashes[hash]&&items.index(this._hashes[hash]);
if(position===undefined||position===this._core.current()){
return;
}
this._core.to(this._core.relative(position), false, true);
}, this));
};
Hash.Defaults={
URLhashListener: false
};
Hash.prototype.destroy=function(){
var handler, property;
$(window).off('hashchange.owl.navigation');
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Hash=Hash;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var style=$('<support>').get(0).style,
prefixes='Webkit Moz O ms'.split(' '),
events={
transition: {
end: {
WebkitTransition: 'webkitTransitionEnd',
MozTransition: 'transitionend',
OTransition: 'oTransitionEnd',
transition: 'transitionend'
}},
animation: {
end: {
WebkitAnimation: 'webkitAnimationEnd',
MozAnimation: 'animationend',
OAnimation: 'oAnimationEnd',
animation: 'animationend'
}}
},
tests={
csstransforms: function(){
return !!test('transform');
},
csstransforms3d: function(){
return !!test('perspective');
},
csstransitions: function(){
return !!test('transition');
},
cssanimations: function(){
return !!test('animation');
}};
function test(property, prefixed){
var result=false,
upper=property.charAt(0).toUpperCase() + property.slice(1);
$.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property){
if(style[property]!==undefined){
result=prefixed ? property:true;
return false;
}});
return result;
}
function prefixed(property){
return test(property, true);
}
if(tests.csstransitions()){
$.support.transition=new String(prefixed('transition'))
$.support.transition.end=events.transition.end[ $.support.transition ];
}
if(tests.cssanimations()){
$.support.animation=new String(prefixed('animation'))
$.support.animation.end=events.animation.end[ $.support.animation ];
}
if(tests.csstransforms()){
$.support.transform=new String(prefixed('transform'));
$.support.transform3d=tests.csstransforms3d();
}})(window.Zepto||window.jQuery, window, document);
!function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}function c(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d],delete a[d]);return c}function d(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));if(a.fn.jquery.match(/-ajax/))return void("console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version."));var e=[],f=function(b){return e=a.grep(e,function(a){return a!==b&&a.$instance.closest("body").length>0})},g={allow:1,allowfullscreen:1,frameborder:1,height:1,longdesc:1,marginheight:1,marginwidth:1,mozallowfullscreen:1,name:1,referrerpolicy:1,sandbox:1,scrolling:1,src:1,srcdoc:1,style:1,webkitallowfullscreen:1,width:1},h={keyup:"onKeyUp",resize:"onResize"},i=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[h[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},j=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(h,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,i)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<button class="'+e+"-close-icon "+d.namespace+'-close" aria-label="Close">',d.closeIcon,"</button>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){if(!b.isDefaultPrevented()){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",b.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(this.$instance[0],b[0])?"":b),this.$content=b.addClass(this.namespace+"-inner"),this},open:function(b){var c=this;if(c.$instance.hide().appendTo(c.root),!(b&&b.isDefaultPrevented()||c.beforeOpen(b)===!1)){b&&b.preventDefault();var d=c.getContent();if(d)return e.push(c),j(!0),c.$instance.fadeIn(c.openSpeed),c.beforeContent(b),a.when(d).always(function(a){c.setContent(a),c.afterContent(b)}).then(c.$instance.promise()).done(function(){c.afterOpen(b)})}return c.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,d=a.Deferred();return c.beforeClose(b)===!1?d.reject():(0===f(c).length&&j(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),d.resolve()})),d.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(this.$content.parent().width()-1),b/(this.$content.parent().height()-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var e=new a.Deferred,f=a("<iframe/>"),h=d(this,"iframe"),i=c(h,g);return f.hide().attr("src",b).attr(i).css(h).on("load",function(){e.resolve(f.show())}).appendTo(this.$instance.find("."+this.namespace+"-content")),e.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=JSON.parse(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d),i=function(g){var i=a(g.currentTarget),j=a.extend({$source:b,$currentTarget:i},e.readElementConfig(b[0],h.namespace),e.readElementConfig(g.currentTarget,h.namespace),d),k=f||i.data("featherlight-persisted")||new e(c,j);"shared"===k.persist?f=k:k.persist!==!1&&i.data("featherlight-persisted",k),j.$currentTarget.blur&&j.$currentTarget.blur(),k.open(g)};return b.on(h.openTrigger+"."+h.namespace,h.filter,i),{filter:h.filter,handler:i}},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return f(),a.grep(e,function(a){return a instanceof b})},close:function(a){var b=this.current();return b?b.close(a):void 0},_onReady:function(){var b=this;if(b.autoBind){var c=a(b.autoBind);c.each(function(){b.attach(a(this))}),a(document).on("click",b.autoBind,function(d){if(!d.isDefaultPrevented()){var e=a(d.currentTarget),f=c.length;if(c=c.add(e),f!==c.length){var g=b.attach(e);(!g.filter||a(d.target).parentsUntil(e,g.filter).length>0)&&g.handler(d)}}})}},_callbackChain:{onKeyUp:function(b,c){return 27===c.keyCode?(this.closeOnEsc&&a.featherlight.close(c),!1):b(c)},beforeOpen:function(b,c){return a(document.documentElement).addClass("with-featherlight"),this._previouslyActive=document.activeElement,this._$previouslyTabbable=a("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]").not("[tabindex]").not(this.$instance.find("button")),this._$previouslyWithTabIndex=a("[tabindex]").not('[tabindex="-1"]'),this._previousWithTabIndices=this._$previouslyWithTabIndex.map(function(b,c){return a(c).attr("tabindex")}),this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr("tabindex",-1),document.activeElement.blur&&document.activeElement.blur(),b(c)},afterClose:function(c,d){var e=c(d),f=this;return this._$previouslyTabbable.removeAttr("tabindex"),this._$previouslyWithTabIndex.each(function(b,c){a(c).attr("tabindex",f._previousWithTabIndices[b])}),this._previouslyActive.focus(),0===b.opened().length&&a(document.documentElement).removeClass("with-featherlight"),e},onResize:function(a,b){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),a(b)},afterContent:function(a,b){var c=a(b);return this.$instance.find("[autofocus]:not([disabled])").focus(),this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c),this},a(document).ready(function(){b._onReady()})}(jQuery);