var json = (function () { var commonjsGlobal$1 = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createError$1(e,t){const n=new SyntaxError(e+" ("+t.start.line+":"+t.start.column+")");return n.loc=t,n}function createCommonjsModule$$1(e,t){return t={exports:{}},e(t,t.exports),t.exports}function parse(e){const t=parse$1;try{const n=t(e);return toBabylon(n)}catch(e){const t=e.message.indexOf("\n"),n=e.message.slice(0,t),r=n.lastIndexOf(" "),o=n.slice(0,r),l=n.slice(r+1),a=l.split(":").map(Number);throw createError("(json-to-ast) "+o,{start:{line:a[0],column:a[1]}})}}function toBabylon(e){const t={type:{object:"ObjectExpression",property:"ObjectProperty",identifier:"json-identifier",array:"ArrayExpression"}[e.type],start:e.loc.start.offset,end:e.loc.end.offset,loc:e.loc};switch(e.type){case"object":return Object.assign(t,{properties:e.children.map(toBabylon)});case"property":return Object.assign(t,{key:toBabylon(e.key),value:toBabylon(e.value)});case"identifier":return Object.assign(t,{value:e.value});case"array":return Object.assign(t,{elements:e.children.map(toBabylon)});case"literal":{const n={String:"StringLiteral",Number:"NumericLiteral",Boolean:"BooleanLiteral"},r=JSON.parse(e.rawValue),o=null===r?"NullLiteral":n[r.constructor.name];return Object.assign(t,{type:o,value:r,extra:{raw:e.rawValue}})}}}var parserCreateError=createError$1; var commonjsGlobal$$1="undefined"!=typeof window?window:"undefined"!=typeof commonjsGlobal$1?commonjsGlobal$1:"undefined"!=typeof self?self:{}; var parse$1=createCommonjsModule$$1(function(e,t){!function(t,n){n(e);}(0,function(e){function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t);}function o(e,t,n){return e.split(/\n|\r\n?|\f/)[t-1]+"\n"+(new Array(n).join(" ")+"^")}function l(e){return e>="1"&&e<="9"}function a(e){return e>="0"&&e<="9"}function c(e){return a(e)||e>="a"&&e<="f"||e>="A"&&e<="F"}function s(e){return"e"===e||"E"===e}function u(e,t,n,r){var o=e.charAt(t);if("\r"===o)t++,n++,r=1,"\n"===e.charAt(t)&&t++;else if("\n"===o)t++,n++,r=1;else{if("\t"!==o&&" "!==o)return null;t++,r++;}return{index:t,line:n,column:r}}function i(e,t,n,r){var o=e.charAt(t);return o in x?{type:x[o],line:n,column:r+1,index:t+1,value:null}:null}function f(e,t,n,r){for(var o in S)if(S.hasOwnProperty(o)&&e.substr(t,o.length)===o){var l=S[o],a=l.type,c=l.value;return{type:a,line:n,column:r+o.length,index:t+o.length,value:c}}return null}function p(e,t,n,r){for(var o=t,l="",a=N._START_;t0?{type:I.NUMBER,line:n,column:r+c-o,index:c,value:parseFloat(e.substring(o,c))}:null}function d(e,t){for(var n=1,r=1,o=0,l=[];o at "+t+":"+n}},C={cannotTokenizeSymbol:function(e,t,n){return"Cannot tokenize symbol <"+e+"> at "+t+":"+n}},I={LEFT_BRACE:0,RIGHT_BRACE:1,LEFT_BRACKET:2,RIGHT_BRACKET:3,COLON:4,COMMA:5,STRING:6,NUMBER:7,TRUE:8,FALSE:9,NULL:10},x={"{":I.LEFT_BRACE,"}":I.RIGHT_BRACE,"[":I.LEFT_BRACKET,"]":I.RIGHT_BRACKET,":":I.COLON,",":I.COMMA},S={true:{type:I.TRUE,value:!0},false:{type:I.FALSE,value:!1},null:{type:I.NULL,value:null}},N={_START_:0,START_QUOTE_OR_CHAR:1,ESCAPE:2},k={'"':0,"\\":1,"/":2,b:3,f:4,n:5,r:6,t:7,u:8},P={_START_:0,MINUS:1,ZERO:2,DIGIT:3,POINT:4,DIGIT_FRACTION:5,EXP:6,EXP_DIGIT_OR_SIGN:7},g=[I.STRING,I.NUMBER,I.TRUE,I.FALSE,I.NULL],w={_START_:0,OPEN_OBJECT:1,PROPERTY:2,COMMA:3},L={_START_:0,KEY:1,COLON:2},M={_START_:0,OPEN_ARRAY:1,VALUE:2,COMMA:3},B={verbose:!0,source:null},G=function(e,t){var n=d(e,t=y({},B,t));0===n.length&&m(h.unexpectedEnd());var r=O(e,n,0,t);if(r.index===n.length)return r.value;var o=n[r.index];m(h.unexpectedToken(e.substring(o.loc.start.offset,o.loc.end.offset),o.loc.start.line,o.loc.start.column),e,o.loc.start.line,o.loc.start.column);};e.exports=G;});});const createError=parserCreateError;var parserJson=parse;var parserJson_1=parserJson; return parserJson_1; }());