PageSourceSearch

https://incontextsolutions.com/wp-content/plugins/pixfort-core/dis…/nonce-manager.a9a95ebe8ca5b092ea81.js

js incontextsolutions.com collected 2026-09-25 19:12:35 UTC 2,365 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpixfort_core=self.webpackChunkpixfort_core||[]).push([[6450],{5886(e,t,s){s.d(t,{default:()=>o});const r="pixfort_nonces";const n=new class{constructor(){this.ajaxUrl=PIX_JS_OPTIONS.dataAjaxBase,this.nonces=this.readCache(),this.loadingPromise=null}async makeRequest({action:e,nonceKey:t,data:s={},url:r=this.ajaxUrl,method:n="GET",success:o,error:a,complete:i}){try{let a;for(let c=0;c<2;c++){const h=(await this.ensureNoncesLoaded(c>0))[t];if(!h)throw new Error(`Nonce not found for key: ${t}`);if(a=await this.request(r,n,{action:e,nonce:h,...s}),!this.isNonceFailure(a))return"function"==typeof o&&o(a),"function"==typeof i&&i(a),a}throw new Error(this.getErrorMessage(a,"Nonce verification failed after refresh"))}catch(e){throw"function"==typeof a&&a(e),"function"==typeof i&&i(null,e),e}}async ensureNoncesLoaded(e=!1){if(e)this.clearCache();else if(Object.keys(this.nonces).length)return this.nonces;return this.loadingPromise||(this.loadingPromise=this.fetchNonces().finally(()=>{this.loadingPromise=null})),this.loadingPromise}async fetchNonces(){const e=await this.request(this.ajaxUrl,"POST",{action:"pix_get_nonces",_pix_nonce_refresh:Date.now()});if(!e?.success||!e.data||"object"!=typeof e.data)throw new Error("Invalid nonces response format");return this.nonces=e.data,this.writeCache(),this.nonces}isNonceFailure(e){if(!1!==e?.success)return!1;if("invalid_nonce"===e.data?.code)return!0;const t=this.getErrorMessage(e,"").toLowerCase();return["verification error","invalid security token","invalid nonce"].some(e=>t.includes(e))}getErrorMessage(e,t){return"string"==typeof e?.data?e.data:e?.data?.message||t}request(e,t,s){return new Promise((r,n)=>{jQuery.ajax({url:e,type:t.toUpperCase(),data:s,dataType:"json",cache:!1}).done(r).fail((e,t,s)=>{n(new Error(`AJAX Error: ${t} - ${s}`))})})}readCache(){try{const e=JSON.parse(sessionStorage.getItem(r));if(e?.expiry>Date.now()&&e.nonces)return e.nonces}catch(e){}return this.removeCache(),{}}writeCache(){try{sessionStorage.setItem(r,JSON.stringify({nonces:this.nonces,expiry:Date.now()+36e5}))}catch(e){}}removeCache(){try{sessionStorage.removeItem(r)}catch(e){}}clearCache(){this.nonces={},this.removeCache()}refreshNonces(){return this.ensureNoncesLoaded(!0)}};window.pixAjaxRequest=e=>n.makeRequest(e),window.pixRefreshNonces=()=>n.refreshNonces();const o=n}}]);

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.