return u()}());case'"':return x?(u(),a("string",e)):void(e+=u());case"'":return x?void(e+=u()):(u(),a("string",e));case` `:case"\r":throw E(u());case"\u2028":case"\u2029":D=A,console.warn(`JSON11: '${P(D)}' in strings is not valid ECMAScript; consider escaping`);break;case void 0:throw E(u())}var D;e+=u()},start(){switch(A){case"{":case"[":return a("punctuator",u());case void 0:return a("eof")}C="value"},beforePropertyName(){switch(A){case"$":case"_":return e=u(),void(C="identifierName");case"\\":return u(),void(C="identifierNameStartEscape");case"}":return a("punctuator",u());case'"':case"'":return x=u()==='"',void(C="string")}if(T(A))return e+=u(),void(C="identifierName");throw E(u())},afterPropertyName(){if(A===":")return a("punctuator",u());throw E(u())},beforePropertyValue(){C="value"},afterPropertyValue(){switch(A){case",":case"}":return a("punctuator",u())}throw E(u())},beforeArrayValue(){if(A==="]")return a("punctuator",u());C="value"},afterArrayValue(){switch(A){case",":case"]":return a("punctuator",u())}throw E(u())},end(){throw E(u())}},L={start(){if(r.type==="eof")throw o();B()},beforePropertyName(){switch(r.type){case"identifier":case"string":return S=r.value,void(p="afterPropertyName");case"punctuator":return void F();case"eof":throw o()}},afterPropertyName(){if(r.type==="eof")throw o();p="beforePropertyValue"},beforePropertyValue(){if(r.type==="eof")throw o();B()},beforeArrayValue(){if(r.type==="eof")throw o();r.type!=="punctuator"||r.value!=="]"?B():F()},afterPropertyValue(){if(r.type==="eof")throw o();switch(r.value){case",":return void(p="beforePropertyName");case"}":F()}},afterArrayValue(){if(r.type==="eof")throw o();switch(r.value){case",":return void(p="beforeArrayValue");case"]":F()}},end(){}};do r=j(),L[p]();while(r.type!=="eof");return typeof s=="function"?function D(t,c,k){const y=t[c];if(y!=null&&typeof y=="object")if(Array.isArray(y))for(let _=0;_Number.MAX_SAFE_INTEGER||c0;){const c=g();if(!z(c))throw E(u());D+=u()}return String.fromCodePoint(parseInt(D,16))}function B(){let D;switch(r.type){case"punctuator":switch(r.value){case"{":D={};break;case"[":D=[]}break;case"null":case"boolean":case"numeric":case"string":case"bigint":D=r.value}if(O===void 0)O=D;else{const t=m[m.length-1];Array.isArray(t)?t.push(D):Object.defineProperty(t,S,{value:D,writable:!0,enumerable:!0,configurable:!0})}if(D!==null&&typeof D=="object")m.push(D),p=Array.isArray(D)?"beforeArrayValue":"beforePropertyName";else{const t=m[m.length-1];p=t==null?"end":Array.isArray(t)?"afterArrayValue":"afterPropertyValue"}}function F(){m.pop();const D=m[m.length-1];p=D==null?"end":Array.isArray(D)?"afterArrayValue":"afterPropertyValue"}function E(D){return d(D===void 0?`JSON11: invalid end of input at ${v}:${h}`:`JSON11: invalid character '${P(D)}' at ${v}:${h}`)}function o(){return d(`JSON11: invalid end of input at ${v}:${h}`)}function l(){return h-=5,d(`JSON11: invalid identifier character at ${v}:${h}`)}function P(D){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[D])return t[D];if(D<" "){const c=D.charCodeAt(0).toString(16);return"\\x"+("00"+c).substring(c.length)}return D}function d(D){const t=new SyntaxError(D);return Object.defineProperty(t,"lineNumber",{value:v,writable:!0,enumerable:!0,configurable:!0}),Object.defineProperty(t,"columnNumber",{value:h,writable:!0,enumerable:!0,configurable:!0}),t}},exports.stringify=function(i,s,V,r){var g,u,a,b,N;const S=[];let O,C,e,x,f,A="",w="",p=function(n){if(n.length===0)return j(n);const B=String.fromCodePoint(n.codePointAt(0));if(!T(B))return j(n);for(let F=B.length;F0)return" ".repeat(Math.min(10,Math.floor(B)))}else if(typeof n=="string"||n instanceof String)return n.substring(0,10);return""}function L(n,B){let F=B[n];switch(F!=null&&(typeof F.toJSON11=="function"?F=F.toJSON11(n):typeof F.toJSON5=="function"?F=F.toJSON5(n):typeof F.toJSON=="function"&&(F=F.toJSON(n))),C&&(F=C.call(B,n,F)),F instanceof Number?F=Number(F):F instanceof String?F=String(F):F instanceof Boolean&&(F=F.valueOf()),F){case null:return"null";case!0:return"true";case!1:return"false"}return typeof F=="string"?j(F):typeof F=="number"?String(F):typeof F=="bigint"?F.toString()+(x===!1?"":"n"):typeof F=="object"?Array.isArray(F)?function(E){if(S.includes(E))throw TypeError("Converting circular structure to JSON11");S.push(E);let o=A;A+=w;let l,P=[];for(let d=0;d$[E]<$[o]?E:o);return B=B.replace(new RegExp(F,"g"),v[F]),F+B+F}}; //# sourceMappingURL=index.min.cjs.map