1try{ 2function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,o){if(t){if("string"==typeof t)return e(t,o);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,o):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,r=Array(e);o<e;o++)r[o]=t[o];return r}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var r=function(){PostViewsCounterPro={args:{},crawlerDetect:null,bootstrapPromise:null,countPromise:null,init:function(t){if(this.args=t,"undefined"!=typeof PostViewsCounterCrawlerDetect&&(t.blockAI||t.blockBots)){if(this.crawlerDetect=new PostViewsCounterCrawlerDetect,t.blockBots&&this.crawlerDetect.isCrawler())return void this.log("Crawler detected, skipping view count.");if(t.blockAI&&(this.crawlerDetect.isAIBot()||this.crawlerDetect.isLikelyBot()))return void this.log("AI Bot detected, skipping view count.")}var e=this.collectTargets(),o=!0===t.contentActive&&Object.prototype.hasOwnProperty.call(t.content||{},"type")&&!1!==t.content.type,r=o&&"rest_api"===t.mode;if(o&&"rest_api"!==t.mode&&this.doCount(),"string"==typeof t.runtimeURL&&""!==t.runtimeURL){if(0===e.size&&!r)return;e.size>0&&this.setLoadingState(e),this.bootstrapPromise=this.bootstrap(e,r)}else e.size>0&&(this.setLoadingState(e),this.legacyLoadViews(e)),r&&"string"==typeof t.nonce&&""!==t.nonce&&this.doCount(t.nonce)},collectTargets:function(){for(var t=new Map,e=document.getElementsByClassName("post-views"),o=0;o<e.length;o++){var r=e[o];if(r.classList.contains("load-dynamic")){var n=this.readTarget(r);if(null!==n){var a=n.type+"-"+n.id;t.has(a)?t.get(a).elements.push(r):t.set(a,{type:n.type,id:parseInt(n.id,10),elements:[r]})}else this.markError([r])}}return t},readTarget:function(t){var e=t.getAttribute("data-pvc-type"),o=t.getAttribute("data-pvc-id");if(null!==e&&null!==o&&/^(post|term|user)$/.test(e)&&/^\d+$/.test(o))return{type:e,id:o};var r=t.className.match(/(?:^|\s)(post|term|user)-(\d+)(?=\s|$)/);return null!==r?{type:r[1],id:r[2]}:null},setLoadingState:function(t){t.forEach(function(t){t.elements.forEach(function(t){t.classList.add("loading"),t.classList.remove("loaded","load-error"),t.setAttribute("aria-busy","true")})})},bootstrap:function(t,e){var r=this,n=[];t.forEach(function(t){n.push({type:t.type,id:t.id})});var a={action:"pvcp-runtime",targets:JSON.stringify(n)};return fetch(this.args.runtimeURL,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Cache-Control":"no-store"},body:this.prepareRequestData(a),mode:"same-origin",cache:"no-store",credentials:"same-origin",keepalive:!1}).then(function(t){if(!t.ok)throw new Error("HTTP "+t.status);if(-1===(t.headers.get("Content-Type")||"").indexOf("application/json"))throw new Error("Unexpected content type");return t.json()}).then(function(n){if(!n||"object"!==o(n)||!0!==n.success||!n.data||"object"!==o(n.data))throw new Error("Invalid response");var a=n.data.counts&&"object"===o(n.data.counts)?n.data.counts:{};if(r.applyCounts(t,a),e){var i=(n.data.runtime&&"object"===o(n.data.runtime)?n.data.runtime:{}).restNonce;if("string"==typeof i&&""!==i)return r.doCount(i);r.log("Missing runtime nonce, counting skipped.")}}).catch(function(e){r.failSafe(t),r.log("Runtime request failed.",e)})},applyCounts:function(t,e){var o=this;t.forEach(function(t,r){var n=Object.prototype.hasOwnProperty.call(e,r)?e[r]:null;n&&"string"==typeof n.formatted&&""!==n.formatted?t.elements.forEach(function(t){var e=t.querySelector(".post-views-count");e&&(e.textContent=n.formatted),t.classList.add("loaded"),t.classList.remove("loading","load-error"),t.removeAttribute("aria-busy")}):(o.markError(t.elements),o.log("Missing display value for "+r+"."))})},failSafe:function(t){var e=this;t.forEach(function(t){e.markError(t.elements)})},markError:function(t){t.forEach(function(t){t.classList.remove("loading"),t.classList.add("loaded","load-error"),t.removeAttribute("aria-busy")})},legacyLoadViews:function(t){var e=this;"string"==typeof this.args.adminAjax&&""!==this.args.adminAjax&&"string"==typeof this.args.nonceCount&&""!==this.args.nonceCount?t.forEach(function(t,o){var r={action:"pvcp-views-count",pvcp_nonce:e.args.nonceCount,type:t.type,ID:t.id};fetch(e.args.adminAjax,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Cache-Control":"no-store"},body:e.prepareRequestData(r),mode:"same-origin",cache:"no-cache",credentials:"same-origin",keepalive:!1}).then(function(t){if(!t.ok)throw new Error("HTTP "+t.status);return t.text()}).then(function(o){"string"==typeof o&&""!==o.trim()?t.elements.forEac
2h(function(t){var e=t.querySelector(".post-views-count");e&&(e.textContent=o),t.classList.add("loaded"),t.classList.remove("loading","load-error"),t.removeAttribute("aria-busy")}):e.markError(t.elements)}).catch(function(r){e.markError(t.elements),e.log("Legacy display failed for "+o+".",r)})}):this.failSafe(t)},doCount:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=this.args;if(!0===e.contentActive&&Object.prototype.hasOwnProperty.call(e.content||{},"type")&&!1!==e.content.type){var o={subtype:e.content.subtype,referrer:document.referrer},r="pvc_visits".concat("post"===e.content.type?"":"_".concat(e.content.type)).concat(!1!==e.multisite?"_".concat(parseInt(e.multisite)):"");if("cookieless"===e.dataStorage&&this.isLocalStorageAvailable()?(o.storage_type="cookieless",o.storage_data=this.readStorageData(r),o.storage_data_all=JSON.stringify(this.readAllStorageData("cookieless"))):(o.storage_type="cookies",o.storage_data=this.readCookieData(r),o.storage_data_all=JSON.stringify(this.readAllStorageData("cookies"))),"rest_api"===e.mode){if("string"!=typeof t||""===t)return void this.log("Missing REST nonce, counting skipped.");this.countPromise=this.request(e.requestURL,o,"POST",{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Cache-Control":"no-store","X-WP-Nonce":t},r)}else o.action="pvcp-check-post",o.content=e.content.data,o.type=e.content.type,this.countPromise=this.request(e.requestURL,o,"POST",{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Cache-Control":"no-store"},r);return this.countPromise}},request:function(t,e,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i={method:r,headers:n,mode:"same-origin",cache:"no-cache",credentials:"same-origin",keepalive:!0};switch(r){case"HEAD":case"GET":break;default:i.body=this.prepareRequestData(e)}var s=this;return fetch(t,i).then(function(t){if(!t.ok)throw Error(t.statusText);return t.json()}).then(function(t){try{if("object"===o(t)&&null!==t)if("success"in t&&!1===t.success)s.log("Count request error.");else{var e="string"==typeof t.effective_type&&""!==t.effective_type?t.effective_type:t.type;"cookieless"===s.args.dataStorage?s.saveStorageData(a,t.storage,e):s.saveCookieData(a,t.storage),s.triggerEvent("pvcCheckPost",t)}else s.log("Invalid count response object.")}catch(r){s.log("Invalid count JSON data.",r)}}).catch(function(t){s.log("Invalid count response.",t)})},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;"undefined"!=typeof console&&"function"==typeof console.log&&(e&&"string"==typeof e.message?console.log("PVC Pro: "+t+" ("+e.message+")"):console.log("PVC Pro: "+t))},prepareRequestData:function(t){return Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&").replace(/%20/g,"+")},triggerEvent:function(t,e){var o=new CustomEvent(t,{bubbles:!0,detail:e});document.dispatchEvent(o)},getCookiePath:function(){var t="string"==typeof this.args.path?this.args.path.trim():"";if(!t||"/"===t)return"/";var e=t.replace(/\/{2,}/g,"/").replace(/^\/+|\/+$/g,"");return e?"/".concat(e,"/"):"/"},saveStorageData:function(t,e,r){if(e&&"object"===o(e))if(Object.prototype.hasOwnProperty.call(e,"version")){var n=JSON.stringify(e);this.getStorageNames().forEach(function(t){window.localStorage.setItem(t,n)})}else Object.prototype.hasOwnProperty.call(e,r)&&window.localStorage.setItem(t,JSON.stringify(e[r]))},getStorageNames:function(){var t=!1!==this.args.multisite?"_".concat(parseInt(this.args.multisite,10)):"";return(Array.isArray(this.args.storageBuckets)&&this.args.storageBuckets.length>0?this.args.storageBuckets:["post","term","user","other"]).map(function(e){return"pvc_visits".concat("post"===e?"":"_".concat(e)).concat(t)})},readAllStorageData:function(t){var e=this,o=this.getStorageNames(),r=Array.isArray(this.args.storageBuckets)&&this.args.storageBuckets.length>0?this.args.storageBuckets:["post","term","user","other"],n={};return r.forEach(function(r,a){var i=o[a];n[r]="cookies"===t?e.readCookieData(i):e.readStorageData(i)}),n},readStorageData:function(t){var e=null;return null===(e=window.localStorage.getItem(t))&&(e=""),e},saveCookieData:function(e,o){var r=this;if(Object.prototype.hasOwnProperty.call(o,"name")){var n=t(new Set(o.name.map(function(t){return t.replace(/\[\d+\]$/,"")}))),a="";"https:"===document.location.protocol&&(a=";
2secure"),n.forEach(function(t){document.cookie.split(";").forEach(function(e){var o=e.split("=")[0];if(void 0!==o){var n=o.trim();new RegExp("^".concat(t,"\\[(\\d+)\\]$")).test(n)&&(document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path="+r.getCookiePath()+";domain="+r.args.domain+a+";SameSite=Lax")}})});for(var i=0;i<o.name.length;i++){var s=new Date,c=parseInt(o.expiry[i]),u=o.value[i];"string"!=typeof u&&(u=String(null!=u?u:"")),c?c*=1e3:c=s.getTime()+864e5,s.setTime(c),document.cookie=o.name[i]+"="+encodeURIComponent(u)+";expires="+s.toUTCString()+";path="+this.getCookiePath()+";domain="+this.args.domain+a+";SameSite=Lax"}}},readCookieData:function(t){var e=[];document.cookie.split(";").forEach(function(o){if(o&&o.trim()){var r=o.split("="),n=r[0],a=r.slice(1).join("=");if(n){var i=n.trim(),s=new RegExp("^".concat(t,"\\[(\\d+)\\]$")),c=i.match(s);if(c){var u=a||"";try{u=decodeURIComponent(u)}catch(l){u=a||""}e.push({index:parseInt(c[1],10),value:u})}}}}),e.sort(function(t,e){return t.index-e.index});var r=e.map(function(t){return t.value||""}),n=r.join("");if(n)try{var a=JSON.parse(n);if(a&&"object"===o(a)&&1===a.version)return n}catch(i){}return r.join("a")},isLocalStorageAvailable:function(){var t;try{return(t=window.localStorage).setItem("__pvcStorageTest",0),t.removeItem("__pvcStorageTest"),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length}},readConfig:function(){var t=document.getElementById("pvcp-frontend-config");if(t&&"string"==typeof t.textContent&&""!==t.textContent)try{var e=JSON.parse(t.textContent);if(e&&"object"===o(e))return e}catch(r){}return"undefined"!=typeof pvcpArgsFrontend&&pvcpArgsFrontend&&"object"===("undefined"==typeof pvcpArgsFrontend?"undefined":o(pvcpArgsFrontend))?pvcpArgsFrontend:null},revealAll:function(){for(var t=document.getElementsByClassName("post-views"),e=[],o=0;o<t.length;o++)t[o].classList.contains("load-dynamic")&&e.push(t[o]);this.markError(e)}};var e=PostViewsCounterPro.readConfig();if(null===e)return PostViewsCounterPro.revealAll(),void PostViewsCounterPro.log("Missing or invalid configuration.");PostViewsCounterPro.init(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r,{once:!0}):r() 3}catch(e){console.error("An error has occurred. [ File: https://www.student.si/wp-content/plugins/post-views-counter-pro/js/frontend.js?ver=1.7.16 ] [ "+e.stack+" ]");}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.