/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/java-properties@1.0.2/dist-node/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.of=exports.PropertiesFile=void 0;var _fs=_interopRequireDefault(require("fs"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}class PropertiesFile{constructor(...t){this.objs={},t.length&&this.of.apply(this,t)}makeKeys(t){if(t&&0!==t.indexOf("#")){let e=["=",":"].map((e=>t.indexOf(e))).filter((t=>t>-1)),s=Math.min(...e),r=t.substring(0,s).trim(),i=t.substring(s+1).trim();if(this.objs.hasOwnProperty(r))if(Array.isArray(this.objs[r]))this.objs[r].push(i);else{let t=this.objs[r];this.objs[r]=[t,i]}else{const t=i.replace(/"/g,'\\"').replace(/\\:/g,":").replace(/\\=/g,"=");this.objs[r]=unescape(JSON.parse('"'+t+'"'))}}}addFile(t){let e=_fs.default.readFileSync(t,"utf-8").split(/\r?\n/),s=this;for(let t=0;t<e.length;t++){let r=e[t];for(;"\\"===r.substring(r.length-1);){r=r.slice(0,-1),r+=e[t+1].trim(),t++}s.makeKeys(r)}}of(...t){for(let e=0;e<t.length;e++)this.addFile(t[e])}get(t,e){if(this.objs.hasOwnProperty(t)){if(Array.isArray(this.objs[t])){let e=[];for(let s=0;s<this.objs[t].length;s++)e[s]=this.interpolate(this.objs[t][s]);return e}return void 0===this.objs[t]?"":this.interpolate(this.objs[t])}return e}getLast(t,e){if(this.objs.hasOwnProperty(t)){if(Array.isArray(this.objs[t])){var s=this.objs[t].length;return this.interpolate(this.objs[t][s-1])}return void 0===this.objs[t]?"":this.interpolate(this.objs[t])}return e}getFirst(t,e){return this.objs.hasOwnProperty(t)?Array.isArray(this.objs[t])?this.interpolate(this.objs[t][0]):void 0===this.objs[t]?"":this.interpolate(this.objs[t]):e}getInt(t,e){let s=this.getLast(t);return s?parseInt(s,10):e}getFloat(t,e){let s=this.getLast(t);return s?parseFloat(s):e}getBoolean(t,e){let s=this.getLast(t);return s?!/^(false|0)$/i.test(r=s)&&!!r:e||!1;var r}set(t,e){this.objs[t]=e}interpolate(t){let e=this;return t.replace(/\\\\/g,"\\").replace(/\$\{([A-Za-z0-9\.\-\_]*)\}/g,(function(t){return e.getLast(t.substring(2,t.length-1))}))}getKeys(){let t=[];for(let e in this.objs)t.push(e);return t}getMatchingKeys(t){let e=[];for(let s in this.objs)-1!==s.search(t)&&e.push(s);return e}reset(){this.objs={}}}exports.PropertiesFile=PropertiesFile;let of=function(...t){let e=new PropertiesFile;return e.of.apply(e,t),e};exports.of=of;
//# sourceMappingURL=/sm/d34bc61226b19b2edf401e8eb3b64b9b66dfaadbc17e559146a624423ccad353.map