generated from jsonicjs/jsonc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathini.min.js
1 lines (1 loc) · 53 KB
/
ini.min.js
1
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JsonicIni=e()}}((function(){var e={exports:{}};(function(t){(function(){!function(n){"object"==typeof e.exports?e.exports=n():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).JsonicHoover=n()}((function(){var e={exports:{}};(function(t){(function(){!function(n){"object"==typeof e.exports?e.exports=n():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).Jsonic=n()}((function(){var e=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},t=e((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.values=t.keys=t.omap=t.isarr=t.entries=t.defprop=t.assign=t.S=t.JsonicError=void 0,t.badlex=function(e,t,n){let r=e.next.bind(e);return e.next=(e,l,i,o)=>{let s=r(e,l,i,o);if(t===s.tin){let t={};throw null!=s.use&&(t.use=s.use),new p(s.why||d.unexpected,t,s,e,n)}return s},e},t.charset=S,t.clean=I,t.clone=function(e){return g(Object.create(Object.getPrototypeOf(e)),e)},t.configure=function(e,t,n){var r,l,c,d,p,g,v,k,b,x,y,j,O,E,T,w,M,N,P,_,C,R,A,L,Y,J,F,K,U,B,$,V,Z,z,D,H,q,G,W,X,Q,ee,te,ne,re,le,ie,oe,se,ae;const ce=t||{};ce.t=ce.t||{},ce.tI=ce.tI||1;const ue=e=>f(e,ce);!1!==n.standard$&&(ue("#BD"),ue("#ZZ"),ue("#UK"),ue("#AA"),ue("#SP"),ue("#LN"),ue("#CM"),ue("#NR"),ue("#ST"),ue("#TX"),ue("#VL")),ce.safe={key:!1!==(null===(r=n.safe)||void 0===r?void 0:r.key)},ce.fixed={lex:!!(null===(l=n.fixed)||void 0===l?void 0:l.lex),token:n.fixed?u(I(n.fixed.token),([e,t])=>[t,f(e,ce)]):{},ref:void 0,check:null===(c=n.fixed)||void 0===c?void 0:c.check},ce.fixed.ref=u(ce.fixed.token,([e,t])=>[e,t]),ce.fixed.ref=Object.assign(ce.fixed.ref,u(ce.fixed.ref,([e,t])=>[t,e])),ce.match={lex:!!(null===(d=n.match)||void 0===d?void 0:d.lex),value:n.match?u(I(n.match.value),([e,t])=>[e,t]):{},token:n.match?u(I(n.match.token),([e,t])=>[f(e,ce),t]):{},check:null===(p=n.match)||void 0===p?void 0:p.check},u(ce.match.token,([e,t])=>[e,(t.tin$=+e,t)]);const de=n.tokenSet?Object.keys(n.tokenSet).reduce((e,t)=>(e[t]=n.tokenSet[t].filter(e=>null!=e).map(e=>ue(e)),e),{}):{};ce.tokenSet=ce.tokenSet||{},s(de).map(e=>{let t=e[0],n=e[1];ce.tokenSet[t]?(ce.tokenSet[t].length=0,ce.tokenSet[t].push(...n)):ce.tokenSet[t]=n}),ce.tokenSetTins=s(ce.tokenSet).reduce((e,t)=>(e[t[0]]=e[t[0]]||{},t[1].map(n=>e[t[0]][n]=!0),e),{}),ce.tokenSetTins.IGNORE=ce.tokenSetTins.IGNORE||{},ce.space={lex:!!(null===(g=n.space)||void 0===g?void 0:g.lex),chars:S(null===(v=n.space)||void 0===v?void 0:v.chars),check:null===(k=n.space)||void 0===k?void 0:k.check},ce.line={lex:!!(null===(b=n.line)||void 0===b?void 0:b.lex),chars:S(null===(x=n.line)||void 0===x?void 0:x.chars),rowChars:S(null===(y=n.line)||void 0===y?void 0:y.rowChars),single:!!(null===(j=n.line)||void 0===j?void 0:j.single),check:null===(O=n.line)||void 0===O?void 0:O.check},ce.text={lex:!!(null===(E=n.text)||void 0===E?void 0:E.lex),modify:((null===(T=ce.text)||void 0===T?void 0:T.modify)||[]).concat(((null===(w=n.text)||void 0===w?void 0:w.modify)?[n.text.modify]:[]).flat()).filter(e=>null!=e),check:null===(M=n.text)||void 0===M?void 0:M.check},ce.number={lex:!!(null===(N=n.number)||void 0===N?void 0:N.lex),hex:!!(null===(P=n.number)||void 0===P?void 0:P.hex),oct:!!(null===(_=n.number)||void 0===_?void 0:_.oct),bin:!!(null===(C=n.number)||void 0===C?void 0:C.bin),sep:null!=(null===(R=n.number)||void 0===R?void 0:R.sep)&&""!==n.number.sep,exclude:null===(A=n.number)||void 0===A?void 0:A.exclude,sepChar:null===(L=n.number)||void 0===L?void 0:L.sep,check:null===(Y=n.number)||void 0===Y?void 0:Y.check},ce.value={lex:!!(null===(J=n.value)||void 0===J?void 0:J.lex),def:s((null===(F=n.value)||void 0===F?void 0:F.def)||{}).reduce((e,t)=>(null==t[1]||!1===t[1]||t[1].match||(e[t[0]]=t[1]),e),{}),defre:s((null===(K=n.value)||void 0===K?void 0:K.def)||{}).reduce((e,t)=>(t[1]&&t[1].match&&(e[t[0]]=t[1],e[t[0]].consume=!!e[t[0]].consume),e),{})},ce.rule={start:null==(null===(U=n.rule)||void 0===U?void 0:U.start)?"val":n.rule.start,maxmul:null==(null===(B=n.rule)||void 0===B?void 0:B.maxmul)?3:n.rule.maxmul,finish:!!(null===($=n.rule)||void 0===$?void 0:$.finish),include:(null===(V=n.rule)||void 0===V?void 0:V.include)?n.rule.include.split(/\s*,+\s*/).filter(e=>""!==e):[],exclude:(null===(Z=n.rule)||void 0===Z?void 0:Z.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter(e=>""!==e):[]},ce.map={extend:!!(null===(z=n.map)||void 0===z?void 0:z.extend),merge:null===(D=n.map)||void 0===D?void 0:D.merge},ce.list={property:!!(null===(H=n.list)||void 0===H?void 0:H.property)};let pe=Object.keys(ce.fixed.token).sort((e,t)=>t.length-e.length).map(e=>h(e)).join("|"),fe=(null===(q=n.comment)||void 0===q?void 0:q.lex)?(n.comment.def?o(n.comment.def):[]).filter(e=>e&&e.lex).map(e=>h(e.start)).join("|"):"",me=["([",h(i(S(ce.space.lex&&ce.space.chars,ce.line.lex&&ce.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+h(e)).join(""),""===pe?"":"|",pe,""===fe?"":"|",fe,"|$)"];return ce.rePart={fixed:pe,ender:me,commentStart:fe},ce.re={ender:m(null,...me),rowChars:m(null,h(null===(G=n.line)||void 0===G?void 0:G.rowChars)),columns:m(null,"["+h(null===(W=n.line)||void 0===W?void 0:W.chars)+"]","(.*)$")},ce.lex={empty:!!(null===(X=n.lex)||void 0===X?void 0:X.empty),emptyResult:null===(Q=n.lex)||void 0===Q?void 0:Q.emptyResult,match:(null===(ee=n.lex)||void 0===ee?void 0:ee.match)?s(n.lex.match).reduce((e,t)=>{let r=t[0],l=t[1];if(l){let t=l.make(ce,n);t&&(t.matcher=r,t.make=l.make,t.order=l.order),e.push(t)}return e},[]).filter(e=>null!=e&&!1!==e&&-1<+e.order).sort((e,t)=>e.order-t.order):[]},ce.parse={prepare:o(null===(te=n.parse)||void 0===te?void 0:te.prepare)},ce.debug={get_console:(null===(ne=n.debug)||void 0===ne?void 0:ne.get_console)||(()=>console),maxlen:null==(null===(re=n.debug)||void 0===re?void 0:re.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(ie=null===(le=n.debug)||void 0===le?void 0:le.print)||void 0===ie?void 0:ie.config),src:null===(se=null===(oe=n.debug)||void 0===oe?void 0:oe.print)||void 0===se?void 0:se.src}},ce.error=n.error||{},ce.hint=n.hint||{},(null===(ae=n.config)||void 0===ae?void 0:ae.modify)&&i(n.config.modify).forEach(e=>n.config.modify[e](ce,n)),ce.debug.print.config&&ce.debug.get_console().dir(ce,{depth:null}),ce.result={fail:[]},n.result&&(ce.result.fail=[...n.result.fail]),a(e.options,n),a(e.token,ce.t),a(e.tokenSet,ce.tokenSet),a(e.fixed,ce.fixed.ref),ce},t.deep=g,t.errdesc=x,t.errinject=v,t.escre=h,t.errsite=k,t.filterRules=function(e,t){let n=["open","close"];for(let r of n)e.def[r]=e.def[r].map(e=>(e.g="string"==typeof e.g?(e.g||"").split(/\s*,+\s*/):e.g||[],e)).filter(e=>t.rule.include.reduce((t,n)=>t||null!=e.g&&-1!==e.g.indexOf(n),0===t.rule.include.length)).filter(e=>t.rule.exclude.reduce((t,n)=>t&&(null==e.g||-1===e.g.indexOf(n)),!0));return e},t.makelog=function(e,t){var n,r,l;let i=null===(l=null===(r=null===(n=e.opts)||void 0===n?void 0:n.plugin)||void 0===r?void 0:r.debug)||void 0===l?void 0:l.trace;if(t||i)if("number"==typeof(null==t?void 0:t.log)||i){let n=!1,r=null==t?void 0:t.log;(-1===r||i)&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>d.object!=typeof e).map(e=>d.function==typeof e?e.name:e).join(d.gap);e.cfg.debug.get_console().log(n)}else e.cfg.debug.get_console().dir(t,{depth:r})}}else"function"==typeof t.log&&(e.log=t.log);return e.log},t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=m,t.snip=O,t.srcfmt=y,t.tokenize=f,t.trimstk=function(e){e.stack&&(e.stack=e.stack.split("\n").filter(e=>!e.includes("jsonic/jsonic")).map(e=>e.replace(/ at /,"at ")).join("\n"))},t.parserwrap=function(e){return{start:function(t,n,i,o){try{return e.start(t,n,i,o)}catch(s){if("SyntaxError"===s.name){let o=0,a=0,c=0,u=r.EMPTY,d=s.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(d){u=d[1],o=parseInt(d[2]),a=t.substring(0,o).replace(/[^\n]/g,r.EMPTY).length;let e=o-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;c=Math.max(t.substring(e,o).length,0)}let m=s.token||(0,l.makeToken)("#UK",f("#UK",n.internal().config),void 0,u,(0,l.makePoint)(u.length,o,s.lineNumber||a,s.columnNumber||c));throw new p(s.code||"json",s.details||{msg:s.message},m,{},s.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:m,meta:i,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,inst:()=>n,rule:{name:"no-rule"},sub:{},xs:-1,v2:m,v1:m,t0:m,t1:m,tC:-1,kI:-1,rs:[],rsI:0,rsm:{},n:{},log:i?i.log:void 0,F:y(n.internal().config),u:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw s}}}},t.prop=E,t.str=j,t.findTokenSet=function(e,t){return t.tokenSet[e]},t.modlist=function(e,t){if(t&&e){if(0<e.length){if(t.delete&&0<t.delete.length)for(let r=0;r<t.delete.length;r++){let n=t.delete[r];(n<0?-1*n<=e.length:n<e.length)&&(e[(e.length+n)%e.length]=null)}if(t.move)for(let r=0;r<t.move.length;r+=2){let n=(e.length+t.move[r])%e.length,l=(e.length+t.move[r+1])%e.length,i=e[n];e.splice(n,1),e.splice(l,0,i)}let n=e.filter(e=>null!=e);n.length!==e.length&&(e.length=0,e.push(...n))}if(t.custom){let n=t.custom(e);null!=n&&(e=n)}}return e},t.errmsg=b;const l=n({}),i=e=>null==e?[]:Object.keys(e);t.keys=i;const o=e=>null==e?[]:Object.values(e);t.values=o;const s=e=>null==e?[]:Object.entries(e);t.entries=s;const a=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=a,t.isarr=e=>Array.isArray(e);const c=Object.defineProperty;t.defprop=c;const u=(e,t)=>Object.entries(e||{}).reduce((e,n)=>{let r=t?t(n):n;void 0===r[0]?delete e[n[0]]:e[r[0]]=r[1];let l=2;for(;void 0!==r[l];)e[r[l]]=r[l+1],l+=2;return e},{});t.omap=u;const d={indent:". ",logindent:" ",space:" ",gap:" ",Object:"Object",Array:"Array",object:"object",string:"string",function:"function",unexpected:"unexpected",map:"map",list:"list",elem:"elem",pair:"pair",val:"val",node:"node",no_re_flags:r.EMPTY,unprintable:"unprintable",invalid_ascii:"invalid_ascii",invalid_unicode:"invalid_unicode",invalid_lex_state:"invalid_lex_state",unterminated_string:"unterminated_string",unterminated_comment:"unterminated_comment",lex:"lex",parse:"parse",error:"error",none:"none",imp_map:"imp,map",imp_list:"imp,list",imp_null:"imp,null",end:"end",open:"open",close:"close",rule:"rule",stack:"stack",nUll:"null",name:"name",make:"make",colon:":"};t.S=d;class p extends SyntaxError{constructor(e,t,n,r,l){let i=x(e,t=g({},t),n,r,l);super(i.message),a(this,i)}}function f(e,t,n){let l=t.t,i=l[e];return null==i&&r.STRING===typeof e&&(i=t.tI++,l[i]=e,l[e]=i,l[e.substring(1)]=i,null!=n&&a(n.token,t.t)),i}function m(e,...t){return new RegExp(t.map(e=>e.esc?h(e.toString()):e).join(r.EMPTY),null==e?"":e)}function h(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function g(e,...t){let n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n);for(let l of t){let t,i=d.function===typeof l,o=null!=l&&(d.object===typeof l||i);if(r&&o&&!i&&Array.isArray(e)===Array.isArray(l))for(let n in l)e[n]=g(e[n],l[n]);else e=void 0===l?e:i?l:o?d.function===typeof(t=l.constructor)&&d.Object!==t.name&&d.Array!==t.name?l:g(Array.isArray(l)?[]:{},l):l,n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n)}return e}function v(e,t,n,r,l,i){return function(e,t,n){let r=typeof e,l=Array.isArray(e)?"array":null==e?"string":"object"===r?r:"string",i="object"===l?e:"array"===l?e.reduce((e,t,n)=>(e[n]=t,e),{}):{_:e},o=null==t?{}:t;return Object.entries(i).map(e=>i[e[0]]=null==e[1]?"":(""+e[1]).replace(/\{([\w_0-9.]+)}/g,(e,t)=>{var r;let l=E(o,t);if(l=void 0===l?e:l,"object"==typeof l){let e=null===(r=null==l?void 0:l.constructor)||void 0===r?void 0:r.name;l="Object"===e||"Array"===e?JSON.stringify(l).replace(/([^"])"/g,"$1"):l.toString()}else l=""+l;return n&&"string"==typeof n.indent&&(l=l.replace(/\n/g,"\n"+n.indent)),l})),"string"===l?i._:"array"===l?Object.values(i):i}(e,{...i||{},...i.cfg||{},...i.opts||{},...r||{},...l||{},...i.meta||{},...n||{},code:t,details:n,token:r,rule:l,ctx:i},{indent:" "})}function k(e){let{src:t,sub:n,msg:l,cline:i,row:o,col:s,pos:a}=e;o=null!=o&&0<o?o:1,s=null!=s&&0<s?s:1,a=null!=a&&0<a?a:null==t?0:t.split("\n").reduce((e,t,n)=>e+(n<o-1?t.length+1:n===o-1?s:0),0);let c=null==n?r.EMPTY:n,u=t.substring(Math.max(0,a-333),a).split("\n"),d=t.substring(a,a+333).split("\n"),p=2+(r.EMPTY+(o+2)).length,f=o<3?1:o-2,m=e=>(null==i?"":i)+(r.EMPTY+f++).padStart(p," ")+" | "+(null==i?"":"\x1b[0m")+(null==e?r.EMPTY:e),h=u.length;return[2<h?m(u[h-3]):null,1<h?m(u[h-2]):null,m(u[h-1]+d[0])," ".repeat(p)+" "+" ".repeat(s-1)+(null==i?"":i)+"^".repeat(c.length||1)+" "+l+(null==i?"":"\x1b[0m"),m(d[1]),m(d[2])].filter(e=>null!=e).join("\n")}function b(e){const t=null!=e.color&&"object"==typeof e.color?e.color:void 0,n=!0===e.color||t,r={reset:n?"\x1b[0m":"",hi:n?"\x1b[91m":"",lo:n?"\x1b[2m":"",line:n?"\x1b[34m":"",...t||{}};return[null==e.prefix?null:"function"==typeof e.prefix?e.prefix(r,e):""+e.prefix,(null==e.code?"":r.hi+"["+(null==e.name?"":e.name+"/")+e.code+"]:")+r.reset+" "+(null==e.msg?"":e.msg),null!=e.row&&null!=e.col||null!=e.file?" "+r.line+"--\x3e"+r.reset+" "+(null==e.file?"<no-file>":e.file)+(null==e.row||null==e.col?"":":"+e.row+":"+e.col):null,null==e.src?"":k({src:e.src,sub:e.sub,msg:e.smsg||e.msg,cline:r.line,row:e.row,col:e.col,pos:e.pos})+"\n",null==e.hint?null:e.hint,null==e.suffix?null:"function"==typeof e.suffix?e.suffix(r,e):""+e.suffix].filter(e=>null!=e).join("\n")}function x(e,t,n,r,l){var i,o,s;try{let a=l.cfg,c=l.meta,u=v({msg:a.error[e]||(null===(i=null==t?void 0:t.use)||void 0===i?void 0:i.err)&&(t.use.err.code||t.use.err.message)||a.error.unknown,hint:(a.hint[e]||(null===(s=null===(o=t.use)||void 0===o?void 0:o.err)||void 0===s?void 0:s.message)||a.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n")},e,t,n,r,l),d=b({code:e,name:"jsonic",msg:u.msg,hint:u.hint,src:l.src(),file:c?c.fileName:void 0,row:n.rI,col:n.cI,pos:n.sI,sub:n.src,color:!0,suffix:e=>[""," "+e.lo+"https://jsonic.senecajs.org"+e.reset," "+e.lo+"--internal: tag="+(l.opts.tag||"")+"; rule="+r.name+"~"+r.state+"; token="+f(n.tin,l.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+l.plgn().map(e=>e.name).join(",")+"--"+e.reset].join("\n")}),p={internal:{token:n,ctx:l}};return p={...Object.create(p),message:d,code:e,details:t,meta:c,fileName:c?c.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI},p}catch(a){return console.log(a),{}}}function y(e){return"function"==typeof e.debug.print.src?e.debug.print.src:t=>{let n=null==t?r.EMPTY:Array.isArray(t)?JSON.stringify(t).replace(/]$/,s(t).filter(e=>isNaN(e[0])).map((e,t)=>(0===t?", ":"")+e[0]+": "+JSON.stringify(e[1]))+"]"):JSON.stringify(t);return n=n.substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY),n}}function j(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return O(t<n.length?n.substring(0,t-3)+"...":n,t)}function O(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function S(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?i(e).join(r.EMPTY):e).join(r.EMPTY).split(r.EMPTY).reduce((e,t)=>(e[t]=t.charCodeAt(0),e),{})}function I(e){for(let t in e)null==e[t]&&delete e[t];return e}function E(e,t,n){let r=e;try{let r,l=t.split(".");for(let t=0;t<l.length;t++){if(r=l[t],"__proto__"===r)throw new Error(r);t<l.length-1&&(e=e[r]=e[r]||{})}if(void 0!==n){if("__proto__"===r)throw new Error(r);e[r]=n}return e[r]}catch(l){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+j(r)+(void 0===n?"":" to value: "+j(n,22)))}}t.JsonicError=p})),n=e((function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeTextMatcher=n.makeNumberMatcher=n.makeCommentMatcher=n.makeStringMatcher=n.makeLineMatcher=n.makeSpaceMatcher=n.makeFixedMatcher=n.makeMatchMatcher=n.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const l=t({});class i{constructor(e,t,n,r){this.len=-1,this.sI=0,this.rI=1,this.cI=1,this.token=[],this.len=e,null!=t&&(this.sI=t),null!=n&&(this.rI=n),null!=r&&(this.cI=r)}toString(){return"Point["+[this.sI+"/"+this.len,this.rI,this.cI]+(0<this.token.length?" "+this.token:"")+"]"}[r.INSPECT](){return this.toString()}}const o=(...e)=>new i(...e);n.makePoint=o;class s{constructor(e,t,n,l,i,o,s){this.isToken=!0,this.name=r.EMPTY,this.tin=-1,this.val=void 0,this.src=r.EMPTY,this.sI=-1,this.rI=-1,this.cI=-1,this.len=-1,this.name=e,this.tin=t,this.src=l,this.val=n,this.sI=i.sI,this.rI=i.rI,this.cI=i.cI,this.use=o,this.why=s,this.len=null==l?0:l.length}resolveVal(e,t){return"function"==typeof this.val?this.val(e,t):this.val}bad(e,t){return this.err=e,null!=t&&(this.use=(0,l.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,l.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,l.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,l.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,l.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new s(...e);function c(e,t,n){let r=e.pnt,l=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let i,o=e.cfg.fixed.token[n];null!=o&&(i=e.token(o,void 0,n,r)),null!=i&&(r.sI+=i.src.length,r.cI+=i.src.length,null==t?l=i:r.token.push(i))}return l}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,o(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,l.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;if(e.fixed.check){let n=e.fixed.check(t);if(n&&n.done)return n.token}let l=t.pnt,i=t.src.substring(l.sI).match(n);if(i){let e=i[1],n=e.length;if(0<n){let i,o=r.token[e];return null!=o&&(i=t.token(o,void 0,e,l),l.sI+=n,l.cI+=n),i}}}},n.makeMatchMatcher=(e,t)=>{let n=(0,l.values)(e.match.value),r=(0,l.values)(e.match.token);return 0===n.length&&0===r.length?null:function(t,l,i=0){if(!e.match.lex)return;if(e.match.check){let n=e.match.check(t);if(n&&n.done)return n.token}let o=t.pnt,s=t.src.substring(o.sI),a="o"===l.state?0:1;for(let e of n)if(e.match instanceof RegExp){let n=s.match(e.match);if(n){let r=n[0],l=r.length;if(0<l){let i,s=e.val?e.val(n):r;return i=t.token("#VL",s,r,o),o.sI+=l,o.cI+=l,i}}}else{let n=e.match(t,l);if(null!=n)return n}for(let e of r)if(!e.tin$||l.spec.def.tcol[a][i].includes(e.tin$))if(e instanceof RegExp){let n=s.match(e);if(n){let r=n[0],l=r.length;if(0<l){let n,i=e.tin$;return n=t.token(i,r,r,o),o.sI+=l,o.cI+=l,n}}}else{let n=e(t,l);if(null!=n)return n}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,def:((null==n?void 0:n.def)?(0,l.entries)(n.def):[]).reduce((e,[t,n])=>{if(null==n||!1===n)return e;let r={name:t,start:n.start,end:n.end,line:!!n.line,lex:!!n.lex,eatline:!!n.eatline};return e[t]=r,e},{})};let r=e.comment.lex?(0,l.values)(e.comment.def).filter(e=>e.lex&&e.line):[],i=e.comment.lex?(0,l.values)(e.comment.def).filter(e=>e.lex&&!e.line):[];return function(t,n){if(!e.comment.lex)return;if(e.comment.check){let n=e.comment.check(t);if(n&&n.done)return n.token}let o=t.pnt,s=t.src.substring(o.sI),a=o.rI,c=o.cI;for(let l of r)if(s.startsWith(l.start)){let n=s.length,r=l.start.length;for(c+=l.start.length;r<n&&!e.line.chars[s[r]];)c++,r++;if(l.eatline)for(;r<n&&e.line.chars[s[r]];)e.line.rowChars[s[r]]&&a++,r++;let i=s.substring(0,r),u=t.token("#CM",void 0,i,o);return o.sI+=i.length,o.cI=c,o.rI=a,u}for(let r of i)if(s.startsWith(r.start)){let n=s.length,i=r.start.length,u=r.end;for(c+=r.start.length;i<n&&!s.substring(i).startsWith(u);)e.line.rowChars[s[i]]&&(a++,c=0),c++,i++;if(s.substring(i).startsWith(u)){if(c+=u.length,r.eatline)for(;i<n&&e.line.chars[s[i]];)e.line.rowChars[s[i]]&&a++,i++;let l=s.substring(0,i+u.length),d=t.token("#CM",void 0,l,o);return o.sI+=l.length,o.rI=a,o.cI=c,d}return t.bad(l.S.unterminated_comment,o.sI,o.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,l.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){if(e.text.check){let t=e.text.check(r);if(t&&t.done)return t.token}let l=e.text,i=r.pnt,o=r.src.substring(i.sI),s=e.value.def,a=e.value.defre,u=o.match(n);if(u){let n,d=u[1],p=u[2];if(null!=d){let t=d.length;if(0<t){let c;if(e.value.lex)if(void 0!==(c=s[d]))n=r.token("#VL",c.val,d,i),i.sI+=t,i.cI+=t;else for(let e in a){let t=a[e];if(t.match){let e=t.match.exec(t.consume?o:d);if(e&&(t.consume||e[0].length===d.length)){let l=e[0];if(null==t.val)n=r.token("#VL",l,l,i);else{let o=t.val(e);n=r.token("#VL",o,l,i)}i.sI+=l.length,i.cI+=l.length}}}null==n&&l.lex&&(n=r.token("#TX",d,d,i),i.sI+=t,i.cI+=t)}}if(n&&(n=c(r,n,p)),n&&0<e.text.modify.length){const l=e.text.modify;for(let i=0;i<l.length;i++)n.val=l[i](n.val,r,e,t)}return n}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,l.regexp)(null,["^([-+]?(0(",[n.hex?"x[0-9a-fA-F_]+":null,n.oct?"o[0-7_]+":null,n.bin?"b[01_]+":null].filter(e=>null!=e).join("|"),")|\\.?[0-9]+([0-9_]*[0-9])?)","(\\.[0-9]?([0-9_]*[0-9])?)?","([eE][-+]?[0-9]+([0-9_]*[0-9])?)?"].join("").replace(/_/g,n.sep?(0,l.escre)(n.sepChar):""),")",...e.rePart.ender),i=n.sep?(0,l.regexp)("g",(0,l.escre)(n.sepChar)):void 0;return function(t){if(n=e.number,!n.lex)return;if(e.number.check){let n=e.number.check(t);if(n&&n.done)return n.token}let l=t.pnt,o=t.src.substring(l.sI),s=e.value.def,a=o.match(r);if(a){let n,r=a[1],o=a[9],u=!0;if(null!=r&&(u=!e.number.exclude||!r.match(e.number.exclude))){let o=r.length;if(0<o){let a;if(e.value.lex&&void 0!==(a=s[r]))n=t.token("#VL",a.val,r,l);else{let e=i?r.replace(i,""):r,s=+e;if(isNaN(s)){let t=e[0];"-"!==t&&"+"!==t||(s=("-"===t?-1:1)*+e.substring(1))}isNaN(s)||(n=t.token("#NR",s,r,l),l.sI+=o,l.cI+=o)}}}return u&&(n=c(t,n,o)),n}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,l.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,l.charset)(n.chars),multiChars:(0,l.charset)(n.multiChars),escMap:{...n.escape},escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,l.omap)((0,l.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1,abandon:!!n.abandon}),e.string.escMap=(0,l.clean)(e.string.escMap),e.string.hasReplace=0<(0,l.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;if(e.string.check){let n=e.string.check(t);if(n&&n.done)return n.token}let{quoteMap:i,escMap:o,escChar:s,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:d,hasReplace:p}=n,{pnt:f,src:m}=t,{sI:h,rI:g,cI:v}=f,k=m.length;if(i[m[h]]){const i=m[h],b=h,x=g,y=c[i];++h,++v;let j,O=[];for(;h<k;h++){v++;let r=m[h];if(j=void 0,i===r){h++;break}if(s===r){h++,v++;let e=o[m[h]];if(null!=e)O.push(e);else if("x"===m[h]){h++;let e=parseInt(m.substring(h,h+2),16);if(isNaN(e)){if(n.abandon)return;return h-=2,v-=2,f.sI=h,f.cI=v,t.bad(l.S.invalid_ascii,h,h+4)}let r=String.fromCharCode(e);O.push(r),h+=1,v+=2}else if("u"===m[h]){h++;let e="{"===m[h]?(h++,1):0,r=e?6:4,i=parseInt(m.substring(h,h+r),16);if(isNaN(i)){if(n.abandon)return;return h=h-2-e,v-=2,f.sI=h,f.cI=v,t.bad(l.S.invalid_unicode,h,h+r+2+2*e)}let o=String.fromCodePoint(i);O.push(o),h+=r-1+e,v+=r+e}else{if(!u){if(n.abandon)return;return f.sI=h,f.cI=v-1,t.bad(l.S.unexpected,h,h+1)}O.push(m[h])}}else if(p&&void 0!==(j=d[m.charCodeAt(h)]))O.push(j),v++;else{let r=h,o=i.charCodeAt(0),s=m.charCodeAt(h);for(;(!p||void 0===(j=d[s]))&&h<k&&32<=s&&o!==s&&a!==s;)s=m.charCodeAt(++h),v++;if(v--,void 0===j&&s<32){if(!y||!e.line.chars[m[h]]){if(n.abandon)return;return f.sI=h,f.cI=v,t.bad(l.S.unprintable,h,h+1)}e.line.rowChars[m[h]]&&(f.rI=++g),v=1,O.push(m.substring(r,h+1))}else O.push(m.substring(r,h)),h--}}if(m[h-1]!==i||f.sI===h-1){if(n.abandon)return;return f.rI=x,t.bad(l.S.unterminated_string,b,h)}const S=t.token("#ST",O.join(r.EMPTY),m.substring(f.sI,h),f);return f.sI=h,f.rI=g,f.cI=v,S}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;if(e.line.check){let n=e.line.check(t);if(n&&n.done)return n.token}let n,{chars:r,rowChars:l}=e.line,{pnt:i,src:o}=t,{sI:s,rI:a}=i,c=e.line.single;for(c&&(n={});r[o[s]]&&!(n&&(n[o[s]]=(n[o[s]]||0)+1,c&&1<n[o[s]]));)a+=l[o[s]]?1:0,s++;if(i.sI<s){let e=o.substring(i.sI,s);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=a,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;if(e.space.check){let n=e.space.check(t);if(n&&n.done)return n.token}let{chars:n}=e.space,{pnt:r,src:l}=t,{sI:i,cI:o}=r;for(;n[l[i]];)i++,o++;if(r.sI<i){let e=l.substring(r.sI,i);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=o,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=o(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=o(this.src.length)}token(e,t,n,r,i,o){let s,c;return"string"==typeof e?(c=e,s=(0,l.tokenize)(c,this.cfg)):(s=e,c=(0,l.tokenize)(e,this.cfg)),a(c,s,t,n,r||this.pnt,i,o)}next(e,t,n,r){let i,o,s=this.pnt,a=s.sI;if(s.end)i=s.end;else if(0<s.token.length)i=s.token.shift();else if(s.len<=s.sI)s.end=this.token("#ZZ",void 0,"",s),i=s.end;else{try{for(let t of this.cfg.lex.match)if(i=t(this,e,r)){o=t;break}}catch(c){i=i||this.token("#BD",void 0,this.src[s.sI],s,{err:c},c.code||l.S.unexpected)}i=i||this.token("#BD",void 0,this.src[s.sI],s,void 0,l.S.unexpected)}return this.ctx.log&&this.ctx.log(l.S.lex,this.ctx,e,this,s,a,o,i,t,n,r),this.ctx.sub.lex&&this.ctx.sub.lex.map(t=>t(i,e,this.ctx)),i}tokenize(e){return(0,l.tokenize)(e,this.cfg)}bad(e,t,n){return this.token("#BD",void 0,0<=t&&t<=n?this.src.substring(t,n):this.src[this.pnt.sI],void 0,void 0,e)}}n.makeLex=(...e)=>new u(...e)})),r={};Object.defineProperty(r,"__esModule",{value:!0}),r.STRING=r.INSPECT=r.EMPTY=r.AFTER=r.BEFORE=r.CLOSE=r.OPEN=void 0,r.OPEN="o",r.CLOSE="c",r.BEFORE="b",r.AFTER="a",r.EMPTY="",r.INSPECT=Symbol.for("nodejs.util.inspect.custom"),r.STRING="string";var l={};Object.defineProperty(l,"__esModule",{value:!0}),l.defaults=void 0;const i=n({}),o={safe:{key:!0},tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},match:{lex:!0,token:{}},tokenSet:{IGNORE:["#SP","#LN","#CM"],VAL:["#TX","#NR","#ST","#VL"],KEY:["#TX","#NR","#ST","#VL"]},space:{lex:!0,chars:" \t"},line:{lex:!0,chars:"\r\n",rowChars:"\n",single:!1},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_",exclude:void 0},comment:{lex:!0,def:{hash:{line:!0,start:"#",lex:!0,eatline:!1},slash:{line:!0,start:"//",lex:!0,eatline:!1},multi:{line:!1,start:"/*",end:"*/",lex:!0,eatline:!1}}},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0,abandon:!1},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,def:{true:{val:!0},false:{val:!1},null:{val:null}}},ender:[],plugin:{},debug:{get_console:()=>console,maxlen:99,print:{config:!1,src:void 0}},error:{unknown:"unknown error: {code}",unexpected:"unexpected character(s): {src}",invalid_unicode:"invalid unicode escape: {src}",invalid_ascii:"invalid ascii escape: {src}",unprintable:"unprintable character: {src}",unterminated_string:"unterminated string: {src}",unterminated_comment:"unterminated comment: {src}",unknown_rule:"unknown rule: {rulename}",end_of_source:"unexpected end of source"},hint:{unknown:"\nSince the error is unknown, this is probably a bug inside jsonic\nitself, or a plugin. Please consider posting a github issue - thanks!\n\nCode: {code}, Details: \n{details}",unexpected:"\nThe character(s) {src} were not expected at this point as they do not\nmatch the expected syntax, even under the relaxed jsonic rules. If it\nis not obviously wrong, the actual syntax error may be elsewhere. Try\ncommenting out larger areas around this point until you get no errors,\nthen remove the comments in small sections until you find the\noffending syntax. NOTE: Also check if any plugins you are using\nexpect different syntax in this case.",invalid_unicode:"\nThe escape sequence {src} does not encode a valid unicode code point\nnumber. You may need to validate your string data manually using test\ncode to see how JavaScript will interpret it. Also consider that your\ndata may have become corrupted, or the escape sequence has not been\ngenerated correctly.",invalid_ascii:"\nThe escape sequence {src} does not encode a valid ASCII character. You\nmay need to validate your string data manually using test code to see\nhow JavaScript will interpret it. Also consider that your data may\nhave become corrupted, or the escape sequence has not been generated\ncorrectly.",unprintable:"\nString values cannot contain unprintable characters (character codes\nbelow 32). The character {src} is unprintable. You may need to remove\nthese characters from your source data. Also check that it has not\nbecome corrupted.",unterminated_string:"\nThis string has no end quote.",unterminated_comment:"\nThis comment is never closed.",unknown_rule:"\nNo rule named $rulename is defined. This is probably an error in the\ngrammar of a plugin.",end_of_source:"\nUnexpected end of source."},lex:{match:{match:{order:1e6,make:i.makeMatchMatcher},fixed:{order:2e6,make:i.makeFixedMatcher},space:{order:3e6,make:i.makeSpaceMatcher},line:{order:4e6,make:i.makeLineMatcher},string:{order:5e6,make:i.makeStringMatcher},comment:{order:6e6,make:i.makeCommentMatcher},number:{order:7e6,make:i.makeNumberMatcher},text:{order:8e6,make:i.makeTextMatcher}},empty:!0,emptyResult:void 0},parse:{prepare:{}},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};l.defaults=o;var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.makeRuleSpec=s.makeNoRule=s.makeRule=void 0;const a=t({});class c{constructor(e,t,n){this.i=-1,this.name=r.EMPTY,this.node=null,this.state=r.OPEN,this.n=Object.create(null),this.d=-1,this.u=Object.create(null),this.k=Object.create(null),this.bo=!1,this.ao=!1,this.bc=!1,this.ac=!1,this.os=0,this.cs=0,this.need=0,this.i=t.uI++,this.name=e.name,this.spec=e,this.child=t.NORULE,this.parent=t.NORULE,this.prev=t.NORULE,this.o0=t.NOTOKEN,this.o1=t.NOTOKEN,this.c0=t.NOTOKEN,this.c1=t.NOTOKEN,this.node=n,this.d=t.rsI,this.bo=null!=e.def.bo,this.ao=null!=e.def.ao,this.bc=null!=e.def.bc,this.ac=null!=e.def.ac}process(e,t){return this.spec.process(this,e,t,this.state)}eq(e,t=0){let n=this.n[e];return null==n||n===t}lt(e,t=0){let n=this.n[e];return null==n||n<t}gt(e,t=0){let n=this.n[e];return null==n||n>t}lte(e,t=0){let n=this.n[e];return null==n||n<=t}gte(e,t=0){let n=this.n[e];return null==n||n>=t}toString(){return"[Rule "+this.name+"~"+this.i+"]"}}const u=(...e)=>new c(...e);s.makeRule=u,s.makeNoRule=e=>u(g(e.cfg,{}),e);class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const p=(...e)=>new d(...e),f=p(),m=p();class h{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[],tcol:[]},this.cfg=e,this.def=Object.assign(this.def,t),this.def.open=(this.def.open||[]).filter(e=>null!=e),this.def.close=(this.def.close||[]).filter(e=>null!=e);for(let n of[...this.def.open,...this.def.close])v(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",l=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e&&"object"==typeof e).map(e=>v(e)),i="o"===e?"open":"close",o=this.def[i];return o[r](...l),o=this.def[i]=(0,a.modlist)(o,n),(0,a.filterRules)(this,this.cfg),this.norm(),this}open(e,t){return this.add("o",e,t)}close(e,t){return this.add("c",e,t)}action(e,t,n,r){let l=this.def[t+n];return e?l.push(r):l.unshift(r),this}bo(e,t){return this.action(!t||!!e,r.BEFORE,r.OPEN,t||e)}ao(e,t){return this.action(!t||!!e,r.AFTER,r.OPEN,t||e)}bc(e,t){return this.action(!t||!!e,r.BEFORE,r.CLOSE,t||e)}ac(e,t){return this.action(!t||!!e,r.AFTER,r.CLOSE,t||e)}clear(){return this.def.open.length=0,this.def.close.length=0,this.def.bo.length=0,this.def.ao.length=0,this.def.bc.length=0,this.def.ac.length=0,this}norm(){this.def.open.map(e=>v(e)),this.def.close.map(e=>v(e));const e=[];function t(e,t,n){return n[e]=n[e]||[],[function(e,n){if(n.s&&n.s[t]){let r=[...new Set(e.concat(n.s[t]))];e.length=0,e.push(...r)}return e},n[e][t]=n[e][t]||[]]}return this.def.open.reduce(...t(0,0,e)),this.def.open.reduce(...t(0,1,e)),this.def.close.reduce(...t(1,0,e)),this.def.close.reduce(...t(1,1,e)),this.def.tcol=e,this}process(e,t,n,l){t.log&&t.log(a.S.rule,t,e,n);let i="o"===l,o=i?e:t.NORULE,s=i?"O":"C",c=this.def,d=i?c.open:c.close,p=i?e.bo?c.bo:null:e.bc?c.bc:null;if(p){let n;for(let r=0;r<p.length;r++)if(n=p[r].call(this,e,t,o,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}let h=0<d.length?function(e,t,n,l,i){let o=f;o.b=0,o.p=r.EMPTY,o.r=r.EMPTY,o.n=void 0,o.h=void 0,o.a=void 0,o.u=void 0,o.k=void 0,o.e=void 0;let s=null,c=0,u=!0,d=1<<i.cfg.t.AA-1,p=i.cfg.tokenSetTins.IGNORE;function m(e,t,r,l){let o;do{o=n.next(e,t,r,l),i.tC++}while(p[o.tin]);return o}let h=t.length;for(c=0;c<h;c++){s=t[c];let n=!1,r=!1;if(u=!0,s.S0){let e=(i.t0=i.NOTOKEN!==i.t0?i.t0:i.t0=m(l,s,c,0)).tin;if(n=!0,u=!!(s.S0[e/31|0]&(1<<e%31-1|d)),u&&(r=null!=s.S1,s.S1)){let e=(i.t1=i.NOTOKEN!==i.t1?i.t1:i.t1=m(l,s,c,1)).tin;r=!0,u=!!(s.S1[e/31|0]&(1<<e%31-1|d))}}if(e?(l.o0=n?i.t0:i.NOTOKEN,l.o1=r?i.t1:i.NOTOKEN,l.os=(n?1:0)+(r?1:0)):(l.c0=n?i.t0:i.NOTOKEN,l.c1=r?i.t1:i.NOTOKEN,l.cs=(n?1:0)+(r?1:0)),u&&s.c&&(u=u&&s.c(l,i,o)),u)break;s=null}u||(o.e=i.t0),s&&(o.n=null!=s.n?s.n:o.n,o.h=null!=s.h?s.h:o.h,o.a=null!=s.a?s.a:o.a,o.u=null!=s.u?s.u:o.u,o.k=null!=s.k?s.k:o.k,o.g=null!=s.g?s.g:o.g,o.e=s.e&&s.e(l,i,o)||void 0,o.p=null!=s.p&&!1!==s.p?"string"==typeof s.p?s.p:s.p(l,i,o):o.p,o.r=null!=s.r&&!1!==s.r?"string"==typeof s.r?s.r:s.r(l,i,o):o.r,o.b=null!=s.b&&!1!==s.b?"number"==typeof s.b?s.b:s.b(l,i,o):o.b);let g=c<t.length;return i.log&&i.log(a.S.parse,i,l,n,g,u,c,s,o),o}(i,d,n,e,t):m;if(h.h&&(h=h.h(e,t,h,o)||h,s+="H"),h.e)return this.bad(h.e,e,t,{is_open:i});if(h.n)for(let r in h.n)e.n[r]=0===h.n[r]?0:(null==e.n[r]?0:e.n[r])+h.n[r];if(h.u&&(e.u=Object.assign(e.u,h.u)),h.k&&(e.k=Object.assign(e.k,h.k)),h.a){s+="A";let n=h.a(e,t,h);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:i})}if(h.p){t.rs[t.rsI++]=e;let n=t.rsm[h.p];if(!n)return this.bad(this.unknownRule(t.t0,h.p),e,t,{is_open:i});o=e.child=u(n,t,e.node),o.parent=e,o.n={...e.n},0<Object.keys(e.k).length&&(o.k={...e.k}),s+="P`"+h.p+"`"}else if(h.r){let n=t.rsm[h.r];if(!n)return this.bad(this.unknownRule(t.t0,h.r),e,t,{is_open:i});o=u(n,t,e.node),o.parent=e.parent,o.prev=e,o.n={...e.n},0<Object.keys(e.k).length&&(o.k={...e.k}),s+="R`"+h.r+"`"}else i||(o=t.rs[--t.rsI]||t.NORULE);let g=i?e.ao?c.ao:null:e.ac?c.ac:null;if(g){let n;for(let r=0;r<g.length;r++)if(n=g[r](e,t,o,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}o.why=s,t.log&&t.log(a.S.node,t,e,n,o),r.OPEN===e.state&&(e.state=r.CLOSE);let v=e[i?"os":"cs"]-(h.b||0);return 1===v?(t.v2=t.v1,t.v1=t.t0,t.t0=t.t1,t.t1=t.NOTOKEN):2==v&&(t.v2=t.t1,t.v1=t.t0,t.t0=t.NOTOKEN,t.t1=t.NOTOKEN),o}bad(e,t,n,r){throw new a.JsonicError(e.err||a.S.unexpected,{...e.use,state:r.is_open?a.S.open:a.S.close},e,t,n)}unknownRule(e,t){return e.err="unknown_rule",e.use=e.use||{},e.use.rulename=t,e}}const g=(...e)=>new h(...e);function v(e){if(r.STRING===typeof e.g?e.g=e.g.split(/\s*,\s*/):null==e.g&&(e.g=[]),e.g=e.g.sort(),e.s&&0!==e.s.length){const t=e=>e.flat().filter(e=>"number"==typeof e),n=(e,t)=>e.filter(e=>31*t<=e&&e<31*(t+1)),r=(e,t)=>e.reduce((e,n)=>1<<n-(31*t+1)|e,0),l=t([e.s[0]]),i=t([e.s[1]]),o=e;o.S0=0<l.length?new Array(Math.max(...l.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(l,e),e)):null,o.S1=0<i.length?new Array(Math.max(...i.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(i,e),e)):null}else e.s=null;return e.p||(e.p=null),e.r||(e.r=null),e.b||(e.b=null),e}s.makeRuleSpec=g;var k={};Object.defineProperty(k,"__esModule",{value:!0}),k.makeParser=k.makeRuleSpec=k.makeRule=void 0;const b=t({}),x=n({});Object.defineProperty(k,"makeRule",{enumerable:!0,get:function(){return s.makeRule}}),Object.defineProperty(k,"makeRuleSpec",{enumerable:!0,get:function(){return s.makeRuleSpec}});class y{constructor(e,t){this.rsm={},this.options=e,this.cfg=t}rule(e,t){if(null==e)return this.rsm;let n=this.rsm[e];if(null===t)delete this.rsm[e];else if(void 0!==t)return n=this.rsm[e]=this.rsm[e]||(0,s.makeRuleSpec)(this.cfg,{}),n=this.rsm[e]=t(this.rsm[e],this)||this.rsm[e],void(n.name=e);return n}start(e,t,n,l){let i,o=(0,x.makeToken)("#ZZ",(0,b.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,x.makePoint)(-1)),a=(0,x.makeNoToken)(),c={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>i,plgn:()=>t.internal().plugins,inst:()=>t,rule:{},sub:t.internal().sub,xs:-1,v2:o,v1:o,t0:a,t1:a,tC:-2,kI:-1,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,b.srcfmt)(this.cfg),u:{},NOTOKEN:a,NORULE:{}};c=(0,b.deep)(c,l);let u=(0,s.makeNoRule)(c);if(c.NORULE=u,c.rule=u,n&&b.S.function===typeof n.log&&(c.log=n.log),this.cfg.parse.prepare.forEach(e=>e(t,c,n)),""===e){if(this.cfg.lex.empty)return this.cfg.lex.emptyResult;throw new b.JsonicError(b.S.unexpected,{src:e},c.t0,u,c)}let d=(0,b.badlex)((0,x.makeLex)(c),(0,b.tokenize)("#BD",this.cfg),c),p=this.rsm[this.cfg.rule.start];if(null==p)return;let f=(0,s.makeRule)(p,c);i=f;let m=2*(0,b.keys)(this.rsm).length*d.src.length*2*c.cfg.rule.maxmul,h=0;for(;u!==f&&h<m;)c.kI=h,c.rule=f,c.log&&c.log("",c.kI+":"),c.sub.rule&&c.sub.rule.map(e=>e(f,c)),f=f.process(c,d),c.log&&c.log(b.S.stack,c,f,d),h++;if(o.tin!==d.next(f).tin)throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);const g=c.root().node;if(this.cfg.result.fail.includes(g))throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);return g}clone(e,t){let n=new y(e,t);return n.rsm=Object.keys(this.rsm).reduce((e,t)=>(e[t]=(0,b.filterRules)(this.rsm[t],this.cfg),e),{}),n.norm(),n}norm(){(0,b.values)(this.rsm).map(e=>e.norm())}}k.makeParser=(...e)=>new y(...e);var j={};function O(e){const{deep:t}=e.util,{OB:n,CB:r,OS:l,CS:i,CL:o,CA:s,TX:a,ST:c,ZZ:u}=e.token,{VAL:d,KEY:p}=e.tokenSet,f=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.err="end_of_source",t.t0},m=e=>{const t=e.o0,n=c===t.tin||a===t.tin?t.val:t.src;e.u.key=n};e.rule("val",e=>{e.bo(e=>e.node=void 0).open([{s:[n],p:"map",b:1,g:"map,json"},{s:[l],p:"list",b:1,g:"list,json"},{s:[d],g:"val,json"}]).close([{s:[u],g:"end,json"},{b:1,g:"more,json"}]).bc((e,t)=>{e.node=void 0===e.node?void 0===e.child.node?0===e.os?void 0:e.o0.resolveVal(e,t):e.child.node:e.node})}),e.rule("map",e=>{e.bo(e=>{e.node=Object.create(null)}).open([{s:[n,r],b:1,n:{pk:0},g:"map,json"},{s:[n],p:"pair",n:{pk:0},g:"map,json,pair"}]).close([{s:[r],g:"end,json"}])}),e.rule("list",e=>{e.bo(e=>{e.node=[]}).open([{s:[l,i],b:1,g:"list,json"},{s:[l],p:"elem",g:"list,elem,json"}]).close([{s:[i],g:"end,json"}])}),e.rule("pair",e=>{e.open([{s:[p,o],p:"val",u:{pair:!0},a:m,g:"map,pair,key,json"}]).bc((e,t)=>{e.u.pair&&(e.u.prev=e.node[e.u.key],e.node[e.u.key]=e.child.node)}).close([{s:[s],r:"pair",g:"map,pair,json"},{s:[r],b:1,g:"map,pair,json"}])}),e.rule("elem",e=>{e.open([{p:"val",g:"list,elem,val,json"}]).bc(e=>{!0!==e.u.done&&e.node.push(e.child.node)}).close([{s:[s],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"}])});const h=(e,n)=>{let r=e.u.key,l=e.child.node;const i=e.u.prev;l=void 0===l?null:l,e.u.list&&n.cfg.safe.key&&("__proto__"===r||"constructor"===r)||(e.node[r]=null==i?l:n.cfg.map.merge?n.cfg.map.merge(i,l,e,n):n.cfg.map.extend?t(i,l):l)};e.rule("val",e=>{e.open([{s:[p,o],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[d],g:"val,json"},{s:[[r,i]],b:1,c:e=>0<e.d,g:"val,imp,null,jsonic"},{s:[s],c:e=>0===e.d,p:"list",b:1,g:"list,imp,jsonic"},{s:[s],b:1,g:"list,val,imp,null,jsonic"},{s:[u],g:"jsonic"}],{append:!0,delete:[2]}).close([{s:[[r,i]],b:1,g:"val,json,close",e:(e,t)=>0===e.d?t.t0:void 0},{s:[s],c:e=>e.lte("dlist")&&e.lte("dmap"),r:"list",u:{implist:!0},g:"list,val,imp,comma,jsonic"},{c:e=>e.lte("dlist")&&e.lte("dmap"),r:"list",u:{implist:!0},g:"list,val,imp,space,jsonic",b:1},{s:[u],g:"jsonic"}],{append:!0,move:[1,-1]})}),e.rule("map",e=>{e.bo(e=>{e.n.dmap=1+(e.n.dmap?e.n.dmap:0)}).open([{s:[n,u],b:1,e:f,g:"end,jsonic"}]).open([{s:[p,o],p:"pair",b:2,g:"pair,list,val,imp,jsonic"}],{append:!0}).close([{s:[r],c:e=>e.lte("pk"),g:"end,json"},{s:[r],b:1,g:"path,jsonic"},{s:[[s,i,...d]],b:1,g:"end,path,jsonic"},{s:[u],e:f,g:"end,jsonic"}],{append:!0,delete:[0]})}),e.rule("list",e=>{e.bo(e=>{e.n.dlist=1+(e.n.dlist?e.n.dlist:0),e.prev.u.implist&&(e.node.push(e.prev.node),e.prev.node=e.node)}).open({c:e=>e.prev.u.implist,p:"elem"}).open([{s:[s],p:"elem",b:1,g:"list,elem,val,imp,jsonic"},{p:"elem",g:"list,elem.jsonic"}],{append:!0}).close([{s:[u],e:f,g:"end,jsonic"}],{append:!0})}),e.rule("pair",(e,t)=>{e.open([{s:[s],g:"map,pair,comma,jsonic"}],{append:!0}).bc((e,t)=>{e.u.pair&&h(e,t)}).close([{s:[r],c:e=>e.lte("pk"),b:1,g:"map,pair,json"},{s:[s,r],c:e=>e.lte("pk"),b:1,g:"map,pair,comma,jsonic"},{s:[s,u],g:"end,jsonic"},{s:[s],c:e=>e.lte("pk"),r:"pair",g:"map,pair,json"},{s:[s],c:e=>e.lte("dmap",1),r:"pair",g:"map,pair,jsonic"},{s:[p],c:e=>e.lte("dmap",1),r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[r,s,i,...p]],c:e=>0<e.n.pk,b:1,g:"map,pair,imp,path,jsonic"},{s:[i],e:e=>e.c0,g:"end,jsonic"},{s:[u],e:f,g:"map,pair,json"},{r:"pair",b:1,g:"map,pair,imp,jsonic"}],{append:!0,delete:[0,1]})}),e.rule("elem",(e,t)=>{e.open([{s:[s,s],b:2,u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[s],u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[p,o],e:t.cfg.list.property?void 0:(e,t)=>t.t0,p:"val",n:{pk:1,dmap:1},u:{done:!0,pair:!0,list:!0},a:m,g:"elem,pair,jsonic"}]).bc((e,t)=>{!0===e.u.pair&&(e.u.prev=e.node[e.u.key],h(e,t))}).close([{s:[s,[i,u]],b:1,g:"list,elem,comma,jsonic"},{s:[s],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"},{s:[u],e:f,g:"list,elem,json"},{s:[r],e:e=>e.c0,g:"end,jsonic"},{r:"elem",b:1,g:"list,elem,imp,jsonic"}],{delete:[-1,-2]})})}Object.defineProperty(j,"__esModule",{value:!0}),j.grammar=O,j.makeJSON=function(e){let t=e.make({grammar$:!1,text:{lex:!1},number:{hex:!1,oct:!1,bin:!1,sep:null,exclude:/^00+/},string:{chars:'"',multiChars:"",allowUnknown:!1,escape:{v:null}},comment:{lex:!1},map:{extend:!1},lex:{empty:!1},rule:{finish:!1,include:"json"},result:{fail:[void 0,NaN]},tokenSet:{KEY:["#ST",null,null,null]}});return O(t),t};var S={exports:{}};Object.defineProperty(S.exports,"__esModule",{value:!0}),S.exports.root=S.exports.S=S.exports.EMPTY=S.exports.AFTER=S.exports.BEFORE=S.exports.CLOSE=S.exports.OPEN=S.exports.makeTextMatcher=S.exports.makeNumberMatcher=S.exports.makeCommentMatcher=S.exports.makeStringMatcher=S.exports.makeLineMatcher=S.exports.makeSpaceMatcher=S.exports.makeFixedMatcher=S.exports.makeParser=S.exports.makeLex=S.exports.makeRuleSpec=S.exports.makeRule=S.exports.makePoint=S.exports.makeToken=S.exports.util=S.exports.JsonicError=S.exports.Jsonic=void 0,S.exports.make=w,Object.defineProperty(S.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(S.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(S.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(S.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}}),Object.defineProperty(S.exports,"EMPTY",{enumerable:!0,get:function(){return r.EMPTY}});const I=t({});Object.defineProperty(S.exports,"JsonicError",{enumerable:!0,get:function(){return I.JsonicError}}),Object.defineProperty(S.exports,"S",{enumerable:!0,get:function(){return I.S}});const E=n({});Object.defineProperty(S.exports,"makePoint",{enumerable:!0,get:function(){return E.makePoint}}),Object.defineProperty(S.exports,"makeToken",{enumerable:!0,get:function(){return E.makeToken}}),Object.defineProperty(S.exports,"makeLex",{enumerable:!0,get:function(){return E.makeLex}}),Object.defineProperty(S.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return E.makeFixedMatcher}}),Object.defineProperty(S.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return E.makeSpaceMatcher}}),Object.defineProperty(S.exports,"makeLineMatcher",{enumerable:!0,get:function(){return E.makeLineMatcher}}),Object.defineProperty(S.exports,"makeStringMatcher",{enumerable:!0,get:function(){return E.makeStringMatcher}}),Object.defineProperty(S.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return E.makeCommentMatcher}}),Object.defineProperty(S.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return E.makeNumberMatcher}}),Object.defineProperty(S.exports,"makeTextMatcher",{enumerable:!0,get:function(){return E.makeTextMatcher}}),Object.defineProperty(S.exports,"makeRule",{enumerable:!0,get:function(){return k.makeRule}}),Object.defineProperty(S.exports,"makeRuleSpec",{enumerable:!0,get:function(){return k.makeRuleSpec}}),Object.defineProperty(S.exports,"makeParser",{enumerable:!0,get:function(){return k.makeParser}});const T={tokenize:I.tokenize,srcfmt:I.srcfmt,clone:I.clone,charset:I.charset,trimstk:I.trimstk,makelog:I.makelog,badlex:I.badlex,errsite:I.errsite,errinject:I.errinject,errdesc:I.errdesc,configure:I.configure,parserwrap:I.parserwrap,mesc:I.mesc,escre:I.escre,regexp:I.regexp,prop:I.prop,str:I.str,clean:I.clean,errmsg:I.errmsg,deep:I.deep,omap:I.omap,keys:I.keys,values:I.values,entries:I.entries};function w(e,t){let n=!0;if("jsonic"===e)n=!1;else if("json"===e)return(0,j.makeJSON)(M);e="string"==typeof e?{}:e;let r={parser:null,config:null,plugins:[],sub:{lex:void 0,rule:void 0},mark:Math.random()},i=(0,I.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:l.defaults,e||{}),o=function(e,t,n){var r;if(I.S.string===typeof e){let l=o.internal();return((null===(r=s.parser)||void 0===r?void 0:r.start)?(0,I.parserwrap)(s.parser):l.parser).start(e,o,t,n)}return e},s=e=>{if(null!=e&&I.S.object===typeof e){(0,I.deep)(i,e),(0,I.configure)(o,r.config,i);let t=o.internal().parser;r.parser=t.clone(i,r.config)}return{...o.options}},a={token:e=>(0,I.tokenize)(e,r.config,o),tokenSet:e=>(0,I.findTokenSet)(e,r.config),fixed:e=>r.config.fixed.ref[e],options:(0,I.deep)(s,i),config:()=>(0,I.deep)(r.config),parse:o,use:function(e,t){if(I.S.function!==typeof e)throw new Error("Jsonic.use: the first argument must be a function defining a plugin. See https://jsonic.senecajs.org/plugin");const n=e.name.toLowerCase(),r=(0,I.deep)({},e.defaults||{},t||{});o.options({plugin:{[n]:r}});let l=o.options.plugin[n];return o.internal().plugins.push(e),e.options=l,e(o,l)||o},rule:(e,t)=>o.internal().parser.rule(e,t)||o,make:e=>w(e,o),empty:e=>w({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==s.tag?"":"/"+s.tag),toString:()=>a.id,sub:e=>(e.lex&&(r.sub.lex=r.sub.lex||[],r.sub.lex.push(e.lex)),e.rule&&(r.sub.rule=r.sub.rule||[],r.sub.rule.push(e.rule)),o),util:T};if((0,I.defprop)(a.make,I.S.name,{value:I.S.make}),n?(0,I.assign)(o,a):(0,I.assign)(o,{empty:a.empty,parse:a.parse,sub:a.sub,id:a.id,toString:a.toString}),(0,I.defprop)(o,"internal",{value:()=>r}),t){for(let n in t)void 0===o[n]&&(o[n]=t[n]);o.parent=t;let e=t.internal();r.config=(0,I.deep)({},e.config),(0,I.configure)(o,r.config,i),(0,I.assign)(o.token,r.config.t),r.plugins=[...e.plugins],r.parser=e.parser.clone(i,r.config)}else{let e={...o,...a};r.config=(0,I.configure)(e,void 0,i),r.plugins=[],r.parser=(0,k.makeParser)(i,r.config),!1!==i.grammar$&&(0,j.grammar)(e)}return o}let M;S.exports.util=T,S.exports.root=M;let N=S.exports.root=M=w("jsonic");return S.exports.Jsonic=N,M.Jsonic=M,M.JsonicError=I.JsonicError,M.makeLex=E.makeLex,M.makeParser=k.makeParser,M.makeToken=E.makeToken,M.makePoint=E.makePoint,M.makeRule=k.makeRule,M.makeRuleSpec=k.makeRuleSpec,M.makeFixedMatcher=E.makeFixedMatcher,M.makeSpaceMatcher=E.makeSpaceMatcher,M.makeLineMatcher=E.makeLineMatcher,M.makeStringMatcher=E.makeStringMatcher,M.makeCommentMatcher=E.makeCommentMatcher,M.makeNumberMatcher=E.makeNumberMatcher,M.makeTextMatcher=E.makeTextMatcher,M.OPEN=r.OPEN,M.CLOSE=r.CLOSE,M.BEFORE=r.BEFORE,M.AFTER=r.AFTER,M.EMPTY=r.EMPTY,M.util=T,M.make=w,M.S=I.S,S.exports.default=N,S.exports=N,S.exports}))}).call(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),e=e.exports;var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.Hoover=void 0,n.parseToEnd=i;const r=(t,n)=>{var r;const{entries:o}=t.util;let s=o(n.block).map(e=>({allowUnknownEscape:!0,preserveEscapeChar:!1,token:"#HV",...e[1],name:e[0]})),a={};for(let e of s)e.TOKEN=t.token(e.token),a[e.token]||t.rule("val",t=>{t.open({s:[e.TOKEN],a:n.action})}),a[e.token]=e.TOKEN;t.options({lex:{match:{hoover:{order:null===(r=n.lex)||void 0===r?void 0:r.order,make:(t,n)=>function(n){for(let r of s){const o=(0,e.makePoint)(n.pnt.len,n.pnt.sI,n.pnt.rI,n.pnt.cI);if(l(n,o,r).match){let e=i(n,o,r,t);if(e.done){let t=n.token(r.TOKEN,e.val,n.src.substring(n.pnt.sI,o.sI),o);return t.use={block:r.name},n.pnt.sI=o.sI,n.pnt.rI=o.rI,n.pnt.cI=o.cI,t}return e.bad||n.bad("invalid_text",n.pnt.sI,o.sI)}}}}}}})};function l(e,t,n){let r=e.src,l=t.sI,i=t.rI,o=t.cI,s=n.start||{},a=s.rule||{},c=null;a.parent&&(a.parent.include&&(c=a.parent.include.includes(e.ctx.rule.parent.name)&&(null===c||c)),a.parent.exclude&&(c=!a.parent.exclude.includes(e.ctx.rule.parent.name)&&(null===c||c))),a.current&&(a.current.include&&(c=a.current.include.includes(e.ctx.rule.name)&&(null===c||c)),a.current.exclude&&(c=!a.current.exclude.includes(e.ctx.rule.name)&&(null===c||c)));let u=""===a.state?"":a.state||"o";u&&(c=u.includes(e.ctx.rule.state)&&(null===c||c));let d=!0,p=s.fixed;if(c&&null!=p){d=!1,p=Array.isArray(p)?p:[p];for(let e=0;!d&&e<p.length;e++)if(r.substring(t.sI).startsWith(p[e])){if(d=!0,!1!==s.consume&&(!Array.isArray(s.consume)||s.consume.includes(p[e]))){let n=t.sI+p[e].length;for(let e=t.sI;e<n;e++)l++,o++,"\n"===r[e]&&(i++,o=0)}break}}if(c&&d){let e=r.substring(t.sI,l);return!1!==n.trim&&(e=e.trim()),t.sI=l,t.rI=i,t.cI=o,{match:!0,start:e}}return{match:!1}}function i(e,t,n,r){let l=[],i=e.src,o=n.end,s=o.fixed;s="string"==typeof s?[s]:s;let a=s.map(e=>e[0]),c=s.map(e=>e.substring(1)),u=n.escapeChar,d=t.sI,p=t.rI,f=t.cI,m=!1,h="",g=d,v=0;e:do{if(h=i[d],-1<(v=a.indexOf(h))){let e=c[v];if(void 0===e||""===e){g=d+1,m=!0;break e}if("string"==typeof e&&e===i.substring(d+1,d+1+e.length)){g=d+1+e.length,m=!0;break e}}if(u===h){let t=n.escape[i[d+1]];if(null!=t)h=t,d++,f++;else{if(!n.allowUnknownEscape)return{done:!1,val:"",bad:e.bad("invalid_escape",d,d+1)};h=n.preserveEscapeChar?i.substring(d,d+2):i[d+1],d++}}l.push(h),d++,f++,"\n"===h&&(p++,f=0)}while(d<=i.length);if(m){if(!1!==o.consume){let e=i.substring(d,g);if(!Array.isArray(o.consume)||o.consume.includes(e)){let e=d;for(;e<g;e++)d++,f++,"\n"===i[e]&&(p++,f=0)}}t.sI=d,t.rI=p,t.cI=f}let k=l.join("");return n.trim&&(k=k.trim()),r.value.lex&&void 0!==r.value.def[k]&&(k=r.value.def[k].val),{done:m,val:k}}return n.Hoover=r,r.defaults={block:{},lex:{order:45e5}},n}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),e=e.exports;var t={};return Object.defineProperty(t,"__esModule",{value:!0}),t.Ini=function(t,n){t.use(e.Hoover,{lex:{order:85e5},block:{endofline:{start:{rule:{parent:{include:["pair","elem"]}}},end:{fixed:["\n","\r\n","#",";",""],consume:["\n","\r\n"]},escapeChar:"\\",escape:{"#":"#",";":";","\\":"\\"},preserveEscapeChar:!0,trim:!0},key:{token:"#HK",start:{rule:{current:{exclude:["dive"]},state:"oc"}},end:{fixed:["=","\n","\r\n","#",";",""],consume:!1},escape:{"#":"#",";":";","\\":"\\"},trim:!0},divekey:{token:"#DK",start:{rule:{current:{include:["dive"]}}},end:{fixed:["]","."],consume:!1},escapeChar:"\\",escape:{"]":"]",".":".","\\":"\\"},allowUnknownEscape:!0,trim:!0}}}),t.options({rule:{start:"ini",exclude:"jsonic"},lex:{emptyResult:{}},fixed:{token:{"#EQ":"=","#DOT":".","#OB":null,"#CB":null,"#CL":null}},line:{check:e=>{if("val"===e.ctx.rule.name)return{done:!0,token:void 0}}},number:{lex:!1},string:{lex:!0,chars:"'\"",abandon:!0},text:{lex:!1},comment:{def:{hash:{eatline:!0},slash:null,multi:null,semi:{line:!0,start:";",lex:!0,eatline:!0}}}});const{ZZ:r,ST:l,VL:i,OS:o,CS:s,CL:a,EQ:c,DOT:u,HV:d,HK:p,DK:f}=t.token,m=[p,l,i];t.rule("ini",e=>{e.bo(e=>{e.node={}}).open([{s:[o],p:"table",b:1},{s:[m,c],p:"table",b:2},{s:[d,o],p:"table",b:2},{s:[r]}])}),t.rule("table",e=>{e.bo(e=>{if(e.node=e.parent.node,e.prev.u.dive){let t=e.prev.u.dive;for(let n=0;n<t.length;n++)e.node=e.node[t[n]]=e.node[t[n]]||{}}}).open([{s:[o],p:"dive"},{s:[m,c],p:"map",b:2},{s:[d,o],p:"map",b:2},{s:[s],p:"map"},{s:[r]}]).bc(e=>{Object.assign(e.node,e.child.node)}).close([{s:[o],r:"table",b:1},{s:[s],r:"table",a:e=>e.u.dive=e.child.u.dive},{s:[r]}])}),t.rule("dive",e=>{e.open([{s:[f,u],a:e=>(e.u.dive=e.parent.u.dive||[]).push(e.o0.val),p:"dive"},{s:[f],a:e=>(e.u.dive=e.parent.u.dive||[]).push(e.o0.val)}]).close([{s:[s],b:1}])}),t.rule("map",e=>{e.open([{s:[m,c],c:e=>"table"===e.parent.name,p:"pair",b:2},{s:[m],c:e=>"table"===e.parent.name,p:"pair",b:1}],{append:!0}).close([{s:[o],b:1},{s:[r]}])}),t.rule("pair",e=>{e.open([{s:[m,c],c:e=>"table"===e.parent.parent.name,p:"val",a:e=>{let t=""+e.o0.val;Array.isArray(e.node[t])?e.u.ini_array=e.node[t]:(e.u.key=t,2<t.length&&t.endsWith("[]")?(t=e.u.key=t.slice(0,-2),e.node[t]=e.u.ini_array=Array.isArray(e.node[t])?e.node[t]:void 0===e.node[t]?[]:[e.node[t]]):e.u.pair=!0)}},{s:[p],c:e=>"table"===e.parent.parent.name,a:e=>{let t=e.o0.val;"string"==typeof t&&0<t.length&&(e.parent.node[t]=!0)}}]).close([{s:[m,a],c:e=>"table"===e.parent.parent.name,e:e=>e.c1},{s:[m],b:1,r:"pair"},{s:[o],b:1}])}),t.rule("val",e=>{e.open([{s:[[o,s]],r:"val",u:{ini_prev:!0}},{s:[r],a:e=>e.node=""}],{custom:e=>e.filter(e=>"json,list"!==e.g.join())}).ac(e=>{if(l===e.o0.tin&&"'"===e.o0.src[0])try{e.node=JSON.parse(e.node)}catch(t){}null!=e.prev.u.ini_prev?e.prev.node=e.node=e.prev.o0.src+e.node:e.parent.u.ini_array&&e.parent.u.ini_array.push(e.node)})})},t}));