'use strict';var i=class n{static decycle(e,t=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(t.includes(e))return null;let r=t.concat([e]);return Array.isArray(e)?e.map(a=>n.decycle(a,r)):Object.fromEntries(Object.entries(e).map(([a,c])=>[a,n.decycle(c,r)]))}static stringify(e,t=false){return typeof e=="string"?e:JSON.stringify(t!==false?n.decycle(e):e)}static isJSON(e){if(typeof e!="string")return  false;let t=e.trim();if(t.length===0)return  false;let r=t[0];if(r!=="{"&&r!=="[")return  false;try{let a=JSON.parse(t);return a!==null&&typeof a=="object"}catch(a){return  false}}static parse(e,t){if(typeof e=="string")try{e=JSON.parse(e,t);}catch(r){return e}if(e&&typeof e=="object")for(let r in e){let a=e[r];n.isJSON(a)&&(e[r]=n.parse(a,t));}return e}};exports.JsonHelper=i;