function _createForOfIteratorHelper(t,e){var n,a,r,o,i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return r=!(a=!0),{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,n=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}};if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length)return i&&(t=i),o=0,{s:e=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.In order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var c,i={},t=Object.prototype,l=t.hasOwnProperty,d=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},a=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function o(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{o({},"")}catch(c){o=function(t,e,n){return t[e]=n}}function s(t,e,n,a){var r,o,i,s,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),a=new j(a||[]);return d(e,"_invoke",{value:(r=t,o=n,i=a,s=p,function(t,e){if(s===f)throw Error("Generator is already running");if(s===_){if("throw"===t)throw e;return{value:c,done:!0}}for(i.method=t,i.arg=e;;){var n=i.delegate;if(n){n=function t(e,n){var a=n.method,r=e.iterator[a];if(r===c)return n.delegate=null,"throw"===a&&e.iterator.return&&(n.method="return",n.arg=c,t(e,n),"throw"===n.method)||"return"!==a&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+a+"' method")),m;a=u(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,m;r=a.arg;return r?r.done?(n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=c),n.delegate=null,m):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}(n,i);if(n){if(n===m)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(s===p)throw s=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);s=f;n=u(r,o,i);if("normal"===n.type){if(s=i.done?_:h,n.arg===m)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(s=_,i.method="throw",i.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=s;var p="suspendedStart",h="suspendedYield",f="executing",_="completed",m={};function g(){}function y(){}function w(){}var e={},v=(o(e,a,function(){return this}),Object.getPrototypeOf),v=v&&v(v(S([]))),b=(v&&v!==t&&l.call(v,a)&&(e=v),w.prototype=g.prototype=Object.create(e));function x(t){["next","throw","return"].forEach(function(e){o(t,e,function(t){return this._invoke(e,t)})})}function k(i,s){var e;d(this,"_invoke",{value:function(n,a){function t(){return new s(function(t,e){!function e(t,n,a,r){var o,t=u(i[t],i,n);if("throw"!==t.type)return(n=(o=t.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,a,r)},function(t){e("throw",t,a,r)}):s.resolve(n).then(function(t){o.value=t,a(o)},function(t){return e("throw",t,a,r)});r(t.arg)}(n,a,t,e)})}return e=e?e.then(t,t):t()}})}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function S(e){if(e||""===e){var n,t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++nt.length)&&(e=t.length);for(var n=0,a=Array(e);nt.options.ticks.maxTicksLimit?(n=t.max-t.min,e=t.options.ticks.maxTicksLimit||1e3,n=Math.ceil(n/e),t.options.ticks.stepSize=Math.max(1,n)):(!t.options.ticks.stepSize||t.options.ticks.stepSize<1)&&(t.options.ticks.stepSize=1)}function Q(t){var e,n=t.canvas.parentNode.querySelector("div");return n||((n=document.createElement("div")).classList.add("wps-chart-tooltip"),n.style.opacity=1,n.style.pointerEvents="none",n.style.position="absolute",n.style.transition="all .1s ease",(e=document.createElement("table")).style.margin="0px",n.appendChild(e),t.canvas.parentNode.appendChild(n)),n}function I(t,a,r,o,i,s,c){var e,l,d,u,n,p,h=t.chart,f=(f=t).tooltip,_=h.options.plugins.tooltip.unitTime;t=Q(h),0===f.opacity?t.style.opacity=0:f.body&&(e=f.title||[],l=f.dataPoints[0].dataIndex,d=h.data.datasets,u="",n=D.isset(D.global,"options","wp_date_format")?D.global.options.wp_date_format:"MM/DD/YYYY",p=(p=$(n)).replace(/\/YYYY|YYYY/g,"").replace(/,\s*$/,"").replace(/^\s*,/,"").trim(),e.forEach(function(t){var e,n;"day"===_?(e=(n=(a.data||a).labels[l]).date,n=n.day,u+='
'.concat(moment(e).format(p)," (").concat(n,")
")):u+='
'.concat(("month"===_?i:r)[l],"
")}),d.forEach(function(e,t){var n,t=h.getDatasetMeta(t),a=e.label.includes("(Previous)");t.hidden||a||(t=e.data[l],u+='
').concat(e.label,'
').concat(t.toLocaleString(),"")),(a=d.find(function(t){return t.label===e.label+" (Previous)"}))&&(t=h.getDatasetMeta(d.indexOf(a)),n=(n=document.querySelector(".wps-postbox-chart--previousPeriod"))&&n.classList.contains("wps-line-through"),t.hidden||n||(t=a.data[l]||0,a=null,void 0===(a="day"===_?(n=c&&c[l])?"".concat(moment(n.date).format(p)," (").concat(n.day,")"):o[l]||"N/A":("month"===_?s:o)[l])&&(a="N/A"),u+='
').concat(a,'
').concat(t.toLocaleString(),"")))}),u+="
",t.innerHTML=u,D.setTooltipPosition(t,h,f))}function p(o,i,s,c,l){if(!(o&&o.length&&i&&i.length))return console.error("Invalid input: labels or datasets are empty."),{aggregatedLabels:[],aggregatedData:i?i.map(function(){return[]}):[],monthTooltipTitle:[]};var e=[],n=moment();if("day"===s)return o.forEach(function(t){t=moment(t.date),e.push(t.isSameOrAfter(n,"day"))}),{aggregatedLabels:o.map(function(t){return t.formatted_date}),aggregatedData:i.map(function(t){return t.data}),monthTooltipTitle:[],isIncompletePeriod:e};var d=[],u=i.map(function(){return[]}),p=[],h={};if("week"===s){D._("start_of_week")&&moment.updateLocale("en",{week:{dow:parseInt(D._("start_of_week"))}});for(var t=moment(o[0].date),a=moment(o[o.length-1].date),f=[],r=t.clone();r.isSameOrBefore(a);){var _=r.clone().startOf("week").add(1,"week"),m=_.clone().subtract(1,"day");m.isAfter(a)&&(m=a.clone()),f.push({start:r.clone(),end:m,key:r.format("YYYY-[W]WW"),data:new Array(i.length).fill(0)}),r=_}o.forEach(function(t,a){if(t.date)for(var e=moment(t.date),r=0,o=f;r{var n=o[r];if(e.isBetween(n.start,n.end,"day","[]"))return i.forEach(function(t,e){n.data[e]+=t.data[a]||0}),1})();r++);}),f.forEach(function(t){var e=W(t.start,t.end,s,c,l);d.push(e),p.push(N(t.start,t.end,c)),t.data.forEach(function(t,e){u[e]||(u[e]=[]),u[e].push(t)})}),f.forEach(function(t){t=t.end.isSameOrAfter(moment(),"day"),e.push(t)})}else if("month"===s){for(var t=moment(o[0].date),g=moment(o[o.length-1].date),y=t.clone();y.isSameOrBefore(g,"month");){var w=y.format("YYYY-MM");h[w]||(h[w]={startDate:y.clone().startOf("month"),endDate:y.clone().endOf("month"),indices:[]}),y.add(1,"month")}o.forEach(function(t,e){t.date&&(t=moment(t.date).format("YYYY-MM"),h[t])&&h[t].indices.push(e)}),Object.keys(h).forEach(function(t){var e=h[t],n=e.startDate,a=e.endDate,r=e.indices,e=moment.max(n,moment(o[0].date)),n=moment.min(a,moment(o[o.length-1].date));e.isValid()&&n.isValid()?0=n.getTime()?e+1:t.getTime()>=a.getTime()?e:e-1}function R(t){return T(1,arguments),t=w(t=M(t)).getTime()-function(t){T(1,arguments);var t=F(t),e=new Date(0);return e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0),w(e)}(t).getTime(),Math.round(t/6048e5)+1}function v(t,e){T(1,arguments);var e=e||{},n=null==(n=(n=e.locale)&&n.options&&n.options.weekStartsOn)?0:D(n);if(0<=(n=null==e.weekStartsOn?n:D(e.weekStartsOn))&&n<=6)return t=((t=(e=M(t)).getUTCDay())=r.getTime()?a+1:t.getTime()>=o.getTime()?a:a-1;throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively")}function $(t,e){return T(1,arguments),t=v(t=M(t),e).getTime()-function(t,e){T(1,arguments);var n=null==(n=(n=(a=e||{}).locale)&&n.options&&n.options.firstWeekContainsDate)?1:D(n),n=null==a.firstWeekContainsDate?n:D(a.firstWeekContainsDate),a=b(t,e),t=new Date(0);return t.setUTCFullYear(a,0,n),t.setUTCHours(0,0,0,0),v(t,e)}(t,e).getTime(),Math.round(t/6048e5)+1}function W(t,e){var n=0{function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e.DatasetController),_createClass(t,[{key:"initialize",value:function(){this.enableOptionSharing=!0,_superPropGet(t,"initialize",this,3)([])}},{key:"update",value:function(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}},{key:"updateElements",value:function(t,e,n,a){for(var r=this,o="reset"===a,i=r._cachedMeta,s=i.xScale,c=i.yScale,i=r.resolveDataElementOptions(e,a),i=r.getSharedOptions(a,t[e],i),l=e;l=t.left&&e<=t.right)&&(o||n>=t.top&&n<=t.bottom)}_defineProperty(n,"id","matrix"),_defineProperty(n,"version","2.0.1"),_defineProperty(n,"defaults",{dataElementType:"matrix",animations:{numbers:{type:"number",properties:["x","y","width","height"]}}}),_defineProperty(n,"overrides",{interaction:{mode:"nearest",intersect:!0},scales:{x:{type:"linear",offset:!0},y:{type:"linear",reverse:!0}}});var r=(()=>{function n(t){var e;return _classCallCheck(this,n),(e=_callSuper(this,n)).options=void 0,e.width=void 0,e.height=void 0,t&&Object.assign(_assertThisInitialized(e),t),e}return _inherits(n,e.Element),_createClass(n,[{key:"draw",value:function(t){var e,n,a,r,o,i,s,c=this.options,l=(o=f(e=this),i=o.right-o.left,n=i/2,a=(s=o.bottom-o.top)/2,l=e.options.borderWidth,h.isObject(l)?(d=+l.top||0,u=+l.right||0,p=+l.bottom||0,r=+l.left||0):d=u=p=r=+l||0,e={t:_(d,0,a),r:_(u,0,n),b:_(p,0,a),l:_(r,0,n)},{outer:{x:o.left,y:o.top,w:i,h:s},inner:{x:o.left+e.l,y:o.top+e.t,w:i-e.l-e.r,h:s-e.t-e.b}}),d=l.inner,u=l.outer,p=h.toTRBLCorners(c.borderRadius);t.save(),u.w!==d.w||u.h!==d.h?(t.beginPath(),h.addRoundedRectPath(t,{x:u.x,y:u.y,w:u.w,h:u.h,radius:p}),h.addRoundedRectPath(t,{x:d.x,y:d.y,w:d.w,h:d.h,radius:p}),t.fillStyle=c.backgroundColor,t.fill(),t.fillStyle=c.borderColor,t.fill("evenodd")):(t.beginPath(),h.addRoundedRectPath(t,{x:d.x,y:d.y,w:d.w,h:d.h,radius:p}),t.fillStyle=c.backgroundColor,t.fill()),t.restore()}},{key:"inRange",value:function(t,e,n){return a(this,t,e,n)}},{key:"inXRange",value:function(t,e){return a(this,t,null,e)}},{key:"inYRange",value:function(t,e){return a(this,null,t,e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","width","height"],t);return{x:(t=e.x)+e.width/2,y:e.y+e.height/2}}},{key:"tooltipPosition",value:function(){return this.getCenterPoint()}},{key:"getRange",value:function(t){return"x"===t?this.width/2:this.height/2}}])})();_defineProperty(r,"id","matrix"),_defineProperty(r,"defaults",{backgroundColor:void 0,borderColor:void 0,borderWidth:void 0,borderRadius:0,anchorX:"center",anchorY:"center",width:20,height:20}),(400{if(c){var t;if(c.startsWith("UTC")||c.startsWith("+")||c.startsWith("-"))return t=c.startsWith("UTC")?c.replace("UTC",""):c,moment().utcOffset(t);if(moment.tz.zone(c))return moment().tz(c)}return moment().utc()})()),l=(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(d={},D._("str_today"),[n(r.clone(),c),n(r.clone(),c)]),D._("str_yesterday"),[n(r.clone().subtract(1,"days"),c),n(r.clone().subtract(1,"days"),c)]),D._("str_this_week"),[n(r.clone().startOf("week"),c),n(r.clone().endOf("week"),c)]),D._("str_last_week"),[n(r.clone().subtract(1,"week").startOf("week"),c),n(r.clone().subtract(1,"week").endOf("week"),c)]),D._("str_this_month"),[n(r.clone().startOf("month"),c),n(r.clone().endOf("month"),c)]),D._("str_last_month"),[n(r.clone().subtract(1,"month").startOf("month"),c),n(r.clone().subtract(1,"month").endOf("month"),c)]),D._("str_7days"),[n(r.clone().subtract(6,"days"),c),n(r.clone(),c)]),D._("str_28days"),[n(r.clone().subtract(27,"days"),c),n(r.clone(),c)]),D._("str_30days"),[n(r.clone().subtract(29,"days"),c),n(r.clone(),c)]),D._("str_90days"),[n(r.clone().subtract(89,"days"),c),n(r.clone(),c)]),_defineProperty(_defineProperty(d,D._("str_6months"),[n(r.clone().subtract(6,"months"),c),n(r.clone(),c)]),D._("str_year"),[n(r.clone().startOf("year"),c),n(r.clone().endOf("year"),c)])),r=(o.hasClass("js-date-range-picker-all-time")&&(d=moment(0),d=a()?D.global.post_creation_date?n(moment(D.global.post_creation_date),c):n(moment(0),c):D.global.initial_post_date?n(moment(D.global.initial_post_date),c):n(moment(0),c),l[D._("all_time")]=[d,n(moment(),c)]),d=o.attr("data-date-format")?o.attr("data-date-format"):"MM/DD/YYYY",e={d:"DD",j:"D",S:"Do",n:"M",m:"MM",F:"MMMM",M:"MMM",y:"YY",Y:"YYYY"},d.replace(/([a-zA-Z])/g,function(t){return e[t]||t})),d=moment(D.global.user_date_range.from).format("YYYY-MM-DD"),u=moment(D.global.user_date_range.to).format("YYYY-MM-DD");if(o.length&&i.length&&s.length&&!i.data("daterangepicker")&&i.daterangepicker({autoApply:!0,ranges:l,locale:{customRangeLabel:D._("custom_range")},startDate:d,endDate:u}),D.isset(D.global,"request_params","from")&&D.isset(D.global,"request_params","to")){var p=D.global.request_params.from;if(a()&&p&&D.global.post_creation_date){var h=new Date(D.global.post_creation_date),f=new Date(p),_=new Date(f.getFullYear(),f.getMonth(),f.getDate());if(_'.concat(h,"")+a,document.querySelector(".js-date-range-picker-btn").classList.add("custom-range")):a=h),o.find("span").html(a)}else{var w=moment(d),p=moment(u);i.data("daterangepicker").setStartDate(moment(d).format("MM/DD/YYYY")),i.data("daterangepicker").setEndDate(moment(u).format("MM/DD/YYYY")),i.data("daterangepicker").updateCalendars();h=w.year()===p.year()?(f=r.replace(/,?\s?(YYYY|YY)[-/\s]?,?|[-/\s]?(YYYY|YY)[-/\s]?,?/g,""),w.format(f)+" - "+p.format(r)):w.format(r)+" - "+p.format(r);var v=i.data("daterangepicker").container.find(".ranges li.active").text();i.data("daterangepicker").container.find(".ranges li.active").removeClass("active"),i.data("daterangepicker").container.find('.ranges li[data-range-key="'+v+'"]').addClass("active"),"Custom Range"!==v&&"All time"!==v&&(h=''.concat(v,"")+h,document.querySelector(".js-date-range-picker-btn").classList.add("custom-range")),o.find("span").html(h),i.on("show.daterangepicker",function(t,e){i.data("daterangepicker").container.find(".ranges li.active").removeClass("active"),i.data("daterangepicker").container.find('.ranges li[data-range-key="'+v+'"]').addClass("active")})}i.on("show.daterangepicker",function(t,e){e=e.container,jQuery(e).addClass(t.target.className)}),i.on("apply.daterangepicker",function(t,e){var n=s.find(".js-date-range-picker-input-from").first(),a=s.find(".js-date-range-picker-input-to").first(),r=e.startDate.startOf("day").utcOffset(c,!0).format("YYYY-MM-DD"),e=e.endDate.startOf("day").utcOffset(c,!0).format("YYYY-MM-DD"),n=(n.val(r),a.val(e),i.data("daterangepicker").chosenLabel);o.find("span").html(n),"All time"!==n?jQuery.ajax({url:D.global.ajax_url,method:"POST",data:{wps_nonce:D.global.rest_api_nonce,action:"wp_statistics_store_date_range",date:{from:r,to:e}},beforeSend:function(){o.addClass("wps-disabled")},complete:function(t){s.submit()}}):s.submit()})}t.length&&(t.daterangepicker({singleDatePicker:!0,showDropdowns:!0,minYear:1998,maxYear:parseInt((new Date).getFullYear()+1),locale:{format:"YYYY-MM-DD"}}),t.on("show.daterangepicker",function(t,e){e=e.container,jQuery(e).addClass(t.target.className)}),t.on("apply.daterangepicker",function(t,e){jQuery(".wps-today-datepicker").submit()}))}),w=function(v){function t(){this.__$emitterPrivate=v({}),this.__$emitterPublic=v({}),this.__instancesLatestArr=[],this.__plugins={},this._env=b}var c={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},r="undefined"!=typeof window?window:null,b={hasTouchCapability:!(!r||!("ontouchstart"in r||r.DocumentTouch&&r.document instanceof r.DocumentTouch||r.navigator.maxTouchPoints)),hasTransitions:(()=>{if(r){var t=(r.document.body||r.document.documentElement).style,e=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof t[n="transition"])return!0;for(var n=n.charAt(0).toUpperCase()+n.substr(1),a=0;a=a.__options.IEmin?(t=null,void 0===a._$origin.data("tooltipster-initialTitle")&&(t=a._$origin.attr("title"),a._$origin.data("tooltipster-initialTitle",t=void 0===t?null:t)),null!==a.__options.content?a.__contentSet(a.__options.content):(n=(e=a._$origin.attr("data-tooltip-content"))?v(e):n)&&n[0]?a.__contentSet(n.first()):a.__contentSet(t),a._$origin.removeAttr("title").addClass("tooltipstered"),a.__prepareOrigin(),a.__prepareGC(),v.each(a.__options.plugins,function(t,e){a._plug(e)}),b.hasTouchCapability&&v(b.window.document.body).on("touchmove."+a.__namespace+"-triggerOpen",function(t){a._touchRecordEvent(t)}),a._on("created",function(){a.__prepareTooltip()})._on("repositioned",function(t){a.__lastPosition=t.position})):a.__options.disabled=!0},__contentInsert:function(){var t=this,e=t._$tooltip.find(".tooltipster-content"),n=t.__Content;return t._trigger({type:"format",content:t.__Content,format:function(t){n=t}}),"string"!=typeof(n=t.__options.functionFormat?t.__options.functionFormat.call(t,t,{origin:t._$origin[0]},t.__Content):n)||t.__options.contentAsHTML?e.empty().append(n):e.text(n),t},__contentSet:function(t){return t instanceof v&&this.__options.contentCloning&&(t=t.clone(!0)),this.__Content=t,this._trigger({type:"updated",content:t}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var t=this,e=t._$origin,n=t._$origin.is("area"),a=(n&&(a=t._$origin.parent().attr("name"),e=v('img[usemap="#'+a+'"]')),e[0].getBoundingClientRect()),r=v(b.window.document),o=v(b.window),i=e,s={available:{document:null,window:null},document:{size:{height:r.height(),width:r.width()}},window:{scroll:{left:b.window.scrollX||b.window.document.documentElement.scrollLeft,top:b.window.scrollY||b.window.document.documentElement.scrollTop},size:{height:o.height(),width:o.width()}},origin:{fixedLineage:!1,offset:{},size:{height:a.bottom-a.top,width:a.right-a.left},usemapImage:n?e[0]:null,windowOffset:{bottom:a.bottom,left:a.left,right:a.right,top:a.top}}};if(n){var r=t._$origin.attr("shape"),c=t._$origin.attr("coords");if(c&&(c=c.split(","),v.map(c,function(t,e){c[e]=parseInt(t)})),"default"!=r)switch(r){case"circle":var l=c[0],d=(d=c[1])-(u=c[2]),l=l-u;s.origin.size.height=2*u,s.origin.size.width=s.origin.size.height,s.origin.windowOffset.left+=l,s.origin.windowOffset.top+=d;break;case"rect":var u=c[0],l=c[1],d=c[2],p=c[3];s.origin.size.height=p-l,s.origin.size.width=d-u,s.origin.windowOffset.left+=u,s.origin.windowOffset.top+=l;break;case"poly":for(var h=0,f=0,_=0,m=0,g="even",y=0;ye.right))return!(i=!0);if("visible"!=r&&(o.origin.windowOffset.tope.bottom))return!(i=!0)}if("fixed"==n.css("position"))return!1}),i?a._$tooltip.css("visibility","hidden"):(a._$tooltip.css("visibility","visible"),a.__options.repositionOnScroll?a.reposition(t):(e=o.origin.offset.left-a.__Geometry.origin.offset.left,n=o.origin.offset.top-a.__Geometry.origin.offset.top,a._$tooltip.css({left:a.__lastPosition.coord.left+e,top:a.__lastPosition.coord.top+n})))),a._trigger({type:"scroll",event:t,geo:o})),a},__stateSet:function(t){return this.__state=t,this._trigger({type:"state",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,v.each(this.__timeouts.close,function(t,e){clearTimeout(e)}),this.__timeouts.close=[],this},__trackerStart:function(){var n=this,a=n._$tooltip.find(".tooltipster-content");return n.__options.trackTooltip&&(n.__contentBcr=a[0].getBoundingClientRect()),n.__tracker=setInterval(function(){var t,e;l(n._$origin)&&l(n._$tooltip)?(n.__options.trackOrigin&&(t=!1,o((e=n.__geometry()).origin.size,n.__Geometry.origin.size)&&(n.__Geometry.origin.fixedLineage?o(e.origin.windowOffset,n.__Geometry.origin.windowOffset)&&(t=!0):o(e.origin.offset,n.__Geometry.origin.offset)&&(t=!0)),t||(n.__options.triggerClose.mouseleave?n._close():n.reposition())),!n.__options.trackTooltip||(e=a[0].getBoundingClientRect()).height===n.__contentBcr.height&&e.width===n.__contentBcr.width||(n.reposition(),n.__contentBcr=e)):n._close()},n.__options.trackerInterval),n},_close:function(n,t,e){var a,r=this,o=!0;return r._trigger({type:"close",event:n,stop:function(){o=!1}}),(o||e)&&(t&&r.__callbacks.close.push(t),r.__callbacks.open=[],r.__timeoutsClear(),a=function(){v.each(r.__callbacks.close,function(t,e){e.call(r,r,{event:n,origin:r._$origin[0]})}),r.__callbacks.close=[]},"closed"!=r.__state?(e=!0,t=(new Date).getTime()+r.__options.animationDuration[1],(e=!("disappearing"==r.__state&&t>r.__closingTime&&0").append(n.__Content).html()),e&&n._$origin.attr("title",e),n._$origin.removeClass("tooltipstered"),n._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")):(t=v.grep(t,function(t,e){return t!==n.__namespace}),n._$origin.data("tooltipster-ns",t))),n._trigger("destroyed"),n._off(),n.off(),n.__Content=null,n.__$emitterPrivate=null,n.__$emitterPublic=null,n.__options.parent=null,n._$origin=null,n._$tooltip=null,v.tooltipster.__instancesLatestArr=v.grep(v.tooltipster.__instancesLatestArr,function(t,e){return n!==t}),clearInterval(n.__garbageCollector)),n},disable:function(){return this.__destroyed?this.__destroyError():(this._close(),this.__enabled=!1),this},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(t,e){return void 0===e?this.__options[t]:(this.__destroyed?this.__destroyError():(this.__options[t]=e,this.__optionsFormat(),0<=v.inArray(t,["trigger","triggerClose","triggerOpen"])&&this.__prepareOrigin(),"selfDestruction"===t&&this.__prepareGC()),this)},reposition:function(t,e){var n=this;return n.__destroyed?n.__destroyError():"closed"!=n.__state&&l(n._$origin)&&(e||l(n._$tooltip))&&(e||n._$tooltip.detach(),n.__Geometry=n.__geometry(),n._trigger({type:"reposition",event:t,helper:{geo:n.__Geometry}})),n},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},v.fn.tooltipster=function(){var n,r,t,e,a,o,i=Array.prototype.slice.apply(arguments),s="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";return 0===this.length?this:"string"==typeof i[0]?(n="#*$~&",this.each(function(){var t=v(this).data("tooltipster-ns");if(!(t=t?v(this).data(t[0]):null))throw new Error("You called Tooltipster's \""+i[0]+'" method on an uninitialized element');if("function"!=typeof t[i[0]])throw new Error('Unknown method "'+i[0]+'"');1').append(this.__$tooltip).appendTo(b.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,e){return this.constraints={width:t,height:e},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t,e,n,a=this.__$tooltip[0].getBoundingClientRect(),r={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};return this.constraints&&(t=this.__$tooltip.find(".tooltipster-content"),n=this.__$tooltip.outerHeight(),e=t[0].getBoundingClientRect(),n={height:n<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=t[0].scrollWidth-1},r.fits=n.height&&n.width),b.IE&&b.IE<=11&&r.size.width!==b.window.document.documentElement.clientWidth&&(r.size.width=Math.ceil(r.size.width)+1),r}};var n=navigator.userAgent.toLowerCase(),a=(-1!=n.indexOf("msie")?b.IE=parseInt(n.split("msie")[1]):-1!==n.toLowerCase().indexOf("trident")&&-1!==n.indexOf(" rv:11")?b.IE=11:-1!=n.toLowerCase().indexOf("edge/")&&(b.IE=parseInt(n.toLowerCase().split("edge/")[1])),"tooltipster.sideTip");return v.tooltipster._plugin({name:a,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var e=this;e.__instance=t,e.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),e.__previousState="closed",e.__options,e.__optionsFormat(),e.__instance._on("state."+e.__namespace,function(t){"closed"==t.state?e.__close():"appearing"==t.state&&"closed"==e.__previousState&&e.__create(),e.__previousState=t.state}),e.__instance._on("options."+e.__namespace,function(){e.__optionsFormat()}),e.__instance._on("reposition."+e.__namespace,function(t){e.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof v&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var t=v('');this.__options.arrow||t.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&t.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&t.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=t,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var t=this;t.__options=t.__instance._optionsExtract(a,t.__defaults()),t.__options.position&&(t.__options.side=t.__options.position),"object"!=_typeof(t.__options.distance)&&(t.__options.distance=[t.__options.distance]),t.__options.distance.length<4&&(void 0===t.__options.distance[1]&&(t.__options.distance[1]=t.__options.distance[0]),void 0===t.__options.distance[2]&&(t.__options.distance[2]=t.__options.distance[0]),void 0===t.__options.distance[3])&&(t.__options.distance[3]=t.__options.distance[1]),t.__options.distance={top:t.__options.distance[0],right:t.__options.distance[1],bottom:t.__options.distance[2],left:t.__options.distance[3]},"string"==typeof t.__options.side&&(t.__options.side=[t.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[t.__options.side]],"left"==t.__options.side[0]||"right"==t.__options.side[0]?t.__options.side.push("top","bottom"):t.__options.side.push("right","left")),6===v.tooltipster._env.IE&&!0!==t.__options.arrow&&(t.__options.arrow=!1)},__reposition:function(c,l){var e,d=this,u=d.__targetFind(l),p=[],n=(d.__instance._$tooltip.detach(),d.__instance._$tooltip.clone()),h=v.tooltipster._getRuler(n),f=!1;switch((a=d.__instance.option("animation"))&&n.removeClass("tooltipster-"+a),v.each(["window","document"],function(t,r){var o=null;if(d.__instance._trigger({container:r,helper:l,satisfied:f,takeTest:function(t){o=t},results:p,type:"positionTest"}),1==o||0!=o&&0==f&&("window"!=r||d.__options.viewportAware))for(t=0;t=n.outerSize.width&&l.geo.available[r][s].height>=n.outerSize.height?n.fits=!0:n.fits=!1:n.fits=a.fits,"window"==r&&(n.whole=!!n.fits&&("top"==s||"bottom"==s?l.geo.origin.windowOffset.right>=d.__options.minIntersection&&l.geo.window.size.width-l.geo.origin.windowOffset.left>=d.__options.minIntersection:l.geo.origin.windowOffset.bottom>=d.__options.minIntersection&&l.geo.window.size.height-l.geo.origin.windowOffset.top>=d.__options.minIntersection)),p.push(n),n.whole)f=!0;else if("natural"==n.mode&&(n.fits||n.size.width<=l.geo.available[r][s].width))return!1}})}}),d.__instance._trigger({edit:function(t){p=t},event:c,helper:l,results:p,type:"positionTested"}),p.sort(function(t,e){var n,a;return t.whole&&!e.whole?-1:!t.whole&&e.whole?1:t.whole&&e.whole?(n=d.__options.side.indexOf(t.side))<(a=d.__options.side.indexOf(e.side))||!(al.geo.window.size.width-e.size.width&&(l.geo.origin.windowOffset.left+this.__options.minIntersection<=l.geo.window.size.width?e.coord.left=l.geo.window.size.width-e.size.width:e.coord.left=l.geo.origin.windowOffset.left+this.__options.minIntersection+1-e.size.width):e.coord.top<0?0<=l.geo.origin.windowOffset.bottom-this.__options.minIntersection?e.coord.top=0:e.coord.top=l.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:e.coord.top>l.geo.window.size.height-e.size.height&&(l.geo.origin.windowOffset.top+this.__options.minIntersection<=l.geo.window.size.height?e.coord.top=l.geo.window.size.height-e.size.height:e.coord.top=l.geo.origin.windowOffset.top+this.__options.minIntersection+1-e.size.height):(e.coord.left>l.geo.window.size.width-e.size.width&&(e.coord.left=l.geo.window.size.width-e.size.width),e.coord.left<0&&(e.coord.left=0)),d.__sideChange(n,e.side),l.tooltipClone=n[0],l.tooltipParent=d.__instance.option("parent").parent[0],l.mode=e.mode,l.whole=e.whole,l.origin=d.__instance._$origin[0],l.tooltip=d.__instance._$tooltip[0],delete e.container,delete e.fits,delete e.mode,delete e.outerSize,delete e.whole,e.distance=e.distance.horizontal||e.distance.vertical;var t,a=v.extend(!0,{},e);d.__instance._trigger({edit:function(t){e=t},event:c,helper:l,position:a,type:"position"}),d.__options.functionPosition&&(a=d.__options.functionPosition.call(d,d.__instance,l,a))&&(e=a),h.destroy(),a="top"==e.side||"bottom"==e.side?(t={prop:"left",val:e.target-e.coord.left},e.size.width-this.__options.minIntersection):(t={prop:"top",val:e.target-e.coord.top},e.size.height-this.__options.minIntersection),t.vala&&(t.val=a),a=l.geo.origin.fixedLineage?l.geo.origin.windowOffset:{left:l.geo.origin.windowOffset.left+l.geo.window.scroll.left,top:l.geo.origin.windowOffset.top+l.geo.window.scroll.top},e.coord={left:a.left+(e.coord.left-l.geo.origin.windowOffset.left),top:a.top+(e.coord.top-l.geo.origin.windowOffset.top)},d.__sideChange(d.__instance._$tooltip,e.side),l.geo.origin.fixedLineage?d.__instance._$tooltip.css("position","fixed"):d.__instance._$tooltip.css("position",""),d.__instance._$tooltip.css({left:e.coord.left,top:e.coord.top,height:e.size.height,width:e.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(t.prop,t.val),d.__instance._$tooltip.appendTo(d.__instance.option("parent")),d.__instance._trigger({type:"repositioned",event:c,position:e})},__sideChange:function(t,e){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+e)},__targetFind:function(t){var e={},n=this.__instance._$origin[0].getClientRects();return 1'.concat(D.placeholder_content("picture"),"").concat(D.placeholder_content("line"),"
")+(!1!==t?t:"")+""},D.line_placeholder=function(){for(var t=0',n=0;n ';return e+""},D.rectangle_placeholder=function(){var t=0'.concat(D.placeholder_content("picture"),"
")},D.placeholder_content=function(){var t="";switch(0';break;case"line":t='';break;case"circle":t=''}return t},D.exist_tag=function(t){return jQuery(t).length},D.loading_button=function(t){t.classList.add("wps-loading-button")},D.date_picker=function(){var t=jQuery("input[data-wps-date-picker]");t.length&&(t.daterangepicker({singleDatePicker:!0,showDropdowns:!0,minYear:1998,drops:"up",opens:document.getElementById("TB_window")?"center":"right",maxYear:parseInt((new Date).getFullYear()+1),locale:{format:"YYYY-MM-DD"}}),t.on("show.daterangepicker",function(t,e){e=e.container,jQuery(e).addClass(t.target.className)}))},D.formatNumber=function(t){var e=1".concat(D.formatNumber(n[c]),"").concat(d,"%"),f.classList.add("wps-horizontal-bar__data"),p.appendChild(f),u.appendChild(p),(f=document.createElement("div")).classList.add("wps-horizontal-bar__background"),f.style.width=l+"%",u.appendChild(f),s.appendChild(u)}o?r.insertBefore(s,o):r.appendChild(s)}},window.renderHorizontalBar=function(t,e,n,a){D.horizontal_bar(t,e,n,a)},D.chart_id=function(t){return"wp-statistics-"+t+"-meta-box-chart"},D.wordpress_postbox_ajax=function(){var t=0')},D.isIP=function(t){var e="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";return new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"$")).test(t)},D.getLinkParams=function(t){var e=1'+D._("no_result")+""},jQuery(document).ready(function(){var t=document.querySelectorAll(".wps-head-filters__item"),e=(t.forEach(function(n){n.classList.remove("loading"),n.addEventListener("click",function(t){var e=n.querySelector(".dropdown-content");e&&!t.target.classList.contains("disabled")&&e.classList.toggle("show")})}),jQuery(".wps-search-dropdown"));e.on("click",function(t){t.stopPropagation()}),e.on("input",function(){var t=jQuery(this).val().toLowerCase();jQuery(this).parent().find(".dropdown-item").each(function(){-1<(jQuery(this).text()||jQuery(this).innerText).toLowerCase().indexOf(t)?jQuery(this).show():jQuery(this).hide()})}),window.addEventListener("click",function(n){t.forEach(function(t){var e=t.querySelector(".dropdown-content");e&&!t.contains(n.target)&&e.classList.remove("show")})})}),!D.isset(D.global,"request_params","page")||"help-center"!==D.global.request_params.page||(t=document.body).classList.contains(w="statistics_page_wps_help-center_page")||t.classList.add(w),jQuery(document).ready(function(){var t=document.querySelector(".wp-header-end"),e=document.querySelector(".notice.notice-warning.update-nag");t&&e&&t.parentNode.insertBefore(e,t.nextSibling)}),window.renderFormatNum=function(t){return D.formatNumber(t)},D.hex_to_rgba=function(t,e){t=(t=4===(t="string"!=typeof t||"#"!==t[0]||7!==t.length&&4!==t.length?"#3288D7":t).length?"#"+t[1].repeat(2)+t[2].repeat(2)+t[3].repeat(2):t).replace("#","");var n=parseInt(t.substring(0,2),16),a=parseInt(t.substring(2,4),16),t=parseInt(t.substring(4,6),16);return D.rgba_to_hex(n,a,t,e)},D.rgba_to_hex=function(t,e,n,a){return"#"+t.toString(16).padStart(2,"0")+e.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+Math.round(255*a).toString(16).padStart(2,"0")},{total:"#27A765",views:"#7362BF",visitors:"#3288D7","user-visitors":"#3288D7","anonymous-visitors":"#7362BF",published:"#8AC3D0","published-contents":"#8AC3D0","published-products":"#8AC3D0","published-pages":"#8AC3D0","published-posts":"#8AC3D0",posts:"#8AC3D0",downloads:"#3288D7",clicks:"#3288D7",Other1:"#3288D7",Other2:"#7362BF",Other3:"#8AC3D0"}),M=[.1,.3,.5,.7],R=(D.setTooltipPosition=function(t,e,n){var a=e.canvas,e=a.offsetLeft,r=a.offsetTop,o=a.clientHeight,i=n,n=i.caretX,s=t.offsetWidth,c=t.offsetHeight,l=e+n+16,i=r+i.caretY-c/2;(l=e+a.clientWidthr+o&&(i=r+o-c-16),t.style.opacity=1,t.style.left=l+"px",t.style.top=i+"px"},{id:"drawVerticalLine",beforeDatasetDraw:function(t){var e=t,t=e.ctx,n=(_objectDestructuringEmpty(e.scales),e.tooltip),e=e.chartArea,a=e.top,e=e.bottom;n&&n._active&&n._active.length&&(n=n._active[0].element.x,t.beginPath(),t.strokeStyle="#A9AAAE",t.lineWidth=1,t.setLineDash([6,6]),t.moveTo(n,a),t.lineTo(n,e),t.stroke(),t.setLineDash([]))}}),$=function(t){var e={d:"DD",j:"D",S:"Do",n:"M",m:"MM",F:"MMM",M:"MMM",y:"YY",Y:"YYYY"};return t.replace(/([a-zA-Z])/g,function(t){return e[t]||t})},W=function(t,e,n,a,r){return a=a.replace(/\/YYYY|YYYY/g,"").replace(/\/YY|YY/g,"").replace(/[,/\s-]/g," ").trim().replace(/MM|MMM/g,"MMM").replace(/DD|D/g,"D").trim(),"month"===n?(n=a.replace(/\s*D/g,"").replace(/YYYY|YY/g,"").replace(/\/YY|YY/g,"").trim(),moment(t).format(n)):moment(t).format(a)+" to "+moment(e).format(a)},N=function(t,e,n){return n=n.replace(/,?\s?(YYYY|YY)[-/\s]?,?|[-/\s]?(YYYY|YY)[-/\s]?,?/g,""),moment(t).format(n)+" to "+moment(e).format(n)},h={};function s(t){if(this.container=document.querySelector(t),!this.container)throw new Error("Container ".concat(t," not found"))}function n(t){this.settings=_objectSpread({modalSelector:"#wps-modal-filter",formSelector:"#wp_statistics_visitors_filter_form",resetSelector:".wps-modal-reset-filter",filterWrapperSelector:".wps-modal-filter-form",filterContainerSelector:".filter-select, .filter-input",width:430,height:510,onSubmit:null,onOpen:null,onLoadFilter:null,fields:{}},t),this.formSelector=this.settings.formSelector,this.memoryCache=null,this.filterWrapperSelector=this.settings.filterWrapperSelector,this.filterContainerSelector=this.settings.filterContainerSelector,this.onlySearchableFields=!1,this.fieldTypes=Object.fromEntries(Object.entries(this.settings.fields).map(function(t){var t=_slicedToArray(t,2),e=t[0],t=t[1];return t.name&&"page"!==t.name?[t.name,{type:t.type,key:e}]:null}).filter(Boolean)),this.fieldTypes=Object.keys(this.fieldTypes),this.initModal()}function a(t){this.settings=_objectSpread({fields:{}},t),this.sourceCache={},this.memoryCache=null,this.predefinedCache={},this.init()}D.new_line_chart=function(s,c){var t=2').concat(e.toLocaleString(),""):"",o.innerHTML="".concat(n.label,'').concat(t.toLocaleString(),"
").concat(i,"
"),(s=o.querySelector(".current-data")).addEventListener("click",function(){var t=l.getDatasetMeta(a);t.hidden=!t.hidden,s.classList.toggle("wps-line-through"),l.update()}),(c=o.querySelector(".previous-data"))&&null!==r&&c.addEventListener("click",function(){var t=l.data.datasets.find(function(t,e){return t.label===d[a].label+" (Previous)"&&l.getDatasetMeta(e)});t&&(t=l.data.datasets.indexOf(t),(t=l.getDatasetMeta(t)).hidden=!t.hidden,c.classList.toggle("wps-line-through"),t=h.querySelectorAll(".previous-data"),t=Array.from(t).every(function(t){return t.classList.contains("wps-line-through")}),p&&(t?p.classList.add("wps-line-through"):p.classList.remove("wps-line-through")),l.update())}),h.appendChild(o))})),S.update()}var l=document.getElementById(c).getContext("2d"),d=(Object.keys(s.data.datasets).forEach(function(t,e){var n,a=T[s.data.datasets[t].slug]||T["Other"+(e+1)],r=M[e%M.length];e={type:n="performance"===f&&2===e?"bar":"line",label:s.data.datasets[t].label,data:s.data.datasets[t].data,backgroundColor:a,hoverBackgroundColor:a,hoverPointBackgroundColor:a,yAxisID:"bar"==n?"y1":"y"},"line"==n&&(e.borderColor=a,e.fill=!1,e.borderWidth=2,e.pointRadius=0,e.pointBorderColor="transparent",e.pointBackgroundColor=a,e.pointBorderWidth=2,e.hoverPointRadius=6,e.hoverPointBorderColor="#fff",e.hoverPointBorderWidth=4,e.tension=r,e.hitRadius=10),o.push(e)}),null!=s&&s.previousData&&Object.keys(s.previousData.datasets).forEach(function(t,e){var n=T[s.previousData.datasets[t].slug]||T["Other"+e],e=M[e%M.length];o.push({type:"line",label:s.previousData.datasets[t].label+" (Previous)",data:s.previousData.datasets[t].data,borderColor:D.hex_to_rgba(n,.7),hoverBorderColor:n,backgroundColor:n,fill:!1,yAxisID:"y",borderWidth:1,borderDash:[5,5],pointRadius:0,pointBorderColor:"transparent",pointBackgroundColor:n,pointBorderWidth:2,hoverPointRadius:6,hoverPointBorderColor:"#fff",hoverPointBackgroundColor:n,hoverPointBorderWidth:4,tension:e,hitRadius:10})}),{maintainAspectRatio:!1,resizeDelay:200,animation:{duration:0},responsive:!0,interaction:{intersect:!1,mode:"index"},plugins:{legend:!1,tooltip:{enabled:!1,external:function(t){return I(t,_,k,j,C,E,_.previousData?_.previousData.labels:[])},unitTime:n}},scales:{x:{offset:a,grid:{display:!1,drawBorder:!1,tickLength:0,drawTicks:!1},border:{color:"transparent",width:0},ticks:{align:"inner",autoSkip:!0,maxTicksLimit:m?"week"==n?2:4:"week"==n?3:"month"==n?7:9,font:{color:"#898A8E",style:"italic",weight:"lighter",size:m?"week"==n?9:11:"week"==n?11:13},padding:8}},y:{min:0,suggestedMax:4,ticks:{autoSkip:!0,maxTicksLimit:m?4:7,fontColor:"#898A8E",fontSize:13,fontStyle:"italic",fontWeight:"lighter",padding:8,lineHeight:15,callback:renderFormatNum},afterBuildTicks:A,border:{color:"transparent",width:0},type:"linear",position:"right",grid:{display:!0,tickMarkLength:0,drawBorder:!1,tickColor:"#EEEFF1",color:"#EEEFF1"},gridLines:{drawTicks:!1},title:{display:!1}}}}),S=("performance"===f&&2 element provided.");a&&((t=document.createElement("option")).value=r||"",t.textContent=a,t.selected=!0,n.appendChild(t)),0",n.innerHTML=c,t.searchable&&this.enableSearchableDropdown()):console.warn("Container ".concat(t.containerSelector," not found.")):console.warn("Invalid filter configuration provided for dropdown.")},s.prototype.getFilterName=function(t,e){var n=t,a=n.selectedOption;return(t=n.args.find(function(t){return t.slug===a}))?t.name:e},s.prototype.enableSearchableDropdown=function(){document.querySelectorAll(".wps-search-dropdown").forEach(function(t){t.addEventListener("click",function(t){t.stopPropagation()}),t.addEventListener("input",function(){var n=this.value.toLowerCase();this.parentElement.querySelectorAll("a").forEach(function(t){var e=t.textContent.toLowerCase();t.style.display=e.includes(n)?"block":"none"})})})},n.prototype.initModal=function(){var t,e,n=document.querySelector("#wps-modal-filter-popup");n||((n=document.createElement("div")).id="wps-modal-filter-popup",n.style.display="none",n.setAttribute("dir",document.documentElement.dir||"ltr"),(t=document.createElement("form")).id=this.settings.formSelector.replace("#",""),t.method="get",t.action=D.global.admin_url+"admin.php",(e=document.createElement("div")).id=this.settings.filterWrapperSelector.replace("#",""),e.className="wps-modal-filter-form",t.appendChild(e),n.appendChild(t),document.body.appendChild(n)),this.init()},n.prototype.bindOnLoadFilter=function(){var t=this;jQuery(document).ready(function(){"function"==typeof t.settings.onLoadFilter?t.settings.onLoadFilter(t.filterWrapperSelector):t.generateFields()})},n.prototype.init=function(){var t=this;jQuery(document).on("click",this.settings.modalSelector,this.onFilterButtonClick.bind(this)),jQuery(document).on("submit",this.settings.formSelector,this.onFormSubmit.bind(this)),jQuery(document).on("click",this.settings.resetSelector,this.onResetFilterClick.bind(this)),this.bindOnLoadFilter(),jQuery(document).on("tb_unload",function(){t.cleanup()})},n.prototype.initializeSelect2Elements=function(t){t.each(function(t,e){function r(n){return new Promise(function(t){var e=new Image;e.onload=function(){return t(!0)},e.onerror=function(){return t(!1)},e.src=n})}function n(){o.hasClass("select2-hidden-accessible")&&o.select2("destroy"),s?o.select2({escapeMarkup:function(t){return t},templateResult:function(t){var e,n;return!t.id||t.loading?t.text:(e=t.id.toLowerCase().replace(/ /g,"_"),n=jQuery('
').concat(t.text,"")),c(e).then(function(t){n.find("img").attr("src",t)}),n)},templateSelection:function(t){var e,n;return t.id?(e=t.id.toLowerCase().replace(/ /g,"_"),n=jQuery('
').concat(t.text,"")),c(e).then(function(t){n.find("img").attr("src",t)}),n):t.text}}):o.select2(),o.find("option").length,o.trigger("change")}var a,o=jQuery(e),i=o.attr("name"),s=i?"agent"===(e=i.toLowerCase())?"browser":"platform"===e?"operating-system":"location"===e?"flags":null:null,c=(()=>{var e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var n,a;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e&&s?(n="".concat(D.global.assets_url,"/images/").concat(s,"/")+e,a=D.global.assets_url+"/images/flags/000.svg","all"!==e?t.next=7:(t.t1=a,t.next=24)):t.next=27;break;case 7:return e=n+".svg",t.next=10,r(e);case 10:t.sent?(t.t2=e,t.next=23):t.next=14;break;case 14:return e=n+".png",t.next=17,r(e);case 17:t.sent?(t.t3=e,t.next=22):t.next=21;break;case 21:t.t3=a;case 22:t.t2=t.t3;case 23:t.t1=t.t2;case 24:t.t0=t.t1,t.next=28;break;case 27:t.t0=D.global.assets_url+"/images/flags/000.svg";case 28:return t.abrupt("return",t.t0);case 29:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})();s&&(0=a&&clearInterval(o)},3'),!0;this.settings.onSubmit(t)},n.prototype.onResetFilterClick=function(t){var e;t.preventDefault(),this.setLoading("reset"),"function"==typeof this.settings.onReset?this.settings.onReset():(e=new URL(window.location.href),this.fieldTypes.forEach(function(t){e.searchParams.delete(t)}),window.location.href=e.toString(),this.toggleResetButton())},n.prototype.toggleResetButton=function(){var e,t=jQuery(this.settings.resetSelector);t.length&&(e=new URLSearchParams(window.location.search),this.fieldTypes.some(function(t){return e.has(t)&&""!==e.get(t).trim()})?t.removeAttr("disabled"):t.attr("disabled","disabled"))},n.prototype.setLoading=function(){("reset"===(0=o.length||(o.forEach(function(t){return t.classList.remove("wps-modal__premium-step--active")}),l&&0_createClass(function t(){_classCallCheck(this,t),this.init()},[{key:"init",value:function(){var n=this;document.addEventListener("click",function(t){var e=t.target.closest('[class*="js-openModal-"]');(e=e&&n.extractModalIdFromClass(e.classList))&&n.openModal(e),(e=t.target.closest("button[data-action]"))&&(t=e.getAttribute("data-action"))&&(e=e.closest(".wps-modal"),n.handleModalAction(e,t))}),this.attachOpenEvent(),this.attachCloseEvent()}},{key:"attachOpenEvent",value:function(){var e=this;document.addEventListener("click",function(t){(t=(t=t.target.closest('[class*="js-openModal-"]'))&&e.extractModalIdFromClass(t.classList))&&e.openModal(t)})}},{key:"extractModalIdFromClass",value:function(t){var e,n=_createForOfIteratorHelper(t);try{for(n.s();!(e=n.n()).done;){var a=e.value;if(a.startsWith("js-openModal-"))return a.replace("js-openModal-","").toLowerCase()}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"openModal",value:function(t){var e=document.getElementById(t);e?e.classList.add("wps-modal--open"):console.error('Modal with ID "'.concat(t,'" not found.'))}},{key:"attachCloseEvent",value:function(){document.addEventListener("click",function(t){(t=(t=t.target.closest(".wps-modal__close"))&&t.closest(".wps-modal"))&&t.classList.remove("wps-modal--open")})}},{key:"handleModalAction",value:function(t,e){switch(e){case"resolve":break;case"closeModal":this.closeModal(t);break;default:console.warn("Unknown action:",e)}}},{key:"closeModal",value:function(t){t.classList.remove("wps-modal--open")}}]))()),jQuery(document).ready(function(){function n(){var t=document.querySelector(".wps-notification-sidebar__tab--active");t&&("tab-2"===t.dataset.tab?d&&(d.style.display="none"):(t=0'),jQuery(this.container).append(this.spinnerElement)),this.spinnerElement.show()},ot.prototype.hide=function(){this.spinnerElement&&this.spinnerElement.hide()};var it,st,ct,lt,dt,ut,pt,ht,_,m,ft,_t,mt,gt,yt,wt,g,y,t=document.querySelector(".wps-admin-column__unlock"),w=document.querySelector(".wp-list-table"),r=(t&&w&&w.classList.add("wps-admin-mini-chart__unlock"),D.sanitize_meta_box_name=function(t){return t.replace(new RegExp("-","g"),"_")},D.get_meta_box_method=function(t){return this.sanitize_meta_box_name(t)+"_meta_box"},D.getMetaBoxKey=function(t){return"wp-statistics-"+t+"-widget"},D.no_meta_box_data=function(){return''+D._("no_data")+"
"},D.error_meta_box_data=function(t){if(void 0!==t)try{var e=JSON.parse(t);if(D.isset(e,"message"))return''+e.message+"
"}catch(e){console.log("An unexpected error occurred: ",t,e)}return''+D._("rest_connect")+"
"},D.get_meta_box_info=function(t){return t in D.global.meta_boxes?D.global.meta_boxes[t]:[]},D.meta_box_lang=function(t,e){return e in D.global.meta_boxes[t].lang?D.global.meta_boxes[t].lang[e]:""},D.meta_box_inner=function(t){return"#"+D.getMetaBoxKey(t)+" div.inside"},D.meta_box_name_by_id=function(t){return t.split("statistics-").pop().split("-widget")[0]},D.meta_box_button=function(t){var e="#"+D.getMetaBoxKey(t)+" .handle-actions button:first",n=(D.get_meta_box_info(t),"right");D.is_active("rtl")&&(n="left"),jQuery("#"+D.getMetaBoxKey(t)+" button[class*=wps-refresh]").remove(),jQuery('').insertBefore(e),D.is_active("gutenberg")&&jQuery("body").addClass("wps-gutenberg"),jQuery("#"+D.getMetaBoxKey(t)+" .hndle, #"+D.getMetaBoxKey(t)+" .handlediv").on("click",function(){jQuery(this).closest(".postbox").addClass("handle")})},D.meta_box_tooltip=function(t){var e,n="#"+D.getMetaBoxKey(t)+" h2.hndle";(t=D.get_meta_box_info(t)).hasOwnProperty("description")&&(jQuery(n).text(),e='',t)&&jQuery(n).append(e)},D.run_meta_box=function(t){var e,n,a=1
",document.body.appendChild(i))}()}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}),window.onload=function(){var t,e=document.querySelector(".wps-alert__close"),n=(e&&(t=e.closest(".wps-alert"))&&e.addEventListener("click",function(){t.remove()}),document.querySelector(".wps-gototop"));n&&(n.addEventListener("click",function(){window.scrollTo({top:0,behavior:"smooth"})}),window.addEventListener("scroll",function(){100{if(t=new RegExp("[?&]"+t+"=([^]*)").exec(window.location.href))return t[1]})("tab"))&&Yt(w),jQuery(".wp-statistics-settings .wps-optionsMenu .wps-optionsMenuItem").click(function(){Yt(jQuery(this).attr("data-tab"))}),g=document.querySelector('input[name="user_custom_header_ip_method"]'),y=document.getElementById("custom-header"),g)&&y&&(y.addEventListener("change",function(){y.checked&&g.focus()}),g.addEventListener("click",t),g.addEventListener("paste",t),g.addEventListener("input",t),g.addEventListener("dragover",t),g.addEventListener("drop",t));document.querySelectorAll(".wps-input-group__copy").forEach(function(e){e.addEventListener("click",function(){var t=this.closest(".wps-input-group__action").querySelector("input");navigator.clipboard&&navigator.clipboard.writeText&&navigator.clipboard.writeText(t.value).then(function(){var t=e.textContent;e.textContent=D._("copied"),e.classList.remove("has-icon"),setTimeout(function(){e.textContent=t,e.classList.add("has-icon")},2e3)}).catch(function(t){console.error("Failed to copy: ",t)})})});w=jQuery(".wps-wrap__settings select");w.length&&w.select2({dropdownCssClass:"wps-setting-input__dropdown",minimumResultsForSearch:1/0});var Pt,qt,At,t=new URLSearchParams(window.location.search).get("row");t&&((Pt=document.querySelector('tr[data-id="'.concat(t,'"]')))?setTimeout(function(){Pt.scrollIntoView({behavior:"smooth",block:"center"}),Pt.classList.add("wps-highlight")},500):console.log('No row found with data-id="'.concat(t,'"'))),D.isset(D.global,"request_params","page")&&"settings"===D.global.request_params.page&&(jQuery("#wp-statistics-settings-form ul.tabs li").click(function(t){t.preventDefault(),t=u(this).attr("data-tab"),"undefined"!=typeof localStorage&&localStorage.setItem("wp-statistics-settings-active-tab",t)}),"undefined"!=typeof localStorage&&D.isset(D.global,"request_params","save_setting")&&"yes"===D.global.request_params.save_setting&&(w=localStorage.getItem("wp-statistics-settings-active-tab"))&&0_createClass(function t(){_classCallCheck(this,t),this.initialize()},[{key:"initialize",value:function(){var i=this;document.querySelectorAll('[class^="js-wps-show_if_"]').forEach(function(o){function n(){var t,a=0,r=0;e.forEach(function(t){var e,n;t.includes("_enabled")||t.includes("_disabled")?(a++,n=i.extractId(o),(n=document.querySelector("#"+n)||document.querySelector("#wps_settings\\[".concat(n,"\\]")))&&"checkbox"===n.type&&(n.checked&&t.includes("_enabled")||!n.checked&&t.includes("_disabled"))&&r++):t.includes("_equal_")&&(a++,n=(e=i.extractIdAndValue(t)).id,t=e.value,n)&&t&&(n=document.querySelector("#wps_settings\\[".concat(n,"\\]")))&&"select-one"===n.type&&n.value===t&&r++}),0