/*! For license information please see index.js.LICENSE.txt */ (()=>{var __webpack_modules__={9282:(e,t,r)=>{"use strict";var n=r(4155);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o,a,s=r(2136).codes,l=s.ERR_AMBIGUOUS_ARGUMENT,c=s.ERR_INVALID_ARG_TYPE,u=s.ERR_INVALID_ARG_VALUE,p=s.ERR_INVALID_RETURN_VALUE,_=s.ERR_MISSING_ARGS,f=r(5961),h=r(9539).inspect,d=r(9539).types,g=d.isPromise,y=d.isRegExp,m=Object.assign?Object.assign:r(8091).assign,b=Object.is?Object.is:r(609);function w(){var e=r(9158);o=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var x=!1,v=e.exports=S,E={};function O(e){if(e.message instanceof Error)throw e.message;throw new f(e)}function j(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function S(){for(var e=arguments.length,t=new Array(e),r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";var n=r(4155);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;re.length)&&(r=e.length),e.substring(r-t.length,r)===t}var y="",m="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function v(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function E(e){return h(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var O=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==f(e)||null===e)throw new d("options","Object",e);var i=e.message,o=e.operator,l=e.stackStartFn,c=e.actual,u=e.expected,p=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,_(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(y="",m="",w="",b=""):(y="",m="",w="",b="")),"object"===f(c)&&null!==c&&"object"===f(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=v(c),u=v(u)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,_(t).call(this,function(e,t,r){var i="",o="",a=0,s="",l=!1,c=E(e),u=c.split("\n"),p=E(t).split("\n"),_=0,h="";if("strictEqual"===r&&"object"===f(e)&&"object"===f(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===p.length&&u[0]!==p[0]){var d=u[0].length+p[0].length;if(d<=10){if(!("object"===f(e)&&null!==e||"object"===f(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(u[0]," !== ").concat(p[0],"\n")}else if("strictEqualObject"!==r&&d<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][_]===p[0][_];)_++;_>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",_),"^"),_=0)}}for(var v=u[u.length-1],O=p[p.length-1];v===O&&(_++<2?s="\n ".concat(v).concat(s):i=v,u.pop(),p.pop(),0!==u.length&&0!==p.length);)v=u[u.length-1],O=p[p.length-1];var j=Math.max(u.length,p.length);if(0===j){var S=c.split("\n");if(S.length>30)for(S[26]="".concat(y,"...").concat(w);S.length>27;)S.pop();return"".concat(x.notIdentical,"\n\n").concat(S.join("\n"),"\n")}_>3&&(s="\n".concat(y,"...").concat(w).concat(s),l=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var R=0,A=x[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),q=" ".concat(y,"...").concat(w," Lines skipped");for(_=0;_1&&_>2&&(T>4?(o+="\n".concat(y,"...").concat(w),l=!0):T>3&&(o+="\n ".concat(p[_-2]),R++),o+="\n ".concat(p[_-1]),R++),a=_,i+="\n".concat(b,"-").concat(w," ").concat(p[_]),R++;else if(p.length<_+1)T>1&&_>2&&(T>4?(o+="\n".concat(y,"...").concat(w),l=!0):T>3&&(o+="\n ".concat(u[_-2]),R++),o+="\n ".concat(u[_-1]),R++),a=_,o+="\n".concat(m,"+").concat(w," ").concat(u[_]),R++;else{var k=p[_],P=u[_],I=P!==k&&(!g(P,",")||P.slice(0,-1)!==k);I&&g(k,",")&&k.slice(0,-1)===P&&(I=!1,P+=","),I?(T>1&&_>2&&(T>4?(o+="\n".concat(y,"...").concat(w),l=!0):T>3&&(o+="\n ".concat(u[_-2]),R++),o+="\n ".concat(u[_-1]),R++),a=_,o+="\n".concat(m,"+").concat(w," ").concat(P),i+="\n".concat(b,"-").concat(w," ").concat(k),R+=2):(o+=i,i="",1!==T&&0!==_||(o+="\n ".concat(P),R++))}if(R>20&&_30)for(O[26]="".concat(y,"...").concat(w);O.length>27;)O.pop();r=1===O.length?a(this,_(t).call(this,"".concat(h," ").concat(O[0]))):a(this,_(t).call(this,"".concat(h,"\n\n").concat(O.join("\n"),"\n")))}else{var j=E(c),S="",R=x[o];"notDeepEqual"===o||"notEqual"===o?(j="".concat(x[o],"\n\n").concat(j)).length>1024&&(j="".concat(j.slice(0,1021),"...")):(S="".concat(E(u)),j.length>512&&(j="".concat(j.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===o||"equal"===o?j="".concat(R,"\n\n").concat(j,"\n\nshould equal\n\n"):S=" ".concat(o," ").concat(S)),r=a(this,_(t).call(this,"".concat(j).concat(S)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=u,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),l),r.stack,r.name="AssertionError",a(r)}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:h.custom,value:function(e,t){return h(this,function(e){for(var t=1;t{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var a,s,l={};function c(e,t,r){r||(r=Error);var a=function(r){function a(r,o,s){var l,c,u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c=this,u=i(a).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,s)),l=!u||"object"!==n(u)&&"function"!=typeof u?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(c):u,l.code=e,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,r),a}(r);l[e]=a}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,s,l,c,p;if(void 0===a&&(a=r(9282)),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,s.length)===s)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var _=("number"!=typeof p&&(p=0),p+".".length>(c=e).length||-1===c.indexOf(".",p)?"argument":"property");l='The "'.concat(e,'" ').concat(_," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(9539));var i=s.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=l},9158:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(609),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:r(360);function p(e){return e.call.bind(e)}var _=p(Object.prototype.hasOwnProperty),f=p(Object.prototype.propertyIsEnumerable),h=p(Object.prototype.toString),d=r(9539).types,g=d.isAnyArrayBuffer,y=d.isArrayBufferView,m=d.isDate,b=d.isMap,w=d.isRegExp,x=d.isSet,v=d.isNativeError,E=d.isBoxedPrimitive,O=d.isNumberObject,j=d.isStringObject,S=d.isBooleanObject,R=d.isBigIntObject,A=d.isSymbolObject,q=d.isFloat32Array,T=d.isFloat64Array;function k(e){if(0===e.length||e.length>10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function P(e){return Object.keys(e).filter(k).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function I(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,a,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function(){return s(n,o,arguments)};c?c(e.exports,"apply",{value:p}):e.exports.apply=p},4289:(e,t,r)=>{"use strict";var n=r(2215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,l=r(1044)(),c=s&&l,u=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},p=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var a=0;a{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var a,s=r.call(arguments,1),l=function(){if(this instanceof a){var t=o.apply(this,s.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,s.concat(r.call(arguments)))},c=Math.max(0,o.length-s.length),u=[],p=0;p{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new a},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,p=r(1405)(),_=Object.getPrototypeOf||function(e){return e.__proto__},f={},h="undefined"==typeof Uint8Array?n:_(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":p?_([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?_(_([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?_((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?_((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?_(""[Symbol.iterator]()):n,"%Symbol%":p?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":h,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=_(i.prototype))}return d[t]=r,r},y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(8612),b=r(7642),w=m.call(Function.call,Array.prototype.concat),x=m.call(Function.apply,Array.prototype.splice),v=m.call(Function.call,String.prototype.replace),E=m.call(Function.call,String.prototype.slice),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,S=function(e){var t=E(e,0,1),r=E(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return v(e,O,(function(e,t,r,i){n[n.length]=r?v(i,j,"$1"):t||e})),n},R=function(e,t){var r,n=e;if(b(y,n)&&(n="%"+(r=y[n])[0]+"%"),b(d,n)){var o=d[n];if(o===f&&(o=g(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var r=S(e),n=r.length>0?r[0]:"",o=R("%"+n+"%",t),s=o.name,c=o.value,u=!1,p=o.alias;p&&(n=p[0],x(r,w([0,1],p)));for(var _=1,f=!0;_=r.length){var m=l(c,h);c=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[h]}else f=b(c,h),c=c[h];f&&!u&&(d[s]=c)}}return c}},1044:(e,t,r)=>{"use strict";var n=r(210)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(e,t,r)=>{"use strict";var n=r(5419);e.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(e,t,r)=>{"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2584:(e,t,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},8662:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(6410)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},8611:e=>{"use strict";e.exports=function(e){return e!=e}},360:(e,t,r)=>{"use strict";var n=r(5559),i=r(4289),o=r(8611),a=r(9415),s=r(3194),l=n(a(),Number);i(l,{getPolyfill:a,implementation:o,shim:s}),e.exports=l},9415:(e,t,r)=>{"use strict";var n=r(8611);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:(e,t,r)=>{"use strict";var n=r(4289),i=r(9415);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5692:(e,t,r)=>{"use strict";var n=r(9804),i=r(3083),o=r(1924),a=o("Object.prototype.toString"),s=r(6410)(),l="undefined"==typeof globalThis?r.g:globalThis,c=i(),u=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!f&&function(e){var t=!1;return n(_,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},4244:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},609:(e,t,r)=>{"use strict";var n=r(4289),i=r(5559),o=r(4244),a=r(5624),s=r(2281),l=i(a(),Object);n(l,{getPolyfill:a,implementation:o,shim:s}),e.exports=l},5624:(e,t,r)=>{"use strict";var n=r(4244);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(e,t,r)=>{"use strict";var n=r(5624),i=r(4289);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8987:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(1414),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},_={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!_["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),_=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var h=c&&r;if(s&&e.length>0&&!i.call(e,0))for(var d=0;d0)for(var g=0;g{"use strict";var n=Array.prototype.slice,i=r(1414),o=Object.keys,a=o?function(e){return o(e)}:r(8987),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,l=[],c=!1,u=-1;function p(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&_())}function _(){if(!c){var e=a(p);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u1)for(var r=1;r{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},5955:(e,t,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),a=r(5692);function s(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=s(Object.prototype.toString),p=s(Number.prototype.valueOf),_=s(String.prototype.valueOf),f=s(Boolean.prototype.valueOf);if(l)var h=s(BigInt.prototype.valueOf);if(c)var d=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===u(e)}function m(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function v(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===u(e)}function O(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||O(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=v,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=O;var j="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function S(e){return"[object SharedArrayBuffer]"===u(e)}function R(e){return void 0!==j&&(void 0===S.working&&(S.working=S(new j)),S.working?S(e):e instanceof j)}function A(e){return g(e,p)}function q(e){return g(e,_)}function T(e){return g(e,f)}function k(e){return l&&g(e,h)}function P(e){return c&&g(e,d)}t.isSharedArrayBuffer=R,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=A,t.isStringObject=q,t.isBooleanObject=T,t.isBigIntObject=k,t.isSymbolObject=P,t.isBoxedPrimitive=function(e){return A(e)||q(e)||T(e)||k(e)||P(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(v(e)||R(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9539:(e,t,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),_(n,e,n.depth)}function u(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function p(e,t){return e}function _(e,r,n){if(e.customInspect&&r&&j(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return b(i)||(i=_(e,i,n)),i}var o=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),O(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(r);if(0===a.length){if(j(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return e.stylize(Date.prototype.toString.call(r),"date");if(O(r))return f(r)}var c,u="",p=!1,v=["{","}"];return d(r)&&(p=!0,v=["[","]"]),j(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(u=" "+RegExp.prototype.toString.call(r)),E(r)&&(u=" "+Date.prototype.toUTCString.call(r)),O(r)&&(u=" "+f(r)),0!==a.length||p&&0!=r.length?n<0?x(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=p?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,v)):v[0]+u+v[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),T(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=y(r)?_(e,l.value,null):_(e,l.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),w(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function y(e){return null===e}function m(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return void 0===e}function x(e){return v(e)&&"[object RegExp]"===S(e)}function v(e){return"object"==typeof e&&null!==e}function E(e){return v(e)&&"[object Date]"===S(e)}function O(e){return v(e)&&("[object Error]"===S(e)||e instanceof Error)}function j(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(5955),t.isArray=d,t.isBoolean=g,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=x,t.types.isRegExp=x,t.isObject=v,t.isDate=E,t.types.isDate=E,t.isError=O,t.types.isNativeError=O,t.isFunction=j,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function q(){var e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",q(),t.format.apply(t,arguments))},t.inherits=r(5717),t._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!=typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o{"use strict";var n=r(9804),i=r(3083),o=r(1924),a=o("Object.prototype.toString"),s=r(6410)(),l="undefined"==typeof globalThis?r.g:globalThis,c=i(),u=o("String.prototype.slice"),p={},_=r(882),f=Object.getPrototypeOf;s&&_&&f&&n(c,(function(e){if("function"==typeof l[e]){var t=new l[e];if(Symbol.toStringTag in t){var r=f(t),n=_(r,Symbol.toStringTag);if(!n){var i=f(r);n=_(i,Symbol.toStringTag)}p[e]=n.get}}}));var h=r(5692);e.exports=function(e){return!!h(e)&&(s&&Symbol.toStringTag in e?function(e){var t=!1;return n(p,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):u(a(e),8,-1))}},45:(e,t,r)=>{var n=r(4155);const i=r(4949),o=r(5174),a=r(7857),s=r(6987),l=r(371),c=r(8594),u=/^([0-9]+)(\.[0-9]+)?$/;class p extends Error{}function _(e,t,r){if(e.length>r[0]&&(r[0]=e.length),-1==r[1])return;let n=u.exec(e);if(null===n)return void(!t&&e.length&&(r[1]=-1,r[2]=-1));let i=n[1].length;r[1]=Math.max(r[1],i);let o=void 0===n[2]?0:n[2].length;r[2]=Math.max(r[2],o)}function f(e,t,r,n){if(e=e.trim(),-1==r[1]){let t=Math.max(r[0]-e.length,0);return n?e:e+" ".repeat(t+1)}if(t&&null===u.exec(e)){let t=Math.max(r[0]-e.length,0);return n?e:e+" ".repeat(t+1)}let i=e.indexOf("."),o=-1==i?e.length:i,a=-1==i?0:e.length-i,s=Math.max(r[1]-o,0),l=Math.max(r[2]-a),c=n?"":" ".repeat(l+1);return" ".repeat(s)+e+c}function h(e){return"rbql_table_name:"+e}function d(e,t,r){var n,s="~"===(n=r).charAt(0)?a.join(i.homedir(),n.slice(1)):n;if(o.existsSync(s))return s;if(t&&!a.isAbsolute(s)&&(s=a.join(t,s),o.existsSync(s)))return s;let l=e?e.get(h(r)):null;return l&&o.existsSync(l)?l:null}function g(e,t){const r=e.lineCount;for(let n=0;n1&&e.push(function(e,t){let r=Object.keys(t),n=[];for(let e=0;e1);let[i,o]=n[0],[a,s]=n[1],l=`Number of fields in "${e}" table is not consistent: `;return l+=`e.g. record ${i} -> ${o} fields, record ${a} -> ${s} fields`,l}(this.table_name,this.fields_info)),e}}class b extends s.RBQLOutputWriter{constructor(e,t){if(super(),this.delim=e,this.policy=t,this.header_len=null,this.null_in_output=!1,this.delim_in_simple_output=!1,this.output_lines=[],"simple"==t)this.polymorphic_join=this.simple_join;else if("quoted"==t)this.polymorphic_join=this.quoted_join;else if("quoted_rfc"==t)this.polymorphic_join=this.quoted_join_rfc;else if("monocolumn"==t)this.polymorphic_join=this.mono_join;else{if("whitespace"!=t)throw new y("Unknown output csv policy");this.polymorphic_join=this.simple_join}}set_header(e){null!==e&&(this.header_len=e.length,this.write(e))}quoted_join(e){let t=this.delim;return e.map((function(e){return c.quote_field(String(e),t)})).join(this.delim)}quoted_join_rfc(e){let t=this.delim;return e.map((function(e){return c.rfc_quote_field(String(e),t)})).join(this.delim)}mono_join(e){if(e.length>1)throw new y('Unable to use "Monocolumn" output format: some records have more than one field');return e[0]}simple_join(e){var t=e.join(this.delim);return-1!=e.join("").indexOf(this.delim)&&(this.delim_in_simple_output=!0),t}normalize_fields(e){for(var t=0;t{i||(i=!0,n.close(),a(e))})),n.on("error",(e=>{s(e)})),l},e.exports.rbql_query_web=async function(e,t,r,n,i,o,a,l,c=null){let u=new w,p=new m(t,r,n,l,c),_=new b(i,o);return await s.query(e,p,_,a,u,""),_.output_lines},e.exports.rbql_query_node=async function(e,t,r,c,u,p,_,f,h,d,g=!1,m=null,b="",w=null){let v=null,E=null;w&&w.bulk_read&&r?E=r:v=null===r?n.stdin:o.createReadStream(r);let[O,j]=null===p?[n.stdout,!1]:[o.createWriteStream(p),!0];if('"'==c&&"quoted"==u)throw new y('Double quote delimiter is incompatible with "quoted" policy');if("latin-1"==h&&(h="binary"),!l.is_ascii(t)&&"binary"==h)throw new y("To use non-ascii characters in query enable UTF-8 encoding instead of latin-1/binary");if(!(l.is_ascii(c)&&l.is_ascii(_)||"binary"!=h))throw new y("To use non-ascii characters in query enable UTF-8 encoding instead of latin-1/binary");let S=a.join(i.homedir(),".rbql_init_source.js");""==b&&o.existsSync(S)&&(b=l.read_user_init_code(S));let R=r?a.dirname(r):null,A=new x(e,R,c,u,h,g,m,w),q=new l.CSVRecordIterator(v,E,h,c,u,g,m),T=new l.CSVWriter(O,j,h,_,f);await s.query(t,q,T,d,A,b),A.get_warnings(d)},e.exports.get_header_line=g,e.exports.populate_optimistic_rfc_csv_record_map=function(e,t,r,n=null){let i=e.lineCount,o=null;var a;for(let s=r.length?(a=r,a[a.length-1])[1]:0;s=i&&""==t)break;if(n&&t.startsWith(n))continue;let a=t.match(/"/g),l=a&&a.length%2==1;if(null!==o||l)if(null===o&&l)o=s;else{if(!l)continue;r.push([o,s+1]),o=null}else r.push([s,s+1])}null!==o&&r.push([o,i])},e.exports.get_default_js_udf_content=function(){return"// This file can be used to store RBQL UDFs. Example:\n //\n // function foo(value) {\n // return 'foo ' + String(value.length);\n // }\n // \n // Functions defined in this file can be used in RBQL queries e.g. \n // SELECT foo(a1), a2 WHERE foo(a3) != 'foo 5' LIMIT 10\n //\n // Don't forget to save this file after editing!\n //\n // Write your own functions bellow this line:\n ".replace(new RegExp(/^ */,"mg"),"")},e.exports.get_default_python_udf_content=function(){return"# This file can be used to store RBQL UDFs. Example:\n #\n # def foo(value):\n # return 'foo ' + str(len(value))\n # \n # \n # Functions defined in this file can be used in RBQL queries e.g. \n # SELECT foo(a1), a2 WHERE foo(a3) != 'foo 5' LIMIT 10\n #\n # Don't forget to save this file after editing!\n #\n # Write your own functions bellow this line:\n ".replace(new RegExp(/^ */,"mg"),"")},e.exports.align_columns=function(e,t,r,n,i){let o=[],a=e.lineCount,s=!1,l=!0;for(let u=0;u=i.length);e++){let t=e+1==i.length,r=f(_[e],l,i[e],t);_[e]!=r&&(_[e]=r,s=!0)}l=!1,o.push(_.join(t))}return s?o.join("\n"):null},e.exports.shrink_columns=function(e,t,r,n){let i=[],o=e.lineCount,a=!1;for(let s=0;s0&&(r[1]+r[2]>r[0]&&(r[0]=r[1]+r[2]),r[0]-r[2]>r[1]&&(r[1]=r[0]-r[2]),r[0]!=r[1]+r[2]))return null;t.push(r)}return t},e.exports.update_subcomponent_stats=_,e.exports.align_field=f},8594:e=>{let t=new RegExp('^"((?:[^"]*"")*[^"]*)"'),r=new RegExp('^ *"((?:[^"]*"")*[^"]*)" *');function n(e,n,i,o,a,s){var l=!1;let c=e.substring(a),u=(o?r:t).exec(c);if(null!==u){let t=u[0].length;if(a+t==e.length||e[a+t]==n)return i?s.push(u[0]):s.push(u[1].replace(/""/g,'"')),[a+t+1,!1];l=!0}var p=e.indexOf(n,a);-1==p&&(p=e.length);var _=e.substring(a,p);return l=l||-1!=_.indexOf('"'),s.push(_),[p+1,l]}function i(e,t,r=!1){if(-1==e.indexOf('"'))return[e.split(t),!1];var i=[],o=0,a=!1;let s=" "!=t;for(;o{(function(exports){class RbqlParsingError extends Error{}class RbqlRuntimeError extends Error{}class AssertionError extends Error{}class RbqlIOHandlingError extends Error{}class InternalBadFieldError extends Error{constructor(e,...t){super(...t),this.bad_idx=e}}function assert(e,t=null){if(!e)throw t||(t="Assertion error"),new AssertionError(t)}function replace_all(e,t,r){return e.split(t).join(r)}class RBQLContext{constructor(e,t,r,n){this.query_text=e,this.input_iterator=t,this.writer=r,this.user_init_code=n,this.unnest_list=null,this.top_count=null,this.like_regex_cache=new Map,this.sort_key_expression=null,this.aggregation_stage=0,this.aggregation_key_expression=null,this.functional_aggregators=[],this.join_map_impl=null,this.join_map=null,this.lhs_join_var_expression=null,this.where_expression=null,this.select_expression=null,this.update_expressions=null,this.variables_init_code=null}}var query_context=null;const wrong_aggregation_usage_error="Usage of RBQL aggregation functions inside JavaScript expressions is not allowed, see the docs",RBQL_VERSION="0.25.0";function check_if_brackets_match(e,t){return"["==e&&"]"==t||"("==e&&")"==t||"{"==e&&"}"==t}function parse_root_bracket_level_text_spans(e){let t=[],r=0,n=[];for(let i=0;ie.trim())),t}function unquote_string(e){return!e||e.length<2?null:"'"==e[0]&&"'"==e[e.length-1]?e.substring(1,e.length-1).replace(/\\'/g,"'").replace(/\\\\/g,"\\"):'"'==e[0]&&'"'==e[e.length-1]?e.substring(1,e.length-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"):null}function column_info_from_text_span(e,t){e=e.trim();let r="__RBQL_INTERNAL_STAR",n=/^[_a-zA-Z][_a-zA-Z0-9]*$/.exec(e),i=/^([ab])\.([_a-zA-Z][_a-zA-Z0-9]*)$/.exec(e),o=/^([ab])\[([0-9]+)\]$/.exec(e),a=/^([ab])\[___RBQL_STRING_LITERAL([0-9]+)___\]$/.exec(e);if(null!==n){if(e==r)return{table_name:null,column_index:null,column_name:null,is_star:!0};if(e.startsWith("___RBQL_STRING_LITERAL"))return null;let t=/^([ab])([0-9]+)$/.exec(e);return null!==t?{table_name:t[1],column_index:parseInt(t[2])-1,column_name:null,is_star:!1}:{table_name:null,column_index:null,column_name:e,is_star:!1}}if(null!==i){let e=i[1],t=i[2];return t==r?{table_name:e,column_index:null,column_name:null,is_star:!0}:{table_name:null,column_index:null,column_name:t,is_star:!1}}if(null!=o)return{table_name:o[1],column_index:parseInt(o[2])-1,column_name:null,is_star:!1};if(null!=a){a[1];let e=a[2];if(ecolumn_info_from_text_span(e,t)))}function stable_compare(e,t){for(var r=0;r=this.top_count||(await this.subwriter.write(e),this.NW+=1,0))}async finish(){await this.subwriter.finish()}}class UniqWriter{constructor(e){this.subwriter=e,this.seen=new Set}async write(e){return!add_to_set(this.seen,JSON.stringify(e))||!!await this.subwriter.write(e)}async finish(){await this.subwriter.finish()}}class UniqCountWriter{constructor(e){this.subwriter=e,this.records=new Map}async write(e){var t=JSON.stringify(e),r=this.records.get(t);return r?r[0]+=1:this.records.set(t,[1,e]),!0}async finish(){for(var[e,t]of this.records){let[e,r]=t;if(r.unshift(e),!await this.subwriter.write(r))break}await this.subwriter.finish()}}class SortedWriter{constructor(e,t){this.subwriter=e,this.reverse_sort=t,this.unsorted_entries=[]}async write(e){return this.unsorted_entries.push(e),!0}async finish(){var e=this.unsorted_entries;e.sort(stable_compare),this.reverse_sort&&e.reverse();for(var t=0;te instanceof UnnestMarker));for(var o=0;oo+e)),n.slice(0,e).concat(i).concat(n.slice(e+1)).join("\n")+"\n"}assert(!1)}function generate_main_loop_code(e){let t=null!==e.select_expression,r=null!==e.join_map,n=null===e.where_expression?"true":e.where_expression,i=null===e.aggregation_key_expression?"null":e.aggregation_key_expression,o=null===e.sort_key_expression?"null":e.sort_key_expression,a=embed_code(MAIN_LOOP_BODY,"__USER_INIT_CODE__",e.user_init_code);return t?(r?(a=embed_code(embed_code(a,"__CODE__",PROCESS_SELECT_JOIN),"__CODE__",PROCESS_SELECT_COMMON),a=embed_expression(a,"__RBQLMP__lhs_join_var_expression",e.lhs_join_var_expression)):a=embed_code(embed_code(a,"__CODE__",PROCESS_SELECT_SIMPLE),"__CODE__",PROCESS_SELECT_COMMON),a=embed_code(a,"__RBQLMP__variables_init_code",e.variables_init_code),a=embed_expression(a,"__RBQLMP__select_expression",e.select_expression),a=embed_expression(a,"__RBQLMP__where_expression",n),a=embed_expression(a,"__RBQLMP__aggregation_key_expression",i),a=embed_expression(a,"__RBQLMP__sort_key_expression",o)):(r?(a=embed_code(a,"__CODE__",PROCESS_UPDATE_JOIN),a=embed_expression(a,"__RBQLMP__lhs_join_var_expression",e.lhs_join_var_expression)):a=embed_code(a,"__CODE__",PROCESS_UPDATE_SIMPLE),a=embed_code(a,"__RBQLMP__variables_init_code",e.variables_init_code),a=embed_code(a,"__RBQLMP__update_expressions",e.update_expressions),a=embed_expression(a,"__RBQLMP__where_expression",n)),"(async () => {"+a+"})()"}async function compile_and_run(query_context){let main_loop_body=generate_main_loop_code(query_context);try{let main_loop_promise=eval(main_loop_body);await main_loop_promise}catch(e){if(e instanceof SyntaxError){let t=query_context.query_text.toLowerCase();if(-1!=t.indexOf(" having "))throw new SyntaxError(e.message+'\nRBQL doesn\'t support "HAVING" keyword');if(-1!=t.indexOf(" like "))throw new SyntaxError(e.message+"\nRBQL doesn't support \"LIKE\" operator, use like() function instead e.g. ... WHERE like(a1, 'foo%bar') ... ");if(-1!=t.indexOf(" from "))throw new SyntaxError(e.message+'\nTip: If input table is defined by the environment, RBQL query should not have "FROM" keyword');if(e&&e.message&&-1!=String(e.message).toLowerCase().indexOf("unexpected identifier")){if(-1!=t.indexOf(" and "))throw new SyntaxError(e.message+"\nDid you use 'and' keyword in your query?\nJavaScript backend doesn't support 'and' keyword, use '&&' operator instead!");if(-1!=t.indexOf(" or "))throw new SyntaxError(e.message+"\nDid you use 'or' keyword in your query?\nJavaScript backend doesn't support 'or' keyword, use '||' operator instead!")}}if(e&&e.message&&-1!=e.message.indexOf("Received an instance of RBQLAggregationToken"))throw new RbqlParsingError(wrong_aggregation_usage_error);throw e}}const GROUP_BY="GROUP BY",UPDATE="UPDATE",SELECT="SELECT",JOIN="JOIN",INNER_JOIN="INNER JOIN",LEFT_JOIN="LEFT JOIN",LEFT_OUTER_JOIN="LEFT OUTER JOIN",STRICT_LEFT_JOIN="STRICT LEFT JOIN",ORDER_BY="ORDER BY",WHERE="WHERE",LIMIT="LIMIT",EXCEPT="EXCEPT",WITH="WITH";function get_ambiguous_error_msg(e){return`Ambiguous variable name: "${e}" is present both in input and in join tables`}function get_all_matches(e,t){var r=[];let n=null;for(;null!==(n=e.exec(t));)r.push(n);return r}function str_strip(e){return e.replace(/^ +| +$/g,"")}function strip_comments(e){return(e=e.trim()).startsWith("//")?"":e}function combine_string_literals(e,t){for(var r=0;re[1]));for(let e of o){let o=r.indexOf(e);if(-1==o)throw new RbqlParsingError(`Unable to find column "${e}" in ${"a"==t?"input":"join"} ${n}`);i[`${t}.${e}`]={initialize:!0,index:o}}}function map_variables_directly(e,t,r){for(let n=0;n1)throw new RbqlParsingError(`More than one "${o}" statements found`);assert(1==a.length);var s=a[0],l=s[0];r.push([s.index,s.index+l.length,o]);break}}return r.sort((function(e,t){return e[0]-t[0]})),r}function separate_actions(e){e=str_strip(e);var t={};let r=/^(.*) *[Ww][Ii][Tt][Hh] *\(([a-z]{4,20})\) *$/.exec(e);null!==r&&(e=r[1],t[WITH]=r[2]);for(var n=locate_statements(e),i=0;ie-t)),[null===n?null:select_except(n,o),`select_except(record_a, [${o.join(",")}])`]}class HashJoinMap{constructor(e,t){this.max_record_len=0,this.hash_map=new Map,this.record_iterator=e,this.nr=0,1==t.length?(this.key_index=t[0],this.key_indices=null,this.polymorphic_get_key=this.get_single_key):(this.key_index=null,this.key_indices=t,this.polymorphic_get_key=this.get_multi_key)}get_single_key(e,t){if(this.key_index>=t.length)throw new RbqlRuntimeError(`No field with index ${this.key_index+1} at record ${this.nr} in "B" table`);return-1===this.key_index?this.nr:t[this.key_index]}get_multi_key(e,t){let r=[];for(let e of this.key_indices){if(e>=t.length)throw new RbqlRuntimeError(`No field with index ${e+1} at record ${this.nr} in "B" table`);r.push(-1===e?this.nr:t[e])}return JSON.stringify(r)}async build(){for(;;){let e=await this.record_iterator.get_record();if(null===e)break;this.nr+=1;let t=e.length;this.max_record_len=Math.max(this.max_record_len,t);let r=this.polymorphic_get_key(this.nr,e),n=this.hash_map.get(r);void 0===n?this.hash_map.set(r,[[this.nr,t,e]]):n.push([this.nr,t,e])}}get_join_records(e){let t=this.hash_map.get(e);return void 0===t?[]:t}get_warnings(){return this.record_iterator.get_warnings()}}function cleanup_query(e){return e.split("\n").map(strip_comments).filter((e=>e.length)).join(" ").replace(/;+$/g,"")}function remove_redundant_table_name(e){return e=str_strip(e.replace(/ +from +a(?: +|$)/gi," ")),str_strip(e.replace(/^ *update +a +set /gi,"update "))}function select_output_header(e,t,r){if(null===e&&null===t)return null;null===e&&(e=[]),null===t&&(t=[]);let n=[];for(let i of r)null===i?n.push("col"+(n.length+1)):i.is_star?null===i.table_name?n=n.concat(e).concat(t):"a"===i.table_name?n=n.concat(e):"b"===i.table_name&&(n=n.concat(t)):null!==i.column_name?n.push(i.column_name):null!==i.column_index?"a"==i.table_name&&i.column_index1);let[i,o]=n[0],[a,s]=n[1],l=`Number of fields in "${e}" table is not consistent: `;return l+=`e.g. record ${i} -> ${o} fields, record ${a} -> ${s} fields`,l}class RBQLInputIterator{constructor(){}stop(){throw new Error("Unable to call the interface method")}async get_variables_map(e){throw new Error("Unable to call the interface method")}async get_record(){throw new Error("Unable to call the interface method")}handle_query_modifier(){}get_warnings(){return[]}async get_header(){return null}}class RBQLOutputWriter{constructor(){}async write(e){throw new Error("Unable to call the interface method")}async finish(){}get_warnings(){return[]}set_header(){}}class RBQLTableRegistry{constructor(){}get_iterator_by_table_id(e){throw new Error("Unable to call the interface method")}get_warnings(){return[]}}class TableIterator extends RBQLInputIterator{constructor(e,t=null,r=!0,n="a"){super(),this.table=e,this.column_names=t,this.normalize_column_names=r,this.variable_prefix=n,this.nr=0,this.fields_info=new Object,this.stopped=!1}stop(){this.stopped=!0}async get_variables_map(e){let t=new Object;if(parse_basic_variables(e,this.variable_prefix,t),parse_array_variables(e,this.variable_prefix,t),null!==this.column_names){if(this.table.length&&this.column_names.length!=this.table[0].length)throw new RbqlIOHandlingError("List of column names and table records have different lengths");this.normalize_column_names?(parse_dictionary_variables(e,this.variable_prefix,this.column_names,t),parse_attribute_variables(e,this.variable_prefix,this.column_names,"column names list",t)):map_variables_directly(e,this.column_names,t)}return t}async get_record(){if(this.stopped)return null;if(this.nr>=this.table.length)return null;let e=this.table[this.nr];this.nr+=1;let t=e.length;return this.fields_info.hasOwnProperty(t)||(this.fields_info[t]=this.nr),e}get_warnings(){return Object.keys(this.fields_info).length>1?[make_inconsistent_num_fields_warning("input",this.fields_info)]:[]}async get_header(){return this.column_names}}class TableWriter extends RBQLOutputWriter{constructor(e){super(),this.table=e,this.header=null}async write(e){return this.table.push(e),!0}set_header(e){this.header=e}}class SingleTableRegistry extends RBQLTableRegistry{constructor(e,t=null,r=!0,n="b"){super(),this.table=e,this.table_id=n,this.column_names=t,this.normalize_column_names=r}get_iterator_by_table_id(e){if(e.toLowerCase()!==this.table_id)throw new RbqlIOHandlingError(`Unable to find join table: "${e}"`);return new TableIterator(this.table,this.column_names,this.normalize_column_names,"b")}}async function shallow_parse_input_query(e,t,r,n){e=cleanup_query(e);var[i,o]=separate_string_literals(e),a=separate_actions(i=remove_redundant_table_name(i));a.hasOwnProperty(WITH)&&t.handle_query_modifier(a[WITH]);var s=await t.get_variables_map(e);if(a.hasOwnProperty(ORDER_BY)&&a.hasOwnProperty(UPDATE))throw new RbqlParsingError('"ORDER BY" is not allowed in "UPDATE" queries');if(a.hasOwnProperty(GROUP_BY)){if(a.hasOwnProperty(ORDER_BY)||a.hasOwnProperty(UPDATE))throw new RbqlParsingError('"ORDER BY", "UPDATE" and "DISTINCT" keywords are not allowed in aggregate queries');n.aggregation_key_expression="["+combine_string_literals(a[GROUP_BY].text,o)+"]"}let l=null,c=null;if(a.hasOwnProperty(JOIN)){var[u,p]=parse_join_expression(a[JOIN].text);if(null===r)throw new RbqlParsingError("JOIN operations are not supported by the application");let t=r.get_iterator_by_table_id(u);if(!t)throw new RbqlParsingError(`Unable to find join table: "${u}"`);a.hasOwnProperty(WITH)&&t.handle_query_modifier(a[WITH]),l=await t.get_variables_map(e),c=await t.get_header();let[i,_]=resolve_join_variables(s,l,p,o),f={JOIN:InnerJoiner,"INNER JOIN":InnerJoiner,"LEFT JOIN":LeftJoiner,"LEFT OUTER JOIN":LeftJoiner,"STRICT LEFT JOIN":StrictLeftJoiner}[a[JOIN].join_subtype];n.lhs_join_var_expression=1==i.length?i[0]:"JSON.stringify(["+i.join(",")+"])",n.join_map_impl=new HashJoinMap(t,_),await n.join_map_impl.build(),n.join_map=new f(n.join_map_impl)}if(n.variables_init_code=combine_string_literals(generate_init_statements(i,s,l," ".repeat(4)),o),a.hasOwnProperty(WHERE)){var _=a[WHERE].text;if(/[^>{var n=r(4155);const i=r(1606),o=r(4704),a=r(9426),s=r(9539),l=r(6987),c=r(8594),u="Unable to decode input table as UTF-8. Use binary (latin-1) encoding instead";class p extends Error{}class _ extends Error{}function f(e,t=null){if(!e)throw t||(t="Assertion error"),new _(t)}function h(e){return/^[\x00-\x7F]*$/.test(e)}function d(e){return i.readFileSync(e,"utf-8")}function g(e,t){var r,n="~"===(r=t).charAt(0)?a.join(o.homedir(),r.slice(1)):r;if(i.existsSync(n))return n;if(e&&!a.isAbsolute(n)&&(n=a.join(e,n),i.existsSync(n)))return n;var s=function(e,t){for(var r=function(e){var t=null;try{t=i.readFileSync(e,"utf-8")}catch(e){return[]}for(var r=t.split("\n"),n=[],o=0;o1&&i.existsSync(s[1])?s[1]:null}class y{constructor(){this.push_stack=[],this.pull_stack=[]}enqueue(e){this.push_stack.push(e)}dequeue(){if(!this.pull_stack.length){if(!this.push_stack.length)return null;this.pull_stack=this.push_stack,this.pull_stack.reverse(),this.push_stack=[]}return this.pull_stack.pop()}}class m extends l.RBQLInputIterator{constructor(e,t,r,n,i,o=!1,a=null,l="input",c="a"){super(),this.stream=e,this.csv_path=t,f(null===this.stream!=(null===this.csv_path)),this.encoding=r,this.delim=n,this.policy=i,this.has_header=o,this.first_record=null,this.first_record_should_be_emitted=!o,this.header_preread_complete=!1,this.table_name=l,this.variable_prefix=c,this.comment_prefix=null!==a&&a.length?a:null,this.decoder=null,"utf-8"==r&&null===this.csv_path&&(this.decoder=new s.TextDecoder(r,{fatal:!0,stream:!0})),this.input_exhausted=!1,this.started=!1,this.utf8_bom_removed=!1,this.first_defective_line=null,this.fields_info=new Object,this.NR=0,this.NL=0,this.rfc_line_buffer=[],this.partially_decoded_line="",this.partially_decoded_line_ends_with_cr=!1,this.resolve_current_record=null,this.reject_current_record=null,this.current_exception=null,this.produced_records_queue=new y,this.process_line_polymorphic="quoted_rfc"==i?this.process_partial_rfc_record_line:this.process_record_line}handle_query_modifier(e){-1!=["header","headers"].indexOf(e)&&(this.has_header=!0,this.first_record_should_be_emitted=!1),-1!=["noheader","noheaders"].indexOf(e)&&(this.has_header=!1,this.first_record_should_be_emitted=!0)}reset_external_callbacks(){this.reject_current_record=null,this.resolve_current_record=null}try_propagate_exception(){if(this.current_exception&&this.reject_current_record){let e=this.reject_current_record,t=this.current_exception;this.reset_external_callbacks(),this.current_exception=null,e(t)}}store_or_propagate_exception(e){null===this.current_exception&&(this.current_exception=e),this.try_propagate_exception()}async preread_first_record(){this.header_preread_complete||(this.first_record=await this.get_record(),this.header_preread_complete=!0,null!==this.first_record&&(this.stream&&this.stream.pause(),this.first_record=this.first_record.slice()))}async get_variables_map(e){let t=new Object;return l.parse_basic_variables(e,this.variable_prefix,t),l.parse_array_variables(e,this.variable_prefix,t),await this.preread_first_record(),this.has_header&&this.first_record&&(l.parse_attribute_variables(e,this.variable_prefix,this.first_record,"CSV header line",t),l.parse_dictionary_variables(e,this.variable_prefix,this.first_record,t)),t}async get_header(){return await this.preread_first_record(),this.has_header?this.first_record:null}try_resolve_next_record(){if(this.try_propagate_exception(),null===this.resolve_current_record)return;let e=null;if(this.first_record_should_be_emitted&&this.header_preread_complete?(this.first_record_should_be_emitted=!1,e=this.first_record):e=this.produced_records_queue.dequeue(),null===e&&!this.input_exhausted)return;let t=this.resolve_current_record;this.reset_external_callbacks(),t(e)}async get_record(){this.started||await this.start(),this.stream&&this.stream.isPaused()&&this.stream.resume();let e=this,t=new Promise((function(t,r){e.resolve_current_record=t,e.reject_current_record=r}));return this.try_resolve_next_record(),t}async get_all_records(e=null){let t=[];for(;;){let r=await this.get_record();if(null===r)break;if(t.push(r),e&&t.length>=e){this.stop();break}}return t}process_record_line(e){if(null!==this.comment_prefix&&e.startsWith(this.comment_prefix))return;this.NR+=1;var[t,r]=c.smart_split(e,this.delim,this.policy,!1);r&&null===this.first_defective_line&&(this.first_defective_line=this.NL,"quoted_rfc"==this.policy&&this.store_or_propagate_exception(new p(`Inconsistent double quote escaping in ${this.table_name} table at record ${this.NR}, line ${this.NL}`)));let n=t.length;this.fields_info.hasOwnProperty(n)||(this.fields_info[n]=this.NR),this.produced_records_queue.enqueue(t),this.try_resolve_next_record()}process_partial_rfc_record_line(e){let t=c.accumulate_rfc_line_into_record(this.rfc_line_buffer,e,this.comment_prefix);null!==t&&this.process_record_line(t)}process_line(e){if(this.NL+=1,1===this.NL){var t=function(e,t){return"binary"==t&&e.length>=3&&239===e.charCodeAt(0)&&187===e.charCodeAt(1)&&191===e.charCodeAt(2)?e.substring(3):"utf-8"==t&&e.length>=1&&65279===e.charCodeAt(0)?e.substring(1):e}(e,this.encoding);t!=e&&(e=t,this.utf8_bom_removed=!0)}this.process_line_polymorphic(e)}process_data_stream_chunk(e){let t=null;if(this.decoder)try{t=this.decoder.decode(e)}catch(e){return void(e instanceof TypeError?this.store_or_propagate_exception(new p(u)):this.store_or_propagate_exception(e))}else t=e.toString(this.encoding);let r=t.length&&"\n"==t[0]&&this.partially_decoded_line_ends_with_cr?1:0;this.partially_decoded_line_ends_with_cr=t.length&&"\r"==t[t.length-1];let n=c.split_lines(t);n[0]=this.partially_decoded_line+n[0],f(0==r||0==n[0].length),this.partially_decoded_line=n.pop();for(let e=r;e0&&this.process_record_line(this.rfc_line_buffer.join("\n")),this.input_exhausted=!0,this.try_resolve_next_record()}process_data_stream_end(){if(this.input_exhausted=!0,this.partially_decoded_line.length){let e=this.partially_decoded_line;this.partially_decoded_line="",this.process_line(e)}this.rfc_line_buffer.length>0&&this.process_record_line(this.rfc_line_buffer.join("\n")),this.try_resolve_next_record()}stop(){this.stream&&this.stream.destroy()}async start(){if(!this.started){if(this.started=!0,!this.stream){let e=this;return new Promise((function(t,r){i.readFile(e.csv_path,((n,i)=>{n?r(n):(e.process_data_bulk(i),t())}))}))}this.stream.on("data",(e=>{this.process_data_stream_chunk(e)})),this.stream.on("end",(()=>{this.process_data_stream_end()}))}}get_warnings(){let e=[];return null!==this.first_defective_line&&e.push(`Inconsistent double quote escaping in ${this.table_name} table. E.g. at line ${this.first_defective_line}`),this.utf8_bom_removed&&e.push(`UTF-8 Byte Order Mark (BOM) was found and skipped in ${this.table_name} table`),Object.keys(this.fields_info).length>1&&e.push(function(e,t){let r=Object.keys(t),n=[];for(let e=0;e1);let[i,o]=n[0],[a,s]=n[1],l=`Number of fields in "${e}" table is not consistent: `;return l+=`e.g. record ${i} -> ${o} fields, record ${a} -> ${s} fields`,l}(this.table_name,this.fields_info)),e}}class b extends l.RBQLOutputWriter{constructor(e,t,r,n,i,o="\n"){if(super(),this.stream=e,this.encoding=r,r&&this.stream.setDefaultEncoding(r),this.stream.on("error",(e=>{this.store_first_error(e)})),this.delim=n,this.policy=i,this.line_separator=o,this.sub_array_delim="|"==n?";":"|",this.close_stream_on_finish=t,this.null_in_output=!1,this.delim_in_simple_output=!1,this.header_len=null,this.first_error=null,"simple"==i)this.polymorphic_join=this.simple_join;else if("quoted"==i)this.polymorphic_join=this.quoted_join;else if("quoted_rfc"==i)this.polymorphic_join=this.quoted_join_rfc;else if("monocolumn"==i)this.polymorphic_join=this.mono_join;else{if("whitespace"!=i)throw new p("Unknown output csv policy");this.polymorphic_join=this.simple_join}}store_first_error(e){null===this.first_error&&(this.first_error=e)}set_header(e){null!==e&&(this.header_len=e.length,this.write(e))}quoted_join(e){let t=this.delim;return e.map((function(e){return c.quote_field(String(e),t)})).join(this.delim)}quoted_join_rfc(e){let t=this.delim;return e.map((function(e){return c.rfc_quote_field(String(e),t)})).join(this.delim)}mono_join(e){if(e.length>1)throw new p('Unable to use "Monocolumn" output format: some records have more than one field');return e[0]}simple_join(e){var t=e.join(this.delim);return-1!=e.join("").indexOf(this.delim)&&(this.delim_in_simple_output=!0),t}normalize_fields(e){for(var t=0;t{i()})):setTimeout((()=>{i()}),0)}))}get_warnings(){let e=[];return this.null_in_output&&e.push("null values in output were replaced by empty strings"),this.delim_in_simple_output&&e.push("Some output fields contain separator"),e}}class w extends l.RBQLTableRegistry{constructor(e,t,r,n,i=!1,o=null,a=null){super(),this.input_file_dir=e,this.delim=t,this.policy=r,this.encoding=n,this.has_header=i,this.comment_prefix=o,this.stream=null,this.record_iterator=null,this.options=a,this.bulk_input_path=null,this.table_path=null}get_iterator_by_table_id(e){if(this.table_path=g(this.input_file_dir,e),null===this.table_path)throw new p(`Unable to find join table "${e}"`);return this.options&&this.options.bulk_read?this.bulk_input_path=this.table_path:this.stream=i.createReadStream(this.table_path),this.record_iterator=new m(this.stream,this.bulk_input_path,this.encoding,this.delim,this.policy,this.has_header,this.comment_prefix,e,"b"),this.record_iterator}get_warnings(e){this.record_iterator&&this.has_header&&e.push(`The first record in JOIN file ${a.basename(this.table_path)} was also treated as header (and skipped)`)}}e.exports.is_ascii=h,e.exports.CSVRecordIterator=m,e.exports.CSVWriter=b,e.exports.FileSystemCSVRegistry=w,e.exports.interpret_named_csv_format=function(e){if("monocolumn"==(e=e.toLowerCase()))return["","monocolumn"];if("csv"==e)return[",","quoted"];if("tsv"==e)return["\t","simple"];throw new p(`Unknown format name: "${e}"`)},e.exports.read_user_init_code=d,e.exports.query_csv=async function(e,t,r,s,c,u,_,f,g,y=!1,x=null,v="",E=null){let O=null,j=null;E&&E.bulk_read&&t?j=t:O=null===t?n.stdin:i.createReadStream(t);let[S,R]=null===c?[n.stdout,!1]:[i.createWriteStream(c),!0];if('"'==r&&"quoted"==s)throw new p('Double quote delimiter is incompatible with "quoted" policy');if("latin-1"==f&&(f="binary"),!h(e)&&"binary"==f)throw new p("To use non-ascii characters in query enable UTF-8 encoding instead of latin-1/binary");if(!(h(r)&&h(u)||"binary"!=f))throw new p("To use non-ascii characters in query enable UTF-8 encoding instead of latin-1/binary");let A=a.join(o.homedir(),".rbql_init_source.js");""==v&&i.existsSync(A)&&(v=d(A));let q=t?a.dirname(t):null,T=new w(q,r,s,f,y,x,E),k=new m(O,j,f,r,s,y,x),P=new b(S,R,f,u,_);await l.query(e,k,P,g,T,v),T.get_warnings(g)},e.exports.RecordQueue=y,e.exports.exception_to_error_info=l.exception_to_error_info},9496:e=>{"use strict";e.exports=require("vscode")},1606:()=>{},4704:()=>{},9426:()=>{},7666:()=>{},5174:()=>{},4949:()=>{},7857:()=>{},8391:()=>{},3083:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var __webpack_exports__={};(()=>{var e=__webpack_exports__;const t=__webpack_require__(9282),r=__webpack_require__(7666),n=__webpack_require__(9496),i=__webpack_require__(45),o=void 0===r.homedir,a=6e3;function s(e){return new Promise((t=>setTimeout(t,e)))}function l(e){console.log("###RAINBOW_CSV_UNIT_TEST_MESSAGE### "+e)}e.run=async function(){try{l("Starting tests"),t.equal(-1,[1,2,3].indexOf(0)),t(n.workspace.workspaceFolders),t.equal(1,n.workspace.workspaceFolders.length);let e=n.workspace.workspaceFolders[0].uri;if(await(function(){let e="foobar",r=0,n=[5,2,3];i.update_subcomponent_stats(e,r,n),t.deepEqual(n,[6,-1,-1]),e="foobar",r=1,n=[0,0,0],i.update_subcomponent_stats(e,r,n),t.deepEqual(n,[6,0,0]),e="100000",r=0,n=[2,-1,-1],i.update_subcomponent_stats(e,r,n),t.deepEqual(n,[6,-1,-1]),e="",r=0,n=[5,2,3],i.update_subcomponent_stats(e,r,n),t.deepEqual(n,[5,2,3]),e="100.3",r=0,n=[7,4,3],i.update_subcomponent_stats(e,r,n),t.deepEqual(n,[7,4,3]),e="100000",r=0,n=[5,2,3],i.update_subcomponent_stats(e,r,n),t.deepEqual(n,[6,6,3]),e="1000.23",r=0,n=[3,3,0],i.update_subcomponent_stats(e,r,n),t.deepEqual(n,[7,4,3])}(),function(){let e="foobar",r=0,n=[10,-1,-1];n=i.adjust_column_stats([n])[0];let o=0,a=i.align_field(e,r,n,o);t.deepEqual("foobar ",a),e="foobar",r=0,n=[10,-1,-1],n=i.adjust_column_stats([n])[0],o=1,a=i.align_field(e,r,n,o),t.deepEqual("foobar",a),e="foobar",r=1,n=[10,4,6],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual("foobar ",a),e="10.1",r=1,n=[10,4,6],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual(" 10.1 ",a),e="10.1",r=1,n=[10,-1,-1],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual("10.1 ",a),e="10.1",r=0,n=[10,-1,-1],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual("10.1 ",a),e="10.1",r=0,n=[10,4,6],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual(" 10.1 ",a),e="10.1",r=0,n=[10,4,6],n=i.adjust_column_stats([n])[0],o=1,a=i.align_field(e,r,n,o),t.deepEqual(" 10.1",a),e="1000",r=0,n=[10,4,6],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual("1000 ",a),e="1000",r=0,n=[10,4,6],n=i.adjust_column_stats([n])[0],o=1,a=i.align_field(e,r,n,o),t.deepEqual("1000",a),e="1000",r=0,n=[4,4,0],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual("1000 ",a),e="1000",r=0,n=[6,4,0],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual(" 1000 ",a),e="10.1",r=0,n=[12,4,6],n=i.adjust_column_stats([n])[0],o=0,a=i.align_field(e,r,n,o),t.deepEqual(" 10.1 ",a)}(),void function(){let e=[10,-1,-1],r=i.adjust_column_stats([e])[0];t.deepEqual([10,-1,-1],r),e=[10,0,0],r=i.adjust_column_stats([e])[0],t.deepEqual([10,-1,-1],r),e=[5,4,3],r=i.adjust_column_stats([e])[0],t.deepEqual([7,4,3],r),e=[10,4,3],r=i.adjust_column_stats([e])[0],t.deepEqual([10,7,3],r)}()),await async function(e){let r=n.Uri.joinPath(e,"test","csv_files","lorem_ipsum.txt"),i=await n.workspace.openTextDocument(r);l(`languageId for lorem_ipsum.txt: ${i.languageId}`),t.equal(i.languageId,"plaintext");let o=await n.window.showTextDocument(i);await s(1e3),r=n.Uri.joinPath(e,"test","suite","index.js"),i=await n.workspace.openTextDocument(r),l(`languageId for index.js: ${i.languageId}`),t.equal(i.languageId,"javascript"),o=await n.window.showTextDocument(i),await s(1e3),r=n.Uri.joinPath(e,"test","csv_files","lorem_ipsum"),i=await n.workspace.openTextDocument(r),l(`languageId for lorem_ipsum: ${i.languageId}`),t.equal(i.languageId,"plaintext"),o=await n.window.showTextDocument(i),await s(1e3)}(e),!o){let e=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_initialization_state:!0});t(e.initialized),t(!e.lazy_loaded)}if(await async function(e){let r=n.Uri.joinPath(e,"test","csv_files","university_ranking_semicolon.txt"),i=await n.workspace.openTextDocument(r);await n.window.showTextDocument(i),l(`languageId for university_ranking_semicolon.txt: ${i.languageId}`),t.equal(i.languageId,"csv (semicolon)"),await s(1e3)}(e),await async function(e){let r=n.Uri.joinPath(e,"test","csv_files","small_movies.pipe"),i=await n.workspace.openTextDocument(r);l(`languageId for small_movies.pipe: ${i.languageId}`),t.equal(i.languageId,"plaintext"),await n.window.showTextDocument(i),await s(1e3);for(let e=0;e<6;e++)await n.commands.executeCommand("cursorRight");await n.commands.executeCommand("cursorRightSelect"),await s(1e3),await n.commands.executeCommand("rainbow-csv.RainbowSeparator"),await s(2e3),l(`languageId for small_movies.pipe after RainbowSeparator: ${i.languageId}`),t.equal(i.languageId,"csv (pipe)"),await n.commands.executeCommand("rainbow-csv.RainbowSeparatorOff"),await s(2e3),l(`languageId for small_movies.pipe after RainbowSeparatorOff: ${i.languageId}`),t.equal(i.languageId,"plaintext"),await s(1e3)}(e),!o){let e=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_initialization_state:!0});t(e.initialized),t(!e.lazy_loaded)}if(o?await async function(e){let r=n.Uri.joinPath(e,"test","csv_files","university_ranking.csv"),i=await n.workspace.openTextDocument(r),o=await n.window.showTextDocument(i);await s(1e3);let c={rbql_backend:"js",with_headers:!0,rbql_query:"select top 20 a1, Math.ceil(parseFloat(a.total_score) * 100), a['university_name'], null, 'foo bar' order by a2"};await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a);let u=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_last_rbql_warnings:!0});t.equal('["null values in output were replaced by empty strings"]',JSON.stringify(u.warnings)),i=n.window.activeTextEditor.document;let p=i.getText().length;l(`Length after first js query: ${p}`),t.equal(846,p),c={rbql_backend:"js",rbql_query:"select a2 * 10, a3, a3.length where NR > 1 order by a3.length limit 10"},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),i=n.window.activeTextEditor.document,p=i.getText().length,l(`Length after second js query: ${p}`),t.equal(267,p),c={rbql_backend:"js",rbql_query:"select nonexistent_function(a1)"},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),u=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_last_rbql_report:!0}),t.equal("query execution",u.error_type),t.equal("At record 1, Details: nonexistent_function is not defined",u.error_msg),l("Starting multiline records test"),r=n.Uri.joinPath(e,"test","csv_files","synthetic_rfc_newline_data.csv"),i=await n.workspace.openTextDocument(r),o=await n.window.showTextDocument(i),await s(1e3),c={rbql_backend:"js",rbql_query:"select '<<<<<', a3, a2, a1, '>>>>> NR: ' + NR",enable_rfc_newlines:!0},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),i=n.window.activeTextEditor.document,p=i.getText().length,l(`Length after js multiline-record query: ${p}`),t.equal(644,p)}(e):await async function(e){let r=n.Uri.joinPath(e,"test","csv_files","university_ranking.csv"),i=await n.workspace.openTextDocument(r),o=await n.window.showTextDocument(i);await s(1e3);let c={rbql_backend:"python",with_headers:!0,rbql_query:"select top 20 a1, math.ceil(float(a.total_score) * 100), a['university_name'], None, 'foo bar' order by a2"};await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a);let u=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_last_rbql_warnings:!0});t.equal('["None values in output were replaced by empty strings"]',JSON.stringify(u.warnings)),i=n.window.activeTextEditor.document;let p=i.getText().length;l(`Length after python query: ${p}`),t.equal(868,p),c={rbql_backend:"js",rbql_query:"select a2 * 10, a3, a3.length where NR > 1 order by a3.length limit 10"},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),i=n.window.activeTextEditor.document,p=i.getText().length,l(`Length after js query: ${p}`),t.equal(268,p),c={rbql_backend:"python",rbql_query:"select nonexistent_function(a1)"},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),u=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_last_rbql_report:!0}),t.equal("query execution",u.error_type),t.equal("At record 1, Details: name 'nonexistent_function' is not defined",u.error_msg),r=n.Uri.joinPath(e,"test","csv_files","synthetic_rfc_newline_data.csv"),i=await n.workspace.openTextDocument(r),o=await n.window.showTextDocument(i),await s(1e3),c={rbql_backend:"js",rbql_query:"select '<<<<<', a3, a2, a1, '>>>>> NR: ' + NR",enable_rfc_newlines:!0},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),i=n.window.activeTextEditor.document,p=i.getText().length,l(`Length after js multiline-record query: ${p}`),t.equal(645,p),r=n.Uri.joinPath(e,"test","csv_files","university_ranking.csv"),i=await n.workspace.openTextDocument(r),o=await n.window.showTextDocument(i),await s(1e3),c={rbql_backend:"python",with_headers:!0,rbql_query:"select a.university_name, b.Country, b.Population, b['GDP per capita'] JOIN countries.csv on a.country == b.Country order by int(b.Population) desc"},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),u=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_last_rbql_warnings:!0}),t.equal('["The first record in JOIN file countries.csv was also treated as header (and skipped)"]',JSON.stringify(u.warnings)),i=n.window.activeTextEditor.document,p=i.getText().length,l(`Length after join query: ${p}`),t.equal(11592,p),t.equal(202,i.lineCount),r=n.Uri.joinPath(e,"test","csv_files","countries.csv"),i=await n.workspace.openTextDocument(r);let _=i.fileName,f=i.getText().length;o=await n.window.showTextDocument(i),t(-1==i.getText().indexOf("oceania")),t(i.getText().indexOf("OCEANIA")>0),await s(1e3),c={rbql_backend:"python",with_headers:!0,rbql_query:"UPDATE set a.Region = a.Region.lower()"},await n.commands.executeCommand("rainbow-csv.RBQL",c),await s(a),u=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_last_rbql_warnings:!0}),t.equal("[]",JSON.stringify(u.warnings)),i=n.window.activeTextEditor.document,i.fileName,p=i.getText().length,l(`Length after update query: ${p}`),t.equal(f,p-i.lineCount+1),t(-1==i.getText().indexOf("OCEANIA")),t(i.getText().indexOf("oceania")>0),await s(1e3),await n.commands.executeCommand("rainbow-csv.CopyBack"),await s(1e3),i=await n.workspace.openTextDocument(r);let h=i.fileName;t.equal(_,h),t(-1==i.getText().indexOf("OCEANIA")),t(i.getText().indexOf("oceania")>0)}(e),!o){let e=await n.commands.executeCommand("rainbow-csv.InternalTest",{check_initialization_state:!0});t(e.initialized),t(e.lazy_loaded)}await async function(e){let r=n.Uri.joinPath(e,"test","csv_files","university_ranking.csv"),i=await n.workspace.openTextDocument(r),o=(await n.window.showTextDocument(i),i.getText().length);l(`Original length: ${o}`),t.equal(12538,o),await s(2e3),await n.commands.executeCommand("rainbow-csv.Align");let a=i.getText().length;l(`Aligned length: ${a}`),t.equal(25896,a),t(a>o);let c=await n.commands.executeCommand("rainbow-csv.CSVLint");t.equal(c,"OK"),await s(2e3),await n.commands.executeCommand("rainbow-csv.Shrink");let u=i.getText().length;l(`Shrinked length: ${u}`),t.equal(o,u),await s(500);let p="foobar,";await n.commands.executeCommand("default:type",{text:p}),c=await n.commands.executeCommand("rainbow-csv.CSVLint"),t(-1!=c.indexOf("Number of fields is not consistent")),await s(500);for(let e=0;e