UNPKG

json-6

Version:
2 lines (1 loc) 19.5 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).JSON5=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=function(e){return e&&e.Math==Math&&e},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")(),i=function(e){try{return!!e()}catch(e){return!0}},a=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,c={f:s&&!o.call({1:2},1)?function(e){var t=s(this,e);return!!t&&t.enumerable}:o},u=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},l={}.toString,f="".split,p=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==function(e){return l.call(e).slice(8,-1)}(e)?f.call(e,""):Object(e)}:Object,g=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},h=function(e){return p(g(e))},b=function(e){return"object"==typeof e?null!==e:"function"==typeof e},y=function(e,t){if(!b(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!b(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!b(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!b(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},d={}.hasOwnProperty,v=function(e,t){return d.call(e,t)},m=r.document,k=b(m)&&b(m.createElement),w=!a&&!i((function(){return 7!=Object.defineProperty((e="div",k?m.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),_=Object.getOwnPropertyDescriptor,x={f:a?_:function(e,t){if(e=h(e),t=y(t,!0),w)try{return _(e,t)}catch(e){}if(v(e,t))return u(!c.f.call(e,t),e[t])}},S=function(e){if(!b(e))throw TypeError(String(e)+" is not an object");return e},j=Object.defineProperty,O={f:a?j:function(e,t,n){if(S(e),t=y(t,!0),S(n),w)try{return j(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},P=a?function(e,t,n){return O.f(e,t,u(1,n))}:function(e,t,n){return e[t]=n,e},E=function(e,t){try{P(r,e,t)}catch(n){r[e]=t}return t},N=r["__core-js_shared__"]||E("__core-js_shared__",{}),A=Function.toString;"function"!=typeof N.inspectSource&&(N.inspectSource=function(e){return A.call(e)});var C,I,T,$,M=N.inspectSource,F=r.WeakMap,q="function"==typeof F&&/native code/.test(M(F)),z=t((function(e){(e.exports=function(e,t){return N[e]||(N[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),L=0,J=Math.random(),D=z("keys"),W={},G=r.WeakMap;if(q){var R=new G,U=R.get,K=R.has,Q=R.set;C=function(e,t){return Q.call(R,e,t),t},I=function(e){return U.call(R,e)||{}},T=function(e){return K.call(R,e)}}else{var V=D[$="state"]||(D[$]=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++L+J).toString(36)}($));W[V]=!0,C=function(e,t){return P(e,V,t),t},I=function(e){return v(e,V)?e[V]:{}},T=function(e){return v(e,V)}}var X={set:C,get:I,has:T,enforce:function(e){return T(e)?I(e):C(e,{})},getterFor:function(e){return function(t){var n;if(!b(t)||(n=I(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Y=t((function(e){var t=X.get,n=X.enforce,i=String(String).split("String");(e.exports=function(e,t,a,o){var s=!!o&&!!o.unsafe,c=!!o&&!!o.enumerable,u=!!o&&!!o.noTargetGet;"function"==typeof a&&("string"!=typeof t||v(a,"name")||P(a,"name",t),n(a).source=i.join("string"==typeof t?t:"")),e!==r?(s?!u&&e[t]&&(c=!0):delete e[t],c?e[t]=a:P(e,t,a)):c?e[t]=a:E(t,a)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||M(this)}))})),B=r,H=function(e){return"function"==typeof e?e:void 0},Z=Math.ceil,ee=Math.floor,te=function(e){return isNaN(e=+e)?0:(e>0?ee:Z)(e)},ne=Math.min,re=Math.max,ie=Math.min,ae=function(e,t){var n=te(e);return n<0?re(n+t,0):ie(n,t)},oe=function(e){return function(t,n,r){var i,a,o=h(t),s=(i=o.length)>0?ne(te(i),9007199254740991):0,c=ae(r,s);if(e&&n!=n){for(;s>c;)if((a=o[c++])!=a)return!0}else for(;s>c;c++)if((e||c in o)&&o[c]===n)return e||c||0;return!e&&-1}},se={includes:oe(!0),indexOf:oe(!1)}.indexOf,ce=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),ue={f:Object.getOwnPropertyNames||function(e){return function(e,t){var n,r=h(e),i=0,a=[];for(n in r)!v(W,n)&&v(r,n)&&a.push(n);for(;t.length>i;)v(r,n=t[i++])&&(~se(a,n)||a.push(n));return a}(e,ce)}},le={f:Object.getOwnPropertySymbols},fe=function(e,t){return arguments.length<2?H(B[e])||H(r[e]):B[e]&&B[e][t]||r[e]&&r[e][t]}("Reflect","ownKeys")||function(e){var t=ue.f(S(e)),n=le.f;return n?t.concat(n(e)):t},pe=function(e,t){for(var n=fe(t),r=O.f,i=x.f,a=0;a<n.length;a++){var o=n[a];v(e,o)||r(e,o,i(t,o))}},ge=/#|\.prototype\./,he=function(e,t){var n=ye[be(e)];return n==ve||n!=de&&("function"==typeof t?i(t):!!t)},be=he.normalize=function(e){return String(e).replace(ge,".").toLowerCase()},ye=he.data={},de=he.NATIVE="N",ve=he.POLYFILL="P",me=he,ke=x.f,we=function(e,t){var n,i,a,o,s,c=e.target,u=e.global,l=e.stat;if(n=u?r:l?r[c]||E(c,{}):(r[c]||{}).prototype)for(i in t){if(o=t[i],a=e.noTargetGet?(s=ke(n,i))&&s.value:n[i],!me(u?i:c+(l?".":"#")+i,e.forced)&&void 0!==a){if(typeof o==typeof a)continue;pe(o,a)}(e.sham||a&&a.sham)&&P(o,"sham",!0),Y(n,i,o,e)}},_e=function(e){return function(t,n){var r,i,a=String(g(t)),o=te(n),s=a.length;return o<0||o>=s?e?"":void 0:(r=a.charCodeAt(o))<55296||r>56319||o+1===s||(i=a.charCodeAt(o+1))<56320||i>57343?e?a.charAt(o):r:e?a.slice(o,o+2):i-56320+(r-55296<<10)+65536}},xe={codeAt:_e(!1),charAt:_e(!0)}.codeAt;we({target:"String",proto:!0},{codePointAt:function(e){return xe(this,e)}});var Se,je,Oe=function(e,t,n){if(function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function")}(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},Pe=Function.call,Ee=(Se="codePointAt",Oe(Pe,r["String"].prototype[Se],je),String.fromCharCode),Ne=String.fromCodePoint;we({target:"String",stat:!0,forced:!!Ne&&1!=Ne.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,i=0;r>i;){if(t=+arguments[i++],ae(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?Ee(t):Ee(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}});B.String.fromCodePoint;return t((function(e,t){const n=[];function r(){return n.pop()||{context:0,elements:null,element_array:null}}function i(e){n.push(e)}const a=[];function o(e){a.push(e)}const s=t;s.escape=function(e){let t="";if(!e)return e;for(let n=0;n<e.length;n++){const r=e[n];'"'!=r&&"\\"!=r&&"`"!=r&&"'"!=r||(t+="\\"),t+=r}return t},s.begin=function(e,t){const n={name:null,value_type:0,string:"",contains:null},s={line:1,col:1};let c=0,u=0,l=!0,f=!1,p=null,g=void 0,h=[],b=0,y=0,d=!1,v=!1,m=!1,k=!1,w=!1,_=null,x=!1,S=!1,j=!1,O=!1,P=!1,E=!1,N=!1,A=0,C=0,I=!1;const T={first:null,last:null,saved:null,push(e){let t=this.saved;t?(this.saved=t.next,t.node=e,t.next=null,t.prior=this.last):t={node:e,next:null,prior:this.last},this.last||(this.first=t),this.last=t},pop(){const e=this.last;return(this.last=e.prior)||(this.first=null),e.next=this.saved,this.saved=e,e.node}},$={first:null,last:null,saved:null,push(e){let t=this.saved;t?(this.saved=t.next,t.node=e,t.next=null,t.prior=this.last):t={node:e,next:null,prior:this.last},this.last?this.last.next=t:this.first=t,this.last=t},shift(){const e=this.first;return e?(this.first=e.next,this.first||(this.last=null),e.next=this.saved,this.saved=e,e.node):null},unshift(e){const t=this.saved;this.saved=t.next,t.node=e,t.next=this.first,t.prior=null,this.first||(this.last=t),this.first=t}};function M(e){throw new Error(`${e} at ${c} [${s.line}:${s.col}]`)}return{finalError(){if(0!==y)switch(y){case 1:return M("Comment began at end of document");case 2:console.log("Warning: '//' comment without end of line ended document");break;case 3:return M("Open comment '/*' is missing close at end of document");case 4:return M("Incomplete '/* *' close at end of document")}x&&M("Incomplete string")},value(){this.finalError();const e=p;return p=void 0,e},reset(){u=0,l=!0,$.last&&($.last.next=$.save),$.save=$.first,$.first=$.last=null,T.last&&(T.last.next=T.save),T.save=$.first,T.first=T.last=null,h=null,g=void 0,b=0,n.value_type=0,n.name=null,n.string="",s.line=1,s.col=1,f=!1,y=0,I=!1,x=!1,j=!1,O=!1},write(n){let r;if(void 0!==n&&"string"!=typeof n&&(n=String(n)),!l)throw new Error("Parser is in an error state, please reset.");for(r=this._write(n,!1);r>0&&(this.finalError(),"function"==typeof t&&function e(n,r){const i=n[r];if(i&&"object"==typeof i)for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)){const n=e(i,t);void 0!==n?i[t]=n:delete i[t]}return t.call(n,r,i)}({"":p},""),e(p),p=void 0,!(r<2));r=this._write());r&&this.finalError()},_write(e,t){let M,F,q=0;function z(e,t){throw new Error(`${e} '${String.fromCodePoint(t)}' unexpected at ${c} (near '${F.substr(c>4?c-4:0,c>4?3:c-1)}[${String.fromCodePoint(t)}]${F.substr(c,10)}') [${s.line}:${s.col}]`)}function L(){n.value_type=0,n.string=""}function J(){switch(n.value_type){case 5:h.push((f?-1:1)*Number(n.string));break;case 4:h.push(n.string);break;case 2:h.push(!0);break;case 3:h.push(!1);break;case 8:case 9:h.push(NaN);break;case 10:h.push(-1/0);break;case 11:h.push(1/0);break;case 1:h.push(null);break;case-1:h.push(void 0);break;case 13:h.push(void 0),delete h[h.length-1];break;case 6:case 7:h.push(n.contains)}}function D(){switch(n.value_type){case 5:g[n.name]=(f?-1:1)*Number(n.string);break;case 4:g[n.name]=n.string;break;case 2:g[n.name]=!0;break;case 3:g[n.name]=!1;break;case 8:case 9:g[n.name]=NaN;break;case 10:g[n.name]=-1/0;break;case 11:g[n.name]=1/0;break;case 1:g[n.name]=null;break;case-1:g[n.name]=void 0;break;case 6:case 7:g[n.name]=n.contains}}function W(e){let t=0;for(;0==t&&c<F.length;){let r=F.charAt(c);const i=F.codePointAt(c++);if(i>=65536&&(r+=F.charAt(c),c++),s.col++,i==e)j?(N?z("Incomplete hexidecimal sequence",i):P?z("Incomplete long unicode sequence",i):E&&z("Incomplete unicode sequence",i),O?(O=!1,t=1):n.string+=r,j=!1):t=1;else if(j){if(P){if(125==i){n.string+=String.fromCodePoint(A),P=!1,E=!1,j=!1;continue}A*=16,i>=48&&i<=57?A+=i-48:i>=65&&i<=70?A+=i-65+10:i>=97&&i<=102?A+=i-97+10:z("(escaped character, parsing hex of \\u)",i);continue}if(N||E){if(0===C&&123===i){P=!0;continue}A*=16,i>=48&&i<=57?A+=i-48:i>=65&&i<=70?A+=i-65+10:i>=97&&i<=102?A+=i-97+10:z(E?"(escaped character, parsing hex of \\u)":"(escaped character, parsing hex of \\x)",i),C++,E?4==C&&(n.string+=String.fromCodePoint(A),E=!1,j=!1):2==C&&(n.string+=String.fromCodePoint(A),N=!1,j=!1);continue}switch(i){case 13:O=!0,s.col=1;continue;case 8232:case 8233:s.col=1;case 10:O?O=!1:s.col=1,s.line++;break;case 116:n.string+="\t";break;case 98:n.string+="\b";break;case 48:n.string+="\0";break;case 110:n.string+="\n";break;case 114:n.string+="\r";break;case 102:n.string+="\f";break;case 118:n.string+="\v";break;case 120:N=!0,C=0,A=0;continue;case 117:E=!0,C=0,A=0;continue;default:n.string+=r}j=!1}else 92===i?j=!0:(O&&(O=!1,s.line++,s.col=2),n.string+=r)}return t}function G(){let e;for(;(e=c)<F.length;){const r=F.charAt(e),i=F.codePointAt(c++);if(i>=65536&&z("fault while parsing number;",i),95!=i)if(s.col++,i>=48&&i<=57)m&&(w=!0),n.string+=r;else if(45==i||43==i)0==n.string.length||m&&!k&&!w?(n.string+=r,k=!0):(l=!1,z("fault while parsing number;",i));else if(46==i)v||d||m?(l=!1,z("fault while parsing number;",i)):(n.string+=r,v=!0);else if(d&&(i>=95&&i<=102||i>=65&&i<=70))n.string+=r;else if(120==i||98==i||111==i||88==i||66==i||79==i)d||"0"!=n.string?(l=!1,z("fault while parsing number;",i)):(d=!0,n.string+=r);else{if(101!=i&&69!=i){if(32==i||160==i||13==i||10==i||9==i||65279==i||44==i||125==i||93==i||58==i)break;t&&(l=!1,z("fault while parsing number;",i));break}m?(l=!1,z("fault while parsing number;",i)):(n.string+=r,m=!0)}}c=e,t||c!=F.length?(S=!1,n.value_type=5,0==b&&(I=!0)):S=!0}if(!l)return-1;if(e&&e.length)M=function(){let e=a.pop();return e?e.n=0:e={buf:null,n:0},e}(),M.buf=e,$.push(M);else if(S){if(S=!1,n.value_type=5,0!=b)throw new Error("context stack is not empty at flush");I=!0,q=1}for(;l&&(M=$.shift());){if(c=M.n,F=M.buf,x){W(_)>0&&(x=!1,n.value_type=4)}for(S&&G();!I&&l&&c<F.length;){let e=F.charAt(c);const t=F.codePointAt(c++);if(t>=65536&&(e+=F.charAt(c),c++),s.col++,y)1==y?42==t?y=3:47!=t?z("fault while parsing;",t):y=2:2==y?10!=t&&13!=t||(y=0):3==y?42==t&&(y=4):y=47==t?0:3;else{switch(t){case 47:y=1;break;case 123:(29==u||30==u||3==b&&0==u)&&z("fault while parsing; getting field name unexpected ",t);{const e=r();n.value_type=6;const t={};0==b&&(p=g=t),e.context=b,e.elements=g,e.element_array=h,e.name=n.name,g=t,T.push(e),L(),b=3}break;case 91:if(3!=b&&29!=u&&30!=u||z("Fault while parsing; while getting field name unexpected",t),0==n.value_type||-1==n.value_type){const e=r();n.value_type=7;const t=[];0==b?p=h=t:4==b&&(g[n.name]=t),e.context=b,e.elements=g,e.element_array=h,e.name=n.name,h=t,T.push(e),L(),b=1}else z("Unexpected array open after previous value",t);break;case 58:3==b?(u=0,n.name=n.string,n.string="",b=4,n.value_type=0):z(1==b?"(in array, got colon out of string):parsing fault;":"(outside any object, got colon out of string):parsing fault;",t);break;case 125:if(31==u&&(u=0),3==b){n.value_type=6,n.contains=g;const e=T.pop();n.name=e.name,b=e.context,g=e.elements,h=e.element_array,i(e),0==b&&(I=!0)}else if(4==b){0!=n.value_type?D():z("Fault while parsing field value, close with no value",t),n.value_type=6,n.contains=g;const e=T.pop();n.name=e.name,b=e.context,g=e.elements,h=e.element_array,i(e),0==b&&(I=!0)}else z("Fault while parsing; unexpected",t);f=!1;break;case 93:if(31==u&&(u=0),1==b){0!=n.value_type&&J(),n.value_type=7,n.contains=h;{const e=T.pop();n.name=e.name,b=e.context,g=e.elements,h=e.element_array,i(e)}0==b&&(I=!0)}else z(`bad context ${b}; fault while parsing`,t);f=!1;break;case 44:31==u&&(u=0),1==b?(0==n.value_type&&(n.value_type=13),J(),L()):4==b?(b=3,0!=n.value_type?(D(),L()):z("Unexpected comma after object field name",t)):(l=!1,z("bad context; excessive commas while parsing;",t)),f=!1;break;default:if(3==b)switch(t){case 96:case 34:case 39:if(0==u){0!=n.value_type&&z("String begin after previous value",t),W(t)?n.value_type=4:(_=t,x=!0)}else z("fault while parsing; quote not at start of field name",t);break;case 10:s.line++,s.col=1;case 13:case 32:case 160:case 9:case 65279:31==u?u=0:29==u&&(u=30);break;default:30==u&&(l=!1,z("fault while parsing; character unexpected",t)),0==u&&(u=29),n.string+=e}else switch(t){case 96:case 34:case 39:if(0===n.value_type){W(t)?(n.value_type=4,u=31):(_=t,x=!0)}else z("String unexpected",t);break;case 10:s.line++,s.col=1;case 32:case 160:case 9:case 13:case 65279:if(31==u){u=0,0==b&&(I=!0);break}0!==u&&(l=!1,z("fault parsing whitespace",t));break;case 116:0==u?u=1:27==u?u=28:(l=!1,z("fault parsing",t));break;case 114:1==u?u=2:(l=!1,z("fault parsing",t));break;case 117:2==u?u=3:9==u?u=10:0==u?u=12:(l=!1,z("fault parsing",t));break;case 101:3==u?(n.value_type=2,u=31):8==u?(n.value_type=3,u=31):14==u?u=15:18==u?u=19:(l=!1,z("fault parsing",t));break;case 110:0==u?u=9:12==u?u=13:17==u?u=18:22==u?u=23:25==u?u=26:(l=!1,z("fault parsing",t));break;case 100:13==u?u=14:19==u?(n.value_type=-1,u=31):(l=!1,z("fault parsing",t));break;case 105:16==u?u=17:24==u?u=25:26==u?u=27:(l=!1,z("fault parsing",t));break;case 108:10==u?u=11:11==u?(n.value_type=1,u=31):6==u?u=7:(l=!1,z("fault parsing",t));break;case 102:0==u?u=5:15==u?u=16:23==u?u=24:(l=!1,z("fault parsing",t));break;case 97:5==u?u=6:20==u?u=21:(l=!1,z("fault parsing",t));break;case 115:7==u?u=8:(l=!1,z("fault parsing",t));break;case 73:0==u?u=22:(l=!1,z("fault parsing",t));break;case 78:0==u?u=20:21==u?(n.value_type=f?8:9,f=!1,u=31):(l=!1,z("fault parsing",t));break;case 121:28==u?(n.value_type=f?10:11,f=!1,u=31):(l=!1,z("fault parsing",t));break;case 45:0==u?f=!f:(l=!1,z("fault parsing",t));break;case 43:0!==u&&(l=!1,z("fault parsing",t));break;default:t>=48&&t<=57||43==t||46==t||45==t?(d=!1,m=!1,k=!1,w=!1,v=!1,n.string=e,M.n=c,G()):(l=!1,z("fault parsing",t))}}if(I){31==u&&(u=0);break}}}if(c==F.length?(o(M),x||S||3==b?q=0:0!=b||0==n.value_type&&!p||(I=!0,q=1)):(M.n=c,$.unshift(M),q=2),I)break}if(I&&0!=n.value_type){switch(n.value_type){case 5:p=(f?-1:1)*Number(n.string);break;case 4:p=n.string;break;case 2:p=!0;break;case 3:p=!1;break;case 1:p=null;break;case-1:p=void 0;break;case 9:case 8:p=NaN;break;case 11:p=1/0;break;case 10:p=-1/0;break;case 6:case 7:p=n.contains}f=!1,n.string="",n.value_type=0}return I=!1,q}}};const c=[Object.freeze(s.begin())];let u=0;s.parse=function(e,t){const n=u++;c.length<=n&&c.push(Object.freeze(s.begin()));const r=c[n];if("string"!=typeof e&&(e=String(e)),r.reset(),r._write(e,!0)>0){const e=r.value();return"function"==typeof t&&function e(n,r){const i=n[r];if(i&&"object"==typeof i)for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)){const n=e(i,t);void 0!==n?i[t]=n:delete i[t]}return t.call(n,r,i)}({"":e},""),u--,e}r.finalError()},s.stringify=JSON.stringify,s.stringifierActive=null,s.stringifier=function(){const e={true:!0,false:!1,null:null,NaN:NaN,Infinity:1/0,undefined:void 0};let t='"',n=!1;return{stringify(e,t,i,a){return function(e,t,i,a,o){if(void 0===t)return"undefined";if(null===t)return"null";let c,u,l;const f=typeof a,p=typeof i;c="",u="";const g=s.stringifierActive;s.stringifierActive=e,o||(o="");if("number"===f)for(l=0;l<a;l+=1)u+=" ";else"string"===f&&(u=a);const h=i;if(i&&"function"!==p&&("object"!==p||"number"!=typeof i.length))throw new Error("JSON6.stringify unknown replacer type.");const b=function e(t,i){let a,o,s,l;const f=c;let p,g=i[t];"string"==typeof g&&(g=r(g));null!=g&&"object"==typeof g&&"function"==typeof toJSOX&&(c+=u,c=f);"function"==typeof h&&(g=h.call(i,t,g));switch(typeof g){case"string":return g;case"number":return""+g;case"boolean":return String(g);case"object":if(!g)return"null";if(c+=u,p=[],h&&"object"==typeof h)for(l=h.length,a=0;a<l;a+=1)"string"==typeof h[a]&&(o=h[a],s=e(o,g),s&&p.push(r(o)+(c?": ":":")+s));else{const t=[];for(o in g)if((!n||Object.prototype.propertyIsEnumerable.call(g,o))&&Object.prototype.hasOwnProperty.call(g,o)){let e;for(e=0;e<t.length;e++)if(t[e]>o){t.splice(e,0,o);break}e===t.length&&t.push(o)}for(let n=0;n<t.length;n++)o=t[n],Object.prototype.hasOwnProperty.call(g,o)&&(s=e(o,g),s&&p.push(r(o)+(c?": ":":")+s))}return s=0===p.length?"{}":c?"{\n"+c+p.join(",\n"+c)+"\n"+f+"}":"{"+p.join(",")+"}",c=f,s}}(o,{[o]:t});return s.stringifierActive=g,b}(this,e,t,i,a)},setQuote(e){t=e},get ignoreNonEnumerable(){return n},set ignoreNonEnumerable(e){n=e}};function r(n){return"number"!=typeof n||isNaN(n)?n.length?n in e||/([0-9-])/.test(n[0])||/((\n|\r|\t)|[ #{}()<>!+\-*/.:,])/.test(n)?t+s.escape(n)+t:n:t+t:["'",n.toString(),"'"].join()}},s.stringify=function(e,t,n){return s.stringifier().stringify(e,t,n)},s.version="1.1.1"}))}));