@sassoftware/restaflib 3.3.3 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("restaflib",[],e):"object"==typeof exports?exports.restaflib=e():t.restaflib=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}([function(t,e,r){t.exports=r(16)},function(t,e){function r(t,e,r,n,i,o,a){try{var u=t[o](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function u(t){r(a,i,o,u,s,"next",t)}function s(t){r(a,i,o,u,s,"throw",t)}u(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";var n=r(1),i=r.n(n),o=r(0),a=r.n(o),u=r(5);function s(){return(s=i()(a.a.mark((function t(e,r,n,i){var o,s,c,f,l,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=Object(u.a)(null!==i?i:{},"_args_"),s=(s=o+" "+n).replace(/\r?\n|\r/g,""),c={action:"sccasl.runcasl",data:{code:s}},f=d.length,l=new Array(f>4?f-4:0),p=4;p<f;p++)l[p-4]=d[p];return t.next=7,e.runAction.apply(e,[r,c].concat(l));case 7:return h=t.sent,t.abrupt("return",h);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,r,n){return s.apply(this,arguments)}},function(t,e,r){"use strict";var n=r(13),i=r.n(n);var o=function(){return"\n results = casFetchData(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format); \n send_response({casResults = results}); \n \n function casFetchData(caslib, name, from, count, format) ; \n \n rc = checkAndLoadTable(caslib, name);\n \n if (rc ne true) then do;\n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n\n /*\n * get all table to get rowCount\n */\n\n action table.tableinfo r= result/ \n caslib = caslib \n name = name; \n \n rowCount = result.TableInfo[1, 'rows']; \n to = min(from + count -1, rowCount); \n \n /*\n * get column information\n */\n\n action table.columninfo r=infoResult /\n table = {caslib=caslib name=name};\n\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\n i = 2;\n do c over inforesult.columninfo;\n columns[i] = c;\n i = i + 1;\n end;\n \n /*\n * Fetch the current set of rows\n */\n\n action table.fetch r = result / \n table = {caslib=caslib, name=name} \n from= from to=to format=format \n ; \n\n /* \n * create payload to return\n */\n\n i = 1;\n rows ={};\n do row over result.fetch;\n rr = {};\n j = 1;\n do key,v over row;\n rr[j] = override(columns[j].Type, v);\n j = j + 1;\n end;\n rows[i] = rr;\n i = i + 1;\n end;\n\n pagePrev = max(from - count, -1);\n if (from ne 1) then do;\n pagePrev = max(pagePrev,1);\n end; \n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do ; \n pageNext = min(to + 1, rowCount); \n end; \n table = {caslib=caslib, name=name};\n pagination = {next= {from=pageNext, count=count, format=format, table=table}, prev={from=pagePrev, count=count, format=format, table=table}};\n\n /*return ({pagination = {table = {caslib=caslib, name=name}, prev=pagePrev, next=pageNext, count=count}, rc=0 , data = {schema=columns, rows=rows } } ); */\n\n return( \n {pagination = pagination, data = {schema=columns, rows=rows }}\n );\n end; \n \n /*\n * For non-primary column types set new content\n */\n\n function override(type, iv);\n if (type EQ 'varbinary') then v = '...varbinary';\n else if (type EQ 'blob') then v = '...blob';\n else if (type EQ 'table') then v = '...table';\n else if (type EQ 'dictionary') then v = '...dictionary';\n else if (type EQ 'list') then v = '...list';\n else if (type EQ 'isArray') then v = '...array';\n else v = iv;\n return v;\n end;\n\n \n "};var a=function(){return"\n \n /*------------------------------------------------*/\n /*Does the tables exist and if not try to load it */\n /*\n Typical usage:\n rc = checkAndLoadTable(caslib, name);\n if ( rc ne true) then do;\n ...handle errors...\n end; \n else do;\n ...your stuff...\n end;\n rc = true - the data is ready for use\n rc = false - the table could not be found\n rc = -1 - the caslib does not exist\n */\n /*------------------------------------------------*/\n\n function checkAndLoadTable(caslib, name); \n\n /* verify caslib is there */\n table.queryCaslib status=status result=result/\n caslib = caslib;\n do k,v over result; /* to handle casuser[user] */ \n rc = v;\n end;\n if ( rc eq false ) then \n return -1;\n /* \n * Check to see if table is already loaded \n */ \n action table.tableExists r=result/ \n caslib = caslib \n name = name; \n /* \n * if not loaded then try to load it \n */ \n rc = true;\n if (result.exists eq 0) then do; \n path = lookupPath(caslib, name);\n if (path eq '*') then do;\n rc = false;\n end;\n else do;\n\t action table.loadTable status=status/ \n\t caslib = caslib \n\t source = path \n\t casout={caslib= caslib name=name}; \n\t if (status.statusCode ne 0 ) then rc = false;\n end; \n end; \n return rc; \n end; \n\n/*\n * return path to table\n */\n\nfunction lookupPath(caslib, name ) ; \n table.fileInfo r = result/ \n caslib=caslib; \n\n names = result.fileInfo[,4]; \n nameu = upcase(name)||'.SASHDAT'; \n cpath = '*'; \n count = 0; \n\n do n over names; \n\t if (upcase(n) eq nameu) then do; \n\t count = count + 1; \n\t if ( cpath eq '*') then do; \n\t cpath = n; \n\t end; \n\t end; \n end; \n \n if (count GT 1 ) then do; \n print 'Warning: ' count 'Files with names only different in case exist - First one chosen';\n print 'Path: ' cpath ' will be used****'; \n end; \n r = cpath; \n return r; \nend; \n\n /*-----------------------------------------*/ \n /* isModel: is it model table */ \n /*-----------------------------------------*/ \n \n function isModel(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n validTable = false; \n mtype = 'bad'; \n do c over result.columninfo; \n cu = upCase(c.Column); \n if ( cu eq 'DATASTEPSRC') then do; \n mtype = 'ds'; \n end; \n else if ( cu eq '_STATE_' ) then do; \n mtype = 'astore'; \n end; \n else if (cu eq 'MODELMETADATA') then do; \n mtype = 'ds2'; \n end; \n end; \n print 'Specified model type: ' || mtype; \n return mtype; \n end; \n \n /*-----------------------------------------*/ \n /* Returns contents of the specified table */ \n /*-----------------------------------------*/ \n \n function contents(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n /* columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}}; */ \n i = 1; \n columns = {}; \n do c over result.columninfo; \n columns[i] = c; \n i = i + 1; \n end; \n return {describe = columns, table = {}}; \n end; \n \n /*------------------------------------------*/ \n /* Returns unique values */ \n /*-----------------------------------------*/ \n \n function selectionLists(idvars,caslib, name); \n \n s = checkAndLoadTable(caslib, name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n \n do k over idvars; \n r = _getValues(k, caslib, name); \n results[k] = r; \n end; \n \n return results; \n end; \n \n function _getValues(id, caslib, name) ; \n \n action table.dropTable/ \n caslib='casuser' name='dtemp1' quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib='casuser' source= 'dtemp1.sashdat' quiet=TRUE; \n \n action simple.groupby result=r status=rc/ \n aggregator = 'N' \n inputs = {id} \n table = {caslib=caslib name=name} \n casout = {caslib='casuser' name='dtemp1'} \n ; \n action table.fetch result=r/ \n table={caslib='casuser' name='dtemp1'} \n sortby={{name=id, order='ascending'}}; \n result = r.Fetch[,2]; \n return result; \n end; \n \n /*------------------------------------------*/ \n /* get a record */ \n /*------------------------------------------*/ \n \n function _fetchData(filter, table); \n s = checkAndLoadTable(table.caslib, table.name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||table.caslib||'.'||table.name}; \n return results; \n end; \n wherex = dictTowhere(filter); \n /* wherex = table.caslib||'.'||table.name||'(where=('||wherex||'));'; \n \n destroyTable('casuser', 'input'); \n \n action datastep.runCode r=result status=rc/ \n single='yes' \n code = 'data casuser.input; set ' || wherex||'run;'; \n */ \n \n action table.fetch r = result / \n table={caslib=table.caslib name=table.name where=wherex}; \n \n rows = resultsToDict(result.Fetch); \n return {scenario = rows, table = result.Fetch}; \n \n end; \n\n function destroyTable(caslib,name); \n action table.dropTable/ \n caslib=caslib name=name quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib=caslib source= name||'.sashdat' quiet=TRUE; \n \n return true; \n end; \n \n \n function dictToWhere(filter); \n where =''; \n andbit=' '; \n do k,v over filter; \n if (isString(v) ) then do; \n where = where || andbit || k || ' eq ' || '\"'||v||'\"'; \n end; \n else do; \n where = where || andbit || k || ' eq ' || v ; \n end; \n andbit =' and '; \n end; \n return where; \n end; \n \n function resultsToDict(r); \n casResults = {}; \n i = 1; \n do row over r; \n casResults[i] = row; \n i = i + 1; \n end; \n return casResults; \n end; \n \n function argsToTable(_arg_, caslib, name ); \n action table.droptable/ \n caslib=caslib name=name quiet=TRUE; \n i = 1; \n do key,obj over _arg_; \n columns[i] = key; \n row[i] = obj; \n if ( isString(obj) ) then \n type[i] = 'varchar'; \n else if ( isInteger(obj) ) then \n type[i] = 'int'; \n else type[i] = 'double'; \n i = i + 1; \n end; \n \n data1 = newTable('data1', columns, type, row ); \n \n saveresult data1 casout=name caslib=caslib replace; \n end; \n\n "};e.a={commonCasl:a,casFetchData:o,scoreCasl:i.a}},function(t,e,r){"use strict";var n=r(1),i=r.n(n),o=r(0),a=r.n(o),u=r(2),s=r(3);function c(){return(c=i()(a.a.mark((function t(e,r,n,i,o){var c,f,l,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(c=n,!0===o&&(c=n+" "+s.a.commonCasl()),f=d.length,l=new Array(f>5?f-5:0),p=5;p<f;p++)l[p-5]=d[p];return t.next=5,u.a.apply(void 0,[e,r,c,i].concat(l));case 5:return h=t.sent,t.abrupt("return",h.items().toJS());case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,r,n,i){return c.apply(this,arguments)}},function(t,e,r){"use strict";var n=r(6),i=r.n(n);function o(t){var e="{ ",r=" ";for(var n in t){if(!0===Array.isArray(t[n])){var u=a(t[n]);e=e+r+"".concat(n,"=")+u}else{var s=i()(t[n]);if("object"===s){var c=o(t[n]);e=e+r+"".concat(n,"=")+c}else e=e+r+"".concat(n,"=")+("string"===s?' "'.concat(t[n],'" '):"".concat(t[n]," "))}r=","}return e+="} "}function a(t){for(var e="{",r=" ",n=t.length,u=0;u<n;u++)if(!0===Array.isArray(t[u])){var s=a(t[u]);e=e+r+"".concat(u,"=")+s}else{var c=i()(t[u]);if("object"===c)e=e+r+o(t[u]);else e=e+r+("string"===c?' "'.concat(t[u],'" '):"".concat(t[u]," "));r=","}return e+="}"}e.a=function(t,e){var r;return r=null===t?"{}":!0===Array.isArray(t)?a(t):o(t),"".concat(e," = ").concat(r,";")}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"c",(function(){return l})),r.d(e,"a",(function(){return h}));var n=r(1),i=r.n(n),o=r(0),a=r.n(o);function u(){return(u=i()(a.a.mark((function t(e,r,n,i){var o,u,s,c,f;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=i.output,u=o.caslib,null!=(s=o.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return s=s.toLowerCase(s),c="\n action table.droptable /\n caslib= '".concat(u,"' name= '").concat(s,"' quiet=true;\n\n action table.deleteSource/\n caslib= '").concat(u,"' source= '").concat(s,".sashdat' quiet=true; \n "),f={action:"sccasl.runcasl",data:{code:c}},t.next=8,e.runAction(r,f);case 8:return f={action:"astore.upload",data:{rstore:{name:"".concat(s),caslib:"".concat(u),replace:!0},store:n}},t.next=11,e.runAction(r,f);case 11:return t.sent,t.abrupt("return","Upload of ".concat(i.source," to ").concat(u,".").concat(s," completed"));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var s=function(t,e,r,n){return u.apply(this,arguments)},c=r(4);function f(){return(f=i()(a.a.mark((function t(e,r,n,i,o){var u,s,f,l,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=i.output,s=u.caslib,null!=(f=u.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return l={casout:{caslib:s,name:f},importOptions:{fileType:i.fileType}},"sas"!==i.fileExt&&"ds2"!==i.fileExt||(l.importOptions.delimiter="\\"),p={headers:{"JSON-Parameters":l,"Content-Type":"binary/octet-stream"},data:n,action:"table.upload"},t.next=8,e.runAction(r,p);case 8:if(!0!==o){t.next=13;break}return h="\n\t\t\taction table.save r = result / \n\t\t\ttable = {caslib='".concat(s,"' name='").concat(f,"'} replace=true\n\t\t\tcaslib='").concat(s,"' name='").concat(f,"';\n\n\t\t\tsend_response(result);\n\t\t\t"),t.next=12,Object(c.a)(e,r,h,null);case 12:t.sent;case 13:return t.abrupt("return","Upload of ".concat(i.source," to ").concat((i.output,s),".").concat(i.output.name," completed"));case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var l=function(t,e,r,n,i){return f.apply(this,arguments)};function p(){return(p=i()(a.a.mark((function t(e,r,n,i){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o={action:"table.save",data:{name:"".concat(i),caslib:"".concat(n),replace:!0,table:{name:"".concat(i),caslib:"".concat(n)}}},t.next=3,e.runAction(r,o);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var h=function(t,e,r,n){return p.apply(this,arguments)}},function(t,e,r){"use strict";var n=r(12),i=r(31);e.version=r(32).version;var o=function(t,e,r){return"boolean"==typeof t||"number"==typeof t||"function"==typeof t||null===t||t instanceof Date||("string"==typeof t&&-1===t.indexOf("\n")||!(!r.inlineArrays||e||!Array.isArray(t)||!o(t[0],!0,r)))},a=function(t,e){if(e.noColor)return t;if("string"==typeof t)return e.stringColor?n[e.stringColor](t):t;var r=t+"";return!0===t?n.green(r):!1===t?n.red(r):null===t?n.grey(r):"number"==typeof t?n[e.numberColor](r):"function"==typeof t?"function() {}":Array.isArray(t)?t.join(", "):r},u=function(t,e,r){if(o(t,!1,e))return[i.indent(r)+a(t,e)];if("string"==typeof t)return[i.indent(r)+'"""',(s=t,c=r+e.defaultIndentation,f=s.split("\n"),(f=f.map((function(t){return i.indent(c)+t}))).join("\n")),i.indent(r)+'"""'];var s,c,f;if(Array.isArray(t)){if(0===t.length)return[i.indent(r)+e.emptyArrayMsg];var l=[];return t.forEach((function(t){var a="- ";e.noColor||(a=n[e.dashColor](a)),a=i.indent(r)+a,o(t,!1,e)?(a+=u(t,e,0)[0],l.push(a)):(l.push(a),l.push.apply(l,u(t,e,r+e.defaultIndentation)))})),l}if(t instanceof Error)return u({message:t.message,stack:t.stack.split("\n")},e,r);var p,h=e.noAlign?0:i.getMaxIndexLength(t),d=[];return Object.getOwnPropertyNames(t).forEach((function(a){if(p=a+": ",e.noColor||(p=n[e.keysColor](p)),p=i.indent(r)+p,void 0!==t[a])if(o(t[a],!1,e)){var s=e.noAlign?0:h-a.length;p+=u(t[a],e,s)[0],d.push(p)}else d.push(p),d.push.apply(d,u(t[a],e,r+e.defaultIndentation))})),d};e.render=function(t,e,r){return r=r||0,(e=e||{}).emptyArrayMsg=e.emptyArrayMsg||"(empty array)",e.keysColor=e.keysColor||"green",e.dashColor=e.dashColor||"green",e.numberColor=e.numberColor||"blue",e.defaultIndentation=e.defaultIndentation||2,e.noColor=!!e.noColor,e.noAlign=!!e.noAlign,e.stringColor=e.stringColor||null,u(t,e,r).join("\n")},e.renderString=function(t,r,i){var o,a,u="";if("string"!=typeof t||""===t)return"";"{"!==t[0]&&"["!==t[0]&&(a=-1===t.indexOf("{")?t.indexOf("["):-1===t.indexOf("[")||t.indexOf("{")<t.indexOf("[")?t.indexOf("{"):t.indexOf("["),u+=t.substr(0,a)+"\n",t=t.substr(a));try{o=JSON.parse(t)}catch(t){return n.red("Error:")+" Not valid JSON!"}return u+=e.render(o,r,i)}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(33),i=r(34),o=r(35),a=r(37);t.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var s,c=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&h())}function h(){if(!f){var t=u(p);f=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||f||u(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){var n=r(17);t.exports=n},function(t,e){t.exports=function(){return"\n result = runMain(_args_); \n send_response(result); \n /* print result; */\n \n \n function runMain(_args_) ; \n r = {Error= 'No path'}; \n if ( _args_.path eq '/selectors') then do; \n r = selectionLists(_args_.selectors, _args_.table.caslib, _args_.table.name); \n end; \n else if ( _args_.path eq '/contents') then do; \n r = contents(_args_.table.caslib, _args_.table.name); \n end; \n else if (_args_.path eq '/describe') then do; \n r = describeModel(_args_); \n end; \n else if (_args_.path eq '/scenario' ) then do;\n r = fetchData(_args_.filter, _args_.table);\n end;\n else if (_args_.path eq '/score') then do; \n if( exists(_args_, 'modelName') eq false ) then\n modelname = '';\n else modelName =_args_.modelName;\n r = runScoreCode(_args_.model, _args_.scenario, modelName); \n end; \n else do; \n r = {icasResults={Errors = 'Invalid action option specified' || _args_.path}, statusCode=404}; \n end; \n print r;\n if ( r.statusCode ne 0) then do;\n print r.icasResults;\n exit({severity=2,reason=6, status=r.iCasResults.Errors,statusCode=r.statusCode});\n end;\n result = {casResults = r.icasResults}; \n print '***************************************************************'; \n print result; \n print '***************************************************************'; \n return result; \n end; \n \n /*-----------------------------------------*/ \n /* describeModel */ \n /*-----------------------------------------*/ \n \n function describeModel(_args_) ; \n s = checkAndLoadTable(_args_.model.caslib, _args_.model.name); \n if ( s ne true) then do; \n results = {Errors= 'Unable to access ' ||_args_.model.caslib||'.'||_args_.model.name}; \n return {icasResults=results, statusCode=404}; \n end; \n \n mtype = isModel(_args_.model.caslib, _args_.model.name); \n if ( mtype EQ 'astore' ) then do; \n r = astoreDescribe(_args_.model); \n end; \n else if (mtype EQ 'ds' or mtype EQ 'ds2') then do;\n s = checkAndLoadTable(_args_.table.caslib, _args_.table.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||_args_.table.caslib||'.'||_args_.table.name}; \n return {icasResults=results, statusCode=404}; \n end; \n r = contents( _args_.table.caslib, _args_.table.name); \n end; \n return {icasResults= r, statusCode=0} ;\n end; \n \n /*------------------------------------------*/ \n /* astoreDescribe */ \n /*------------------------------------------*/ \n \n function astoreDescribe(model); \n action astore.describe r=result/ \n rstore = { caslib= model.caslib name = model.name }; \n rows = resultsToDict(result.InputVariables); \n return {describe = rows, table = result.InputVariables}; \n end; \n \n /*------------------------------------------*/ \n /* score */ \n /*------------------------------------------*/ \n function runScoreCode( model, scenario, modelName); \n print model; \n s = checkAndLoadTable(model.caslib, model.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||model.caslib||'.'||model.name}; \n return {icasResults=results, statusCode=404}; \n end;\n \n mtype = isModel(model.caslib, model.name); \n \n if ( mtype eq 'bad' ) then do; \n results = {Error= model.caslib||'.'||model.name || ' is not recognized as a valid supported model. Please check your values'};\n return {icasResults=results, statusCode=400};\n end; \n destroyTable('casuser', 'input'); \n argsToTable(scenario, 'casuser', 'input'); \n \n destroyTable('casuser', 'output'); \n \n if (mtype eq 'astore') then do; \n print 'Scoring with astore'; \n action astore.score r = result/ \n rstore = {caslib=model.caslib name=model.name} \n out = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds') then do; \n print 'scoring with datastep code'; \n action datastep.runcodetable r = result/ \n single='YES' \n codeTable= {caslib=model.caslib name=model.name} \n casout = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds2' ) then do; \n print 'Scoring with d2'; \n if ( missing(modelName) eq true) then do;\n results = {Error= 'modelName is missing. Please check your values'};\n return {icasResults=results, statusCode=400};\n end;\n\n action ds2.runModel r = result/ \n modelTable = {caslib=model.caslib, name=model.name} \n modelName = modelName \n table = {caslib= 'casuser', name='input'} \n casOut = {caslib= 'casuser' name='output'}; \n end; \n \n \n action table.fetch r = result / \n table={caslib='casuser' name='output'}; \n \n rows = resultsToDict(result.Fetch); \n \n return {icasResults= rows, statusCode=0} ;\n end; \n \n \n "}},function(t,e,r){"use strict";(function(t){var n=r(10),i=r.n(n),o=r(7);e.a=function(e,r){var n,a=null,u=o.c,s=function(t){return t},c=e.split(".").pop().toLowerCase();switch(c){case"sas7bdat":n="basesas";break;case"sashdat":n="hdat";break;case"csv":n=c,a="UTF8";break;case"xslx":case"xsl":n=c;break;case"astore":case"sasast":n=c,u=o.b,s=function(e){return new t.from(e).toString("base64")};break;case"ds2":case"sas":n="csv",a="UTF8",u=o.c,s=function(t,e){var r=t.replace(/[^\x00-\x7F]/g,"").replace(/\r?\n/g,""),n=e.fileExt;return"modelName\\"+("sas"===n?"dataStepSrc":"ds2"===n?"ds2Src":"casl"===n?"caslSrc":"dataStepsrc")+"\n"+e.output.name+"\\ "+r+"\n"};break;default:throw"Currently file type of ".concat(c," is not supported")}var f=r.split("."),l=i()(f,2);return{source:e,output:{caslib:l[0],name:l[1].toLowerCase()},fileType:n,fileExt:c,fileOptions:a,transform:s,contentType:"binary/octet-stream",handler:u}}}).call(this,r(39).Buffer)},function(t,e,r){t.exports=r(44)},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),a=new S(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return O()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=b(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function l(){}function p(){}function h(){}var d={};u(d,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(E([])));v&&v!==e&&r.call(v,i)&&(d=v);var _=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(i,o){function a(){return new e((function(n,a){!function n(i,o,a,u){var s=c(t[i],t,o);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=h,u(_,"constructor",h),u(h,"constructor",p),p.displayName=u(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,u(t,a,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},m(g.prototype),u(g.prototype,o,(function(){return this})),t.AsyncIterator=g,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new g(s(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(_),u(_,a,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=E,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n={};t.exports=n,n.themes={};var i=r(18),o=n.styles=r(21),a=Object.defineProperties,u=new RegExp(/[\r\n]+/g);n.supportsColor=r(22).supportsColor,void 0===n.enabled&&(n.enabled=!1!==n.supportsColor()),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};n.stylize=function(t,e){if(!n.enabled)return t+"";var r=o[e];return!r&&e in n?n[e](t):r.open+t+r.close};var s=/[|\\{}()[\]^$+*?.]/g;function c(t){var e=function t(){return h.apply(t,arguments)};return e._styles=t,e.__proto__=p,e}var f,l=(f={},o.grey=o.gray,Object.keys(o).forEach((function(t){o[t].closeRe=new RegExp(function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(s,"\\$&")}(o[t].close),"g"),f[t]={get:function(){return c(this._styles.concat(t))}}})),f),p=a((function(){}),l);function h(){var t=Array.prototype.slice.call(arguments),e=t.map((function(t){return null!=t&&t.constructor===String?t:i.inspect(t)})).join(" ");if(!n.enabled||!e)return e;for(var r=-1!=e.indexOf("\n"),a=this._styles,s=a.length;s--;){var c=o[a[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,r&&(e=e.replace(u,(function(t){return c.close+t+c.open})))}return e}n.setTheme=function(t){if("string"!=typeof t)for(var e in t)!function(e){n[e]=function(r){if("object"==typeof t[e]){var i=r;for(var o in t[e])i=n[t[e][o]](i);return i}return n[t[e]](r)}}(e);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var d=function(t,e){var r=e.split("");return(r=r.map(t)).join("")};for(var y in n.trap=r(25),n.zalgo=r(26),n.maps={},n.maps.america=r(27)(n),n.maps.zebra=r(28)(n),n.maps.rainbow=r(29)(n),n.maps.random=r(30)(n),n.maps)!function(t){n[t]=function(e){return d(n.maps[t],e)}}(y);a(n,function(){var t={};return Object.keys(l).forEach((function(e){t[e]={get:function(){return c([e])}}})),t}())},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<o;s=n[++r])y(s)||!b(s)?a+=" "+s:a+=" "+u(s);return a},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,a={};function u(t,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),f(n,t,n.depth)}function s(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return _(i)||(i=f(t,i,n)),i}var o=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(y(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),u=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(S(r)){var s=r.name?": "+r.name:"";return t.stylize("[Function"+s+"]","special")}if(g(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(x(r))return l(r)}var c,b="",E=!1,O=["{","}"];(h(r)&&(E=!0,O=["[","]"]),S(r))&&(b=" [Function"+(r.name?": "+r.name:"")+"]");return g(r)&&(b=" "+RegExp.prototype.toString.call(r)),w(r)&&(b=" "+Date.prototype.toUTCString.call(r)),x(r)&&(b=" "+l(r)),0!==a.length||E&&0!=r.length?n<0?g(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=E?function(t,e,r,n,i){for(var o=[],a=0,u=e.length;a<u;++a)I(e,String(a))?o.push(p(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(t,e,r,n,i,!0))})),o}(t,r,n,u,a):a.map((function(e){return p(t,r,n,u,e,E)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,O)):O[0]+b+O[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,u,s;if((s=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?u=s.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):s.set&&(u=t.stylize("[Setter]","special")),I(n,i)||(a="["+i+"]"),u||(t.seen.indexOf(s.value)<0?(u=y(r)?f(t,s.value,null):f(t,s.value,r-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+u.split("\n").map((function(t){return" "+t})).join("\n")):u=t.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return u;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+u}function h(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return"number"==typeof t}function _(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return b(t)&&"[object RegExp]"===E(t)}function b(t){return"object"==typeof t&&null!==t}function w(t){return b(t)&&"[object Date]"===E(t)}function x(t){return b(t)&&("[object Error]"===E(t)||t instanceof Error)}function S(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(m(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=h,e.isBoolean=d,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=_,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=g,e.isObject=b,e.isDate=w,e.isError=x,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(19);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var t=new Date,e=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",A(),e.format.apply(e,arguments))},e.inherits=r(20),e._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var j="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(j&&t[j]){var e;if("function"!=typeof(e=t[j]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,j,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),j&&Object.defineProperty(e,j,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=j,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,r).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(R,e,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(11))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){var r={};t.exports=r;var n={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(n).forEach((function(t){var e=n[t],i=r[t]=[];i.open="["+e[0]+"m",i.close="["+e[1]+"m"}))},function(t,e,r){"use strict";(function(e){var n=r(23),i=r(24),o=e.env,a=void 0;function u(t){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(function(t){if(!1===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(t&&!t.isTTY&&!0!==a)return 0;var r=a?1:0;if("win32"===e.platform){var u=n.release().split(".");return Number(e.versions.node.split(".")[0])>=8&&Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((function(t){return t in o}))||"codeship"===o.CI_NAME?1:r;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in o){var s=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:(o.TERM,r)}(t))}i("no-color")||i("no-colors")||i("color=false")?a=!1:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=!0),"FORCE_COLOR"in o&&(a=0===o.FORCE_COLOR.length||0!==parseInt(o.FORCE_COLOR,10)),t.exports={supportsColor:u,stdout:u(e.stdout),stderr:u(e.stderr)}}).call(this,r(11))},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},function(t,e,r){"use strict";(function(e){t.exports=function(t,r){var n=(r=r||e.argv).indexOf("--"),i=/^-{1,2}/.test(t)?"":"--",o=r.indexOf(i+t);return-1!==o&&(-1===n||o<n)}}).call(this,r(11))},function(t,e){t.exports=function(t,e){var r="";t=(t=t||"Run the trap, drop the bass").split("");var n={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return t.forEach((function(t){t=t.toLowerCase();var e=n[t]||[" "],i=Math.floor(Math.random()*e.length);r+=void 0!==n[t]?n[t][i]:t})),r}},function(t,e){t.exports=function(t,e){t=t||" he is here ";var r={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},n=[].concat(r.up,r.down,r.mid);function i(t){return Math.floor(Math.random()*t)}function o(t){var e=!1;return n.filter((function(r){e=r===t})),e}return function(t,e){var n,a,u="";for(a in(e=e||{}).up=void 0===e.up||e.up,e.mid=void 0===e.mid||e.mid,e.down=void 0===e.down||e.down,e.size=void 0!==e.size?e.size:"maxi",t=t.split(""))if(!o(a)){switch(u+=t[a],n={up:0,down:0,mid:0},e.size){case"mini":n.up=i(8),n.mid=i(2),n.down=i(8);break;case"maxi":n.up=i(16)+3,n.mid=i(4)+1,n.down=i(64)+3;break;default:n.up=i(8)+1,n.mid=i(6)/2,n.down=i(8)+1}var s=["up","mid","down"];for(var c in s)for(var f=s[c],l=0;l<=n[f];l++)e[f]&&(u+=r[f][i(r[f].length)])}return u}(t,e)}},function(t,e){t.exports=function(t){return function(e,r,n){if(" "===e)return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}},function(t,e){t.exports=function(t){return function(e,r,n){return r%2==0?e:t.inverse(e)}}},function(t,e){t.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return" "===r?r:t[e[n++%e.length]](r)}}},function(t,e){t.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return" "===r?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}},function(t,e,r){"use strict";e.indent=function(t){return new Array(t+1).join(" ")},e.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach((function(r){void 0!==t[r]&&(e=Math.max(e,r.length))})),e}},function(t){t.exports=JSON.parse('{"author":"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)","name":"prettyjson","description":"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output","version":"1.2.1","homepage":"http://rafeca.com/prettyjson","keywords":["json","cli","formatting","colors"],"repository":{"type":"git","url":"https://github.com/rafeca/prettyjson.git"},"bugs":{"url":"https://github.com/rafeca/prettyjson/issues"},"main":"./lib/prettyjson","license":"MIT","scripts":{"test":"npm run jshint && mocha --reporter spec","testwin":"node ./node_modules/mocha/bin/mocha --reporter spec","jshint":"jshint lib/*.js test/*.js","coverage":"istanbul cover _mocha --report lcovonly -- -R spec","coveralls":"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage","changelog":"git log $(git describe --tags --abbrev=0)..HEAD --pretty=\'* %s\' --first-parent"},"bin":{"prettyjson":"./bin/prettyjson"},"dependencies":{"colors":"^1.1.2","minimist":"^1.2.0"},"devDependencies":{"coveralls":"^2.11.15","istanbul":"^0.4.5","jshint":"^2.9.4","mocha":"^3.1.2","mocha-lcov-reporter":"^1.2.0","should":"^11.1.1"}}')},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){u=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(36);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){},function(t,e,r){"use strict";
2
- /*!
3
- * The buffer module from node.js, for the browser.
4
- *
5
- * @author Feross Aboukhadijeh <http://feross.org>
6
- * @license MIT
7
- */var n=r(40),i=r(41),o=r(42);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=p(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),i=(t=u(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|h(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=u(t,e<0?0:0|h(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|h(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;o<u;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===s)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+s>u&&(r=u-s),o=r;o>=0;o--){for(var l=!0,p=0;p<s;p++)if(c(t,o+p)!==c(e,p)){l=!1;break}if(l)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function b(t,e,r,n){return Y(B(e,t.length-r),t,r,n)}function w(t,e,r,n){return Y(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return w(t,e,r,n)}function S(t,e,r,n){return Y(N(e),t,r,n)}function E(t,e,r,n){return Y(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,u,s,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&c)<<6|63&o)>127&&(f=s);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(s=(15&c)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==Object({}).TYPED_ARRAY_SUPPORT?Object({}).TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),c=this.slice(n,i),f=t.slice(e,r),l=0;l<u;++l)if(c[l]!==f[l]){o=c[l],a=f[l];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return _(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return _(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=U(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function z(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,o){return o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var i=e-t;r=new s(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=s.isBuffer(t)?t:B(new s(t,n).toString()),u=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%u]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],u=n[1],s=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),f=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;2===u&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,s[f++]=255&e);1===u&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,u=r-i;a<u;a+=16383)o.push(f(t,a,a+16383>u?u:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)n[u]=a[u],i[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,o,a=[],u=e;u<r;u+=3)i=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
8
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
9
- e.read=function(t,e,r,n,i){var o,a,u=8*i-n-1,s=(1<<u)-1,c=s>>1,f=-7,l=r?i-1:0,p=r?-1:1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=u;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,u,s,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+l>=1?p/s:p*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(e*s-1)*Math.pow(2,i),a+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+h]=255&u,h+=d,u/=256,i-=8);for(a=a<<i|u,c+=i;c>0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){t.exports="object"==typeof self?self.FormData:window.FormData},function(t,e,r){"use strict";r.r(e),r.d(e,"caslRun",(function(){return n.a})),r.d(e,"caslRunBase",(function(){return i.a})),r.d(e,"casSetup",(function(){return w})),r.d(e,"casActionRun",(function(){return S})),r.d(e,"casTableToJson",(function(){return k})),r.d(e,"casFetchData",(function(){return O})),r.d(e,"computeRun",(function(){return C})),r.d(e,"computeSetup",(function(){return M})),r.d(e,"computeSummary",(function(){return I})),r.d(e,"computeFetchData",(function(){return q})),r.d(e,"computeFileContent",(function(){return B})),r.d(e,"findReport",(function(){return Y})),r.d(e,"getReportImage",(function(){return J})),r.d(e,"getReportUri",(function(){return G})),r.d(e,"getSasTableRows",(function(){return V})),r.d(e,"jesSetup",(function(){return Q})),r.d(e,"jesRun",(function(){return it})),r.d(e,"jesSummary",(function(){return X})),r.d(e,"jsonToDict",(function(){return ot.a})),r.d(e,"computeResults",(function(){return L})),r.d(e,"print",(function(){return zi})),r.d(e,"caslScore",(function(){return y})),r.d(e,"caslDescribe",(function(){return g})),r.d(e,"masSetup",(function(){return lt})),r.d(e,"masAddModel",(function(){return ut})),r.d(e,"masDescribe",(function(){return pt})),r.d(e,"masRun",(function(){return dt})),r.d(e,"masScore",(function(){return vt})),r.d(e,"decodeJwt",(function(){return qi})),r.d(e,"casUpload",(function(){return Ki})),r.d(e,"uploadData",(function(){return Vi})),r.d(e,"lib",(function(){return Hi}));var n=r(4),i=r(2),o=r(9),a=r.n(o),u=r(1),s=r.n(u),c=r(0),f=r.n(c),l=r(3);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(){return(d=s()(f.a.mark((function t(e,r,n){var o,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.a.commonCasl()+" "+l.a.scoreCasl(),a=h({path:"/score"},n),t.next=4,Object(i.a)(e,r,o,a);case 4:return u=t.sent,s=u.items("results","casResults").toJS()[0],t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var y=function(t,e,r){return d.apply(this,arguments)};function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(){return(m=s()(f.a.mark((function t(e,r,n){var o,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.a.commonCasl()+" "+l.a.scoreCasl(),a=_({path:"/describe"},n),t.next=4,Object(i.a)(e,r,o,a);case 4:return u=t.sent,s=u.items("results").toJS(),t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var g=function(t,e,r){return m.apply(this,arguments)};function b(){return(b=s()(f.a.mark((function t(e,r){var n,i,o,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=3;break}return t.next=3,e.logon(r);case 3:return t.next=5,e.addServices("casManagement");case 5:return n=t.sent,i=n.casManagement,t.next=9,e.apiCall(i.links("servers"));case 9:if(0!==(o=t.sent).itemsList().size){t.next=12;break}throw{Error:"No cas servers were found"};case 12:return a=o.itemsList(0),t.next=15,e.apiCall(o.itemsCmd(a,"createSession"));case 15:return u=t.sent,t.abrupt("return",{servers:o,session:u});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var w=function(t,e){return b.apply(this,arguments)};function x(){return(x=s()(f.a.mark((function t(e){var r,n,i,o,a=arguments;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=a.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=a[i];return t.next=3,e.runAction.apply(e,n);case 3:return o=t.sent,t.abrupt("return",o.items().toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var S=function(t){return x.apply(this,arguments)};function E(){return(E=s()(f.a.mark((function t(e,r,n){var o,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.a.commonCasl()+" "+l.a.casFetchData(),t.next=3,Object(i.a)(e,r,o,n);case 3:return a=t.sent,t.abrupt("return",a.items("results","casResults").toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var O=function(t,e,r){return E.apply(this,arguments)};var k=function(t,e){var r=t.items("tables",e),n=r.get("rows"),i=[];r.get("schema").map((function(t){i.push(t.get("name"))}));var o=[];return n.map((function(t){var e={};t.map((function(t,r){e[i[r]]=t})),o.push(e)})),o};function A(){return(A=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((i={session:r,log:null,listing:null,ods:null,job:n,tables:{},files:{}}).log=n.links("log"),i.listing=n.links("listing"),null===(o=n.links("results"))){t.next=10;break}return t.next=7,e.apiCall(o);case 7:if(a=t.sent,(u=a.itemsList().size)>0)for(s=0;s<u;s++)c=a.itemsList(s),"ods"===(l=a.items(c,"data","type").toLowerCase())?i.ods=a.itemsCmd(c,"self"):"table"===l?(p={self:a.itemsCmd(c,"self"),current:null},i.tables[c]=p):"file"===l?(h={self:c,current:null,data:null},i.files[c]=h):(d={self:c,current:null,data:null},i[l]=d);case 10:return t.abrupt("return",i);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var I=function(t,e,r){return A.apply(this,arguments)};function j(){return(j=s()(f.a.mark((function t(e,r,n,i,o){var a,u,s,c,l,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="wait",u=null!=o?o:5,"wait"!==i&&null!==i&&(a=Math.max(Math.floor(i/u),1)),s={data:{code:n}},t.next=6,e.apiCall(r.links("execute"),s);case 6:return c=t.sent,t.next=9,e.jobState(c,null,a,u);case 9:if("running"!==(l=t.sent).data){t.next=14;break}throw"ERROR: Job did not complete in allotted time";case 14:return t.next=16,I(e,r,l.job);case 16:return(p=t.sent).SASJobStatus=l.data,t.abrupt("return",p);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var R=function(t,e,r,n,i){return j.apply(this,arguments)};function T(){return(T=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=[],null!=i)for(s in i)c="%let ".concat(s," = ").concat(i[s],";"),u.push(c);return l=n.split(/\r?\n/),u=u.concat(l),t.next=6,R(e,r,u,o,a);case 6:return p=t.sent,t.abrupt("return",p);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var C=function(t,e,r,n,i,o){return T.apply(this,arguments)};function z(){return(z=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=4;break}return t.next=3,e.logon(n);case 3:t.sent;case 4:return t.next=6,e.addServices("compute");case 6:return i=t.sent,o=i.compute,t.next=10,e.apiCall(o.links("contexts"));case 10:if(a=t.sent,null==r&&(r="Job Execution compute"),r=r.toLowerCase(),-1!==(u=a.itemsList().findIndex((function(t){return t.toLowerCase().indexOf(r)>=0})))){t.next=17;break}throw{Error:"Compute Context not found: "+r};case 17:return s=a.itemsCmd(a.itemsList(u),"createSession"),t.next=20,e.apiCall(s);case 20:return c=t.sent,t.abrupt("return",c);case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var M=function(t,e,r){return z.apply(this,arguments)};function D(){return(D=s()(f.a.mark((function t(e,r,n){var i,o,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("log"!==n&&"listing"!==n){t.next=20;break}if(i=[],null===r[n]){t.next=16;break}return t.next=5,e.apiCall(r[n]);case 5:o=t.sent,i=i.concat(o.items().toJS());case 7:if(null===(a=o.scrollCmds("next"))){t.next=14;break}return t.next=10,e.apiCall(a);case 10:o=t.sent,i=i.concat(o.items().toJS()),t.next=7;break;case 14:t.next=17;break;case 16:i[0]="Note: No ".concat(n);case 17:return t.abrupt("return",i);case 20:if("ods"!==n){t.next=31;break}if(null===r.ods){t.next=28;break}return t.next=24,e.apiCall(r.ods);case 24:return u=t.sent,t.abrupt("return",u.items());case 28:return t.abrupt("return","<h2> No ODS output </h2>");case 29:t.next=40;break;case 31:if("tables"!==n){t.next=35;break}return t.abrupt("return",Object.keys(r.tables));case 35:if("files"!==n){t.next=39;break}return t.abrupt("return",Object.keys(r.files));case 39:throw"Error: Invalid type ".concat(n);case 40:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var L=function(t,e,r){return D.apply(this,arguments)};function P(){return(P=s()(f.a.mark((function t(e,r,n,i){var o,a,u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=null,!0!==r.tables.hasOwnProperty(n)){t.next=26;break}if(null!==(a=r.tables[n]).current&&null!=i){t.next=15;break}return t.next=6,e.apiCall(a.self);case 6:return u=t.sent,t.next=9,e.apiCall(u.links("rowSet"));case 9:s=t.sent,a.current=s,c=s.items().toJS(),o={columns:c.columns,rows:c.rows,scrollOptions:s.scrollCmds().keySeq().toJS()},t.next=26;break;case 15:if(l=a.current,p=i,"next"===i&&null===l.scrollCmds("next")&&(p=null!==l.links("last")?"last":null),"prev"===i&&null===l.scrollCmds("prev")&&(p=null!==l.links("first")?"first":null),null===p||null===l.scrollCmds(p)){t.next=26;break}return t.next=22,e.apiCall(l.scrollCmds(p));case 22:h=t.sent,a.current=h,d=h.items().toJS(),o={columns:d.columns,rows:d.rows,scrollOptions:h.scrollCmds().keySeq().toJS()};case 26:return t.abrupt("return",o);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var q=function(t,e,r,n){return P.apply(this,arguments)};function U(){return(U=s()(f.a.mark((function t(e,r,n,i){var o,a,u,s,c,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(o=r.files[n])){t.next=3;break}throw"Invalid fileref ".concat(n);case 3:if(null!==o.current){t.next=12;break}return a={qs:{filter:"eq(name,'".concat(n,"')")}},t.next=7,e.apiCall(r.session.links("files"),a);case 7:return u=t.sent,t.next=10,e.apiCall(u.itemsCmd(n,"self"));case 10:u=t.sent,o.current=u;case 12:if(!0!==i){t.next=17;break}return s="".concat(r.session.host).concat(o.current.links("content","link","uri")),t.abrupt("return",s);case 17:if(null!==o.data){t.next=26;break}return t.next=20,e.apiCall(o.current.links("content"));case 20:return c=t.sent,l=c.items(),o.data=l,t.abrupt("return",l);case 26:return t.abrupt("return",o.data);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var B=function(t,e,r,n){return U.apply(this,arguments)};function N(){return(N=s()(f.a.mark((function t(e,r){var n,i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.getService("reports"),i=null,null!==r&&(i={qs:{filter:"eq(name,'".concat(r,"')")}}),t.next=5,e.apiCall(n.links("reports"),i);case 5:return o=t.sent,t.abrupt("return",0===o.itemsList().size?null:o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Y=function(t,e){return N.apply(this,arguments)};function F(){return(F=s()(f.a.mark((function t(e,r){var n,i,o,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.rafObject("reportImages"),t.next=3,Y(e,r);case 3:if(null!==(i=t.sent)){t.next=6;break}return t.abrupt("return","".concat(r," was not found"));case 6:return o=i.itemsCmd(i.itemsList(0),"self","link","uri"),a={data:{reportUri:o,sectionIndex:0,layoutType:"entireSection",size:"400x400"}},t.next=11,e.apiCall(n.links("createJob"),a);case 11:return u=t.sent,t.next=14,e.jobState(u,{qs:{wait:1.5}},10,2);case 14:if("completed"===(s=t.sent).data){t.next=17;break}return t.abrupt("return","Job failed ".concat(s.data));case 17:return t.next=19,e.apiCall(s.job.itemsCmd(s.job.itemsList(0),"image"));case 19:return c=t.sent,t.abrupt("return",c.items());case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var J=function(t,e){return F.apply(this,arguments)};function K(){return(K=s()(f.a.mark((function t(e,r){var n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Y(e,r);case 2:if(null!==(n=t.sent)){t.next=6;break}throw null==r?"No reports were found":"".concat(r," was not found");case 6:return i=[],n.items().map((function(t,e){var r={name:e,uri:n.itemsCmd(e,"self","link","uri")};i.push(r)})),t.abrupt("return",i);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var G=function(t,e){return K.apply(this,arguments)};function W(){return(W=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c,l,p,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.tables[n],t.next=3,e.apiCall(i);case 3:return o=t.sent,t.next=6,e.apiCall(o.links("rowSet"));case 6:for(a=t.sent,u=a.items("columns"),s=a.items("rows"),c=[],l=s.size,p=function(t){var e=s.get(t),r={};u.map((function(t,n){var i=t.toLowerCase();r[i]=e.get(n)})),c.push(r)},h=0;h<l;h++)p(h);return t.abrupt("return",c);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var V=function(t,e,r){return W.apply(this,arguments)};function H(){return(H=s()(f.a.mark((function t(e,r){var n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=3;break}return t.next=3,e.logon(r);case 3:return t.next=5,e.addServices("jobExecution","compute","jobDefinitions");case 5:return n=t.sent,t.abrupt("return",n.jobExecution);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Q=function(t,e){return H.apply(this,arguments)};function $(){return($=s()(f.a.mark((function t(e,r){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r);case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var X=function(t,e){return $.apply(this,arguments)};function Z(){return(Z=s()(f.a.mark((function t(e,r,n){var i,o,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apiCall(r.links("create"),n);case 2:return i=t.sent,t.next=5,e.jobState(i,null,5,2);case 5:if("running"!==(o=t.sent).data){t.next=10;break}throw"ERROR: Job did not complete in allotted time";case 10:if("failed"!==o.data){t.next=14;break}throw JSON.stringify(o);case 14:return t.next=16,X(e,o.job);case 16:return a=t.sent,t.abrupt("return",a);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var tt=function(t,e,r){return Z.apply(this,arguments)};function et(){return(et=s()(f.a.mark((function t(e,r,n,i,o){var a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a={},u={},null===i){t.next=6;break}return t.next=5,rt(e,i);case 5:a.jobDefinitionUri=t.sent;case 6:return-0!=n&&(u.code=n),u.type="Compute",a.arguments=o,a.jobDefinition=u,s={data:a},t.next=13,tt(e,r,s);case 13:return c=t.sent,t.abrupt("return",c);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function rt(t,e){return nt.apply(this,arguments)}function nt(){return(nt=s()(f.a.mark((function t(e,r){var n,i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.getService("jobDefinitions"),n=null,i={qs:{filter:"eq(name,'".concat(r,"')")}},t.next=5,tt(e,i);case 5:if(0!==(o=t.sent).itemsList().size){t.next=10;break}throw"Error: ".concat(r," not found in the system");case 10:n=o.itemsCmd(r,"self","link","uri");case 11:return t.abrupt("return",n);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var it=function(t,e,r,n,i){return et.apply(this,arguments)},ot=r(5);function at(){return(at=s()(f.a.mark((function t(e,r,n){var i,o,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=r.service,o=0;case 2:if(!(o<n.length)){t.next=12;break}if(a=n[o],null!=r.steps[a]){t.next=9;break}return t.next=7,ct(e,i,a);case 7:u=t.sent,r.steps[a]=u;case 9:o++,t.next=2;break;case 12:return t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ut=function(t,e,r){return at.apply(this,arguments)};function st(){return(st=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={qs:{filter:"eq(name,'".concat(n.trim(),"')")}},t.next=3,e.apiCall(r.links("modules"),i);case 3:if(0!==(o=t.sent).itemsList().size){t.next=6;break}return t.abrupt("return",null);case 6:return a=o.itemsCmd(n,"steps"),t.next=9,e.apiCall(a);case 9:return u=t.sent,s={name:n,stepsRafLink:u,stepIds:o.items(n,"data","stepIds").toJS(),microanalyticScore:r},t.abrupt("return",s);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ct=function(t,e,r){return st.apply(this,arguments)};function ft(){return(ft=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=3;break}return t.next=3,e.logon(n);case 3:return t.next=5,e.addServices("microanalyticScore");case 5:i=t.sent,o=i.microanalyticScore,a={service:o,steps:{}},u=0;case 9:if(!(u<r.length)){t.next=18;break}return s=r[u],t.next=13,ct(e,o,s);case 13:c=t.sent,a.steps[s]=c;case 15:u++,t.next=9;break;case 18:return t.abrupt("return",a);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var lt=function(t,e,r){return ft.apply(this,arguments)};var pt=function(t,e,r){var n=t.steps[e];if(null===n)return[];var i=null;if(null==r){var o=n.stepIds.findIndex((function(t){return"execute"===t||"score"===t}));if(-1===o)return[];i=n.stepIds[o]}else{if(-1===n.stepIds.findIndex((function(t){return t===r})))return[];i=r}var a=n.stepsRafLink.items(i,"data","inputs");return null===a?[]:a.toJS()};function ht(){return(ht=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p,h,d,y,v,_,m,g;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=r.steps[n],s=!1,c=[],!1===Array.isArray(i))for(l in i)p={name:l,value:i[l]},c.push(p);else s=!0;if(h={data:{inputs:!0===s?i:c}},null!=o){t.next=15;break}if(-1!==(d=u.stepIds.findIndex((function(t){return"execute"===t||"score"===t})))){t.next=12;break}return t.abrupt("return",[]);case 12:currentStep=u.stepIds[d];case 13:t.next=21;break;case 15:if(-1!==u.stepIds.findIndex((function(t){return t===o}))){t.next=20;break}return t.abrupt("return",[]);case 20:currentStep=o;case 21:if(null!==(y=u.stepsRafLink.itemsCmd(currentStep,a))){t.next=25;break}return v=[{name:"Error",type:"string",value:"name: ".concat(n," step: ").concat(o," operation: ").concat(a," is an invalid combination")}],t.abrupt("return",v);case 25:return t.next=27,e.apiCall(y,h);case 27:return _=t.sent,m=_.items("outputs").toJS(),!0===s?g=m:(g={},m.map((function(t){g[t.name]=t.value}))),t.abrupt("return",g);case 31:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var dt=function(t,e,r,n,i,o){return ht.apply(this,arguments)};function yt(){return(yt=s()(f.a.mark((function t(e,r,n){var i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,lt(e,[r]);case 2:return i=t.sent,t.next=5,dt(e,i,r,n,"score","execute");case 5:return o=t.sent,t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vt=function(t,e,r){return yt.apply(this,arguments)},_t=r(6),mt=r.n(_t),gt={};function bt(t){t&&(t.value=!0)}function wt(){}function xt(t){return void 0===t.size&&(t.size=t.__iterate(Et)),t.size}function St(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?xt(t)+e:e}function Et(){return!0}function Ot(t,e,r){return(0===t&&!jt(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function kt(t,e){return It(t,e,0)}function At(t,e){return It(t,e,e)}function It(t,e,r){return void 0===t?r:jt(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function jt(t){return t<0||0===t&&1/t==-1/0}function Rt(t){return Boolean(t&&t["@@__IMMUTABLE_ITERABLE__@@"])}function Tt(t){return Boolean(t&&t["@@__IMMUTABLE_KEYED__@@"])}function Ct(t){return Boolean(t&&t["@@__IMMUTABLE_INDEXED__@@"])}function zt(t){return Tt(t)||Ct(t)}var Mt=function(t){return Rt(t)?t:te(t)},Dt=function(t){function e(t){return Tt(t)?t:ee(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Mt),Lt=function(t){function e(t){return Ct(t)?t:re(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Mt),Pt=function(t){function e(t){return Rt(t)&&!zt(t)?t:ne(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Mt);Mt.Keyed=Dt,Mt.Indexed=Lt,Mt.Set=Pt;function qt(t){return Boolean(t&&t["@@__IMMUTABLE_SEQ__@@"])}function Ut(t){return Boolean(t&&t["@@__IMMUTABLE_RECORD__@@"])}function Bt(t){return Rt(t)||Ut(t)}var Nt="@@__IMMUTABLE_ORDERED__@@";function Yt(t){return Boolean(t&&t[Nt])}var Ft="function"==typeof Symbol&&Symbol.iterator,Jt=Ft||"@@iterator",Kt=function(t){this.next=t};function Gt(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function Wt(){return{value:void 0,done:!0}}function Vt(t){return!!$t(t)}function Ht(t){return t&&"function"==typeof t.next}function Qt(t){var e=$t(t);return e&&e.call(t)}function $t(t){var e=t&&(Ft&&t[Ft]||t["@@iterator"]);if("function"==typeof e)return e}Kt.prototype.toString=function(){return"[Iterator]"},Kt.KEYS=0,Kt.VALUES=1,Kt.ENTRIES=2,Kt.prototype.inspect=Kt.prototype.toSource=function(){return this.toString()},Kt.prototype[Jt]=function(){return this};var Xt=Object.prototype.hasOwnProperty;function Zt(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var te=function(t){function e(t){return null==t?se():Bt(t)?t.toSeq():function(t){var e=le(t);if(e)return e;if("object"==typeof t)return new oe(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new Kt((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return Gt(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(Mt),ee=function(t){function e(t){return null==t?se().toKeyedSeq():Rt(t)?Tt(t)?t.toSeq():t.fromEntrySeq():Ut(t)?t.toSeq():ce(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(te),re=function(t){function e(t){return null==t?se():Rt(t)?Tt(t)?t.entrySeq():t.toIndexedSeq():Ut(t)?t.toSeq().entrySeq():fe(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(te),ne=function(t){function e(t){return(Rt(t)&&!zt(t)?t:re(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(te);te.isSeq=qt,te.Keyed=ee,te.Set=ne,te.Indexed=re,te.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var ie=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[St(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,i=0;return new Kt((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return Gt(t,o,r[o])}))},e}(re),oe=function(t){function e(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Xt.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var a=n[e?i-++o:o++];if(!1===t(r[a],a,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length,o=0;return new Kt((function(){if(o===i)return{value:void 0,done:!0};var a=n[e?i-++o:o++];return Gt(t,a,r[a])}))},e}(ee);oe.prototype[Nt]=!0;var ae,ue=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=Qt(this._collection),n=0;if(Ht(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=Qt(this._collection);if(!Ht(r))return new Kt(Wt);var n=0;return new Kt((function(){var e=r.next();return e.done?e:Gt(t,n++,e.value)}))},e}(re);function se(){return ae||(ae=new ie([]))}function ce(t){var e=Array.isArray(t)?new ie(t):Vt(t)?new ue(t):void 0;if(e)return e.fromEntrySeq();if("object"==typeof t)return new oe(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function fe(t){var e=le(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function le(t){return Zt(t)?new ie(t):Vt(t)?new ue(t):void 0}function pe(t){return Boolean(t&&t["@@__IMMUTABLE_MAP__@@"])}function he(t){return pe(t)&&Yt(t)}function de(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ye(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(de(t)&&de(e)&&t.equals(e))}var ve="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function _e(t){return t>>>1&1073741824|3221225471&t}var me=Object.prototype.valueOf;function ge(t){if(null==t)return be(t);if("function"==typeof t.hashCode)return _e(t.hashCode(t));var e,r=(e=t).valueOf!==me&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return be(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return _e(e)}(r);case"string":return r.length>Re?function(t){var e=ze[t];void 0===e&&(e=we(t),Ce===Te&&(Ce=0,ze={}),Ce++,ze[t]=e);return e}(r):we(r);case"object":case"function":return function(t){var e;if(ke&&void 0!==(e=Oe.get(t)))return e;if(void 0!==(e=t[je]))return e;if(!Se){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[je]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=Ee(),ke)Oe.set(t,e);else{if(void 0!==xe&&!1===xe(t))throw new Error("Non-extensible objects are not allowed as keys.");if(Se)Object.defineProperty(t,je,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[je]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[je]=e}}return e}(r);case"symbol":return function(t){var e=Ae[t];if(void 0!==e)return e;return e=Ee(),Ae[t]=e,e}(r);default:if("function"==typeof r.toString)return we(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function be(t){return null===t?1108378658:1108378659}function we(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return _e(e)}var xe=Object.isExtensible,Se=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function Ee(){var t=++Ie;return 1073741824&Ie&&(Ie=0),t}var Oe,ke="function"==typeof WeakMap;ke&&(Oe=new WeakMap);var Ae=Object.create(null),Ie=0,je="__immutablehash__";"function"==typeof Symbol&&(je=Symbol(je));var Re=16,Te=255,Ce=0,ze={},Me=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Be(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=Ue(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e,n){return t(e,n,r)}),e)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(ee);Me.prototype[Nt]=!0;var De=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this,n=0;return e&&xt(this),this._iter.__iterate((function(i){return t(i,e?r.size-++n:n++,r)}),e)},e.prototype.__iterator=function(t,e){var r=this,n=this._iter.__iterator(1,e),i=0;return e&&xt(this),new Kt((function(){var o=n.next();return o.done?o:Gt(t,e?r.size-++i:i++,o.value,o)}))},e}(re),Le=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(1,e);return new Kt((function(){var e=r.next();return e.done?e:Gt(t,e.value,e.value,e)}))},e}(ne),Pe=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){if(e){$e(e);var n=Rt(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(1,e);return new Kt((function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){$e(n);var i=Rt(n);return Gt(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}}))},e}(ee);function qe(t){var e=Ze(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=tr,e.__iterateUncached=function(e,r){var n=this;return t.__iterate((function(t,r){return!1!==e(r,t,n)}),r)},e.__iteratorUncached=function(e,r){if(2===e){var n=t.__iterator(e,r);return new Kt((function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t}))}return t.__iterator(1===e?0:1,r)},e}function Ue(t,e,r){var n=Ze(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,gt);return o===gt?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate((function(t,i,a){return!1!==n(e.call(r,t,i,a),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(2,i);return new Kt((function(){var i=o.next();if(i.done)return i;var a=i.value,u=a[0];return Gt(n,u,e.call(r,a[1],u,t),i)}))},n}function Be(t,e){var r=this,n=Ze(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=qe(t);return e.reverse=function(){return t.flip()},e}),n.get=function(r,n){return t.get(e?r:-1-r,n)},n.has=function(r){return t.has(e?r:-1-r)},n.includes=function(e){return t.includes(e)},n.cacheResult=tr,n.__iterate=function(r,n){var i=this,o=0;return n&&xt(t),t.__iterate((function(t,a){return r(t,e?a:n?i.size-++o:o++,i)}),!n)},n.__iterator=function(n,i){var o=0;i&&xt(t);var a=t.__iterator(2,!i);return new Kt((function(){var t=a.next();if(t.done)return t;var u=t.value;return Gt(n,e?u[0]:i?r.size-++o:o++,u[1],t)}))},n}function Ne(t,e,r,n){var i=Ze(t);return n&&(i.has=function(n){var i=t.get(n,gt);return i!==gt&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,gt);return o!==gt&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var a=this,u=0;return t.__iterate((function(t,o,s){if(e.call(r,t,o,s))return u++,i(t,n?o:u-1,a)}),o),u},i.__iteratorUncached=function(i,o){var a=t.__iterator(2,o),u=0;return new Kt((function(){for(;;){var o=a.next();if(o.done)return o;var s=o.value,c=s[0],f=s[1];if(e.call(r,f,c,t))return Gt(i,n?c:u++,f,o)}}))},i}function Ye(t,e,r,n){var i=t.size;if(Ot(e,r,i))return t;var o=kt(e,i),a=At(r,i);if(o!=o||a!=a)return Ye(t.toSeq().cacheResult(),e,r,n);var u,s=a-o;s==s&&(u=s<0?0:s);var c=Ze(t);return c.size=0===u?u:t.size&&u||void 0,!n&&qt(t)&&u>=0&&(c.get=function(e,r){return(e=St(this,e))>=0&&e<u?t.get(e+o,r):r}),c.__iterateUncached=function(e,r){var i=this;if(0===u)return 0;if(r)return this.cacheResult().__iterate(e,r);var a=0,s=!0,c=0;return t.__iterate((function(t,r){if(!s||!(s=a++<o))return c++,!1!==e(t,n?r:c-1,i)&&c!==u})),c},c.__iteratorUncached=function(e,r){if(0!==u&&r)return this.cacheResult().__iterator(e,r);if(0===u)return new Kt(Wt);var i=t.__iterator(e,r),a=0,s=0;return new Kt((function(){for(;a++<o;)i.next();if(++s>u)return{value:void 0,done:!0};var t=i.next();return n||1===e||t.done?t:Gt(e,s-1,0===e?void 0:t.value[1],t)}))},c}function Fe(t,e,r,n){var i=Ze(t);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var u=!0,s=0;return t.__iterate((function(t,o,c){if(!u||!(u=e.call(r,t,o,c)))return s++,i(t,n?o:s-1,a)})),s},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var u=t.__iterator(2,o),s=!0,c=0;return new Kt((function(){var t,o,f;do{if((t=u.next()).done)return n||1===i?t:Gt(i,c++,0===i?void 0:t.value[1],t);var l=t.value;o=l[0],f=l[1],s&&(s=e.call(r,f,o,a))}while(s);return 2===i?t:Gt(i,o,f,t)}))},i}function Je(t,e){var r=Tt(t),n=[t].concat(e).map((function(t){return Rt(t)?r&&(t=Dt(t)):t=r?ce(t):fe(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&Tt(i)||Ct(t)&&Ct(i))return i}var o=new ie(n);return r?o=o.toKeyedSeq():Ct(t)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),o}function Ke(t,e,r){var n=Ze(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,u=!1;return function t(s,c){s.__iterate((function(o,s){return(!e||c<e)&&Rt(o)?t(o,c+1):(a++,!1===i(o,r?s:a-1,n)&&(u=!0)),!u}),o)}(t,0),a},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=t.__iterator(n,i),a=[],u=0;return new Kt((function(){for(;o;){var t=o.next();if(!1===t.done){var s=t.value;if(2===n&&(s=s[1]),e&&!(a.length<e)||!Rt(s))return r?t:Gt(n,u++,s,t);a.push(o),o=s.__iterator(n,i)}else o=a.pop()}return{value:void 0,done:!0}}))},n}function Ge(t,e,r){e||(e=er);var n=Tt(t),i=0,o=t.toSeq().map((function(e,n){return[n,e,i++,r?r(e,n,t):e]})).valueSeq().toArray();return o.sort((function(t,r){return e(t[3],r[3])||t[2]-r[2]})).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?ee(o):Ct(t)?re(o):ne(o)}function We(t,e,r){if(e||(e=er),r){var n=t.toSeq().map((function(e,n){return[e,r(e,n,t)]})).reduce((function(t,r){return Ve(e,t[1],r[1])?r:t}));return n&&n[0]}return t.reduce((function(t,r){return Ve(e,t,r)?r:t}))}function Ve(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(null==r||r!=r)||n>0}function He(t,e,r,n){var i=Ze(t),o=new ie(r).map((function(t){return t.size}));return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(1,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map((function(t){return t=Mt(t),Qt(i?t.reverse():t)})),a=0,u=!1;return new Kt((function(){var r;return u||(r=o.map((function(t){return t.next()})),u=n?r.every((function(t){return t.done})):r.some((function(t){return t.done}))),u?{value:void 0,done:!0}:Gt(t,a++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Qe(t,e){return t===e?t:qt(t)?e:t.constructor(e)}function $e(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Xe(t){return Tt(t)?Dt:Ct(t)?Lt:Pt}function Ze(t){return Object.create((Tt(t)?ee:Ct(t)?re:ne).prototype)}function tr(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):te.prototype.cacheResult.call(this)}function er(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t<e?-1:0}function rr(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;i<r;i++)n[i]=t[i+e];return n}function nr(t,e){if(!t)throw new Error(e)}function ir(t){nr(t!==1/0,"Cannot perform this action with an infinite size.")}function or(t){if(Zt(t)&&"string"!=typeof t)return t;if(Yt(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}De.prototype.cacheResult=Me.prototype.cacheResult=Le.prototype.cacheResult=Pe.prototype.cacheResult=tr;var ar=Object.prototype.toString;function ur(t){if(!t||"object"!=typeof t||"[object Object]"!==ar.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var r=e,n=Object.getPrototypeOf(e);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===e}function sr(t){return"object"==typeof t&&(Bt(t)||Array.isArray(t)||ur(t))}function cr(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function fr(t,e){return Bt(t)?t.has(e):sr(t)&&Xt.call(t,e)}function lr(t,e,r){return Bt(t)?t.get(e,r):fr(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function pr(t){if(Array.isArray(t))return rr(t);var e={};for(var r in t)Xt.call(t,r)&&(e[r]=t[r]);return e}function hr(t,e){if(!sr(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(Bt(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!Xt.call(t,e))return t;var r=pr(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function dr(t,e,r){if(!sr(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(Bt(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(Xt.call(t,e)&&r===t[e])return t;var n=pr(t);return n[e]=r,n}function yr(t,e,r,n){n||(n=r,r=void 0);var i=function t(e,r,n,i,o,a){var u=r===gt;if(i===n.length){var s=u?o:r,c=a(s);return c===s?r:c}if(!u&&!sr(r))throw new TypeError("Cannot update within non-data-structure value in path ["+n.slice(0,i).map(cr)+"]: "+r);var f=n[i],l=u?gt:lr(r,f,gt),p=t(l===gt?e:Bt(l),l,n,i+1,o,a);return p===l?r:p===gt?hr(r,f):dr(u?e?Vr():{}:r,f,p)}(Bt(t),t,or(e),0,r,n);return i===gt?r:i}function vr(t,e,r){return yr(t,e,gt,(function(){return r}))}function _r(t,e){return vr(this,t,e)}function mr(t,e){return yr(t,e,(function(){return gt}))}function gr(t){return mr(this,t)}function br(t,e,r,n){return yr(t,[e],r,n)}function wr(t,e,r){return 1===arguments.length?t(this):br(this,t,e,r)}function xr(t,e,r){return yr(this,t,e,r)}function Sr(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Or(this,t)}function Er(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Or(this,e,t)}function Or(t,e,r){for(var n=[],i=0;i<e.length;i++){var o=Dt(e[i]);0!==o.size&&n.push(o)}return 0===n.length?t:0!==t.toSeq().size||t.__ownerID||1!==n.length?t.withMutations((function(t){for(var e=r?function(e,n){br(t,n,gt,(function(t){return t===gt?e:r(t,e,n)}))}:function(e,r){t.set(r,e)},i=0;i<n.length;i++)n[i].forEach(e)})):t.constructor(n[0])}function kr(t,e,r){return Ar(t,e,function(t){return function e(r,n,i){return sr(r)&&sr(n)?Ar(r,[n],e):t?t(r,n,i):n}}(r))}function Ar(t,e,r){if(!sr(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(Bt(t))return"function"==typeof r&&t.mergeWith?t.mergeWith.apply(t,[r].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var n=Array.isArray(t),i=t,o=n?Lt:Dt,a=n?function(e){i===t&&(i=pr(i)),i.push(e)}:function(e,n){var o=Xt.call(i,n),a=o&&r?r(i[n],e,n):e;o&&a===i[n]||(i===t&&(i=pr(i)),i[n]=a)},u=0;u<e.length;u++)o(e[u]).forEach(a);return i}function Ir(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return kr(this,t)}function jr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return kr(this,e,t)}function Rr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return yr(this,t,Vr(),(function(t){return Ar(t,e)}))}function Tr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return yr(this,t,Vr(),(function(t){return kr(t,e)}))}function Cr(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function zr(){return this.__ownerID?this:this.__ensureOwner(new wt)}function Mr(){return this.__ensureOwner()}function Dr(){return this.__altered}var Lr=function(t){function e(e){return null==e?Vr():pe(e)&&!Yt(e)?e:Vr().withMutations((function(r){var n=t(e);ir(n.size),n.forEach((function(t,e){return r.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Vr().withMutations((function(e){for(var r=0;r<t.length;r+=2){if(r+1>=t.length)throw new Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Hr(this,t,e)},e.prototype.remove=function(t){return Hr(this,t,gt)},e.prototype.deleteAll=function(t){var e=Mt(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Vr()},e.prototype.sort=function(t){return bn(Ge(this,t))},e.prototype.sortBy=function(t,e){return bn(Ge(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,t.call(e,i,o,r))}))}))},e.prototype.__iterator=function(t,e){return new Jr(this,t,e)},e.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate((function(e){return n++,t(e[1],e[0],r)}),e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Wr(this.size,this._root,t,this.__hash):0===this.size?Vr():(this.__ownerID=t,this.__altered=!1,this)},e}(Dt);Lr.isMap=pe;var Pr=Lr.prototype;Pr["@@__IMMUTABLE_MAP__@@"]=!0,Pr.delete=Pr.remove,Pr.removeAll=Pr.deleteAll,Pr.setIn=_r,Pr.removeIn=Pr.deleteIn=gr,Pr.update=wr,Pr.updateIn=xr,Pr.merge=Pr.concat=Sr,Pr.mergeWith=Er,Pr.mergeDeep=Ir,Pr.mergeDeepWith=jr,Pr.mergeIn=Rr,Pr.mergeDeepIn=Tr,Pr.withMutations=Cr,Pr.wasAltered=Dr,Pr.asImmutable=Mr,Pr["@@transducer/init"]=Pr.asMutable=zr,Pr["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Pr["@@transducer/result"]=function(t){return t.asImmutable()};var qr=function(t,e){this.ownerID=t,this.entries=e};qr.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(ye(r,i[o][0]))return i[o][1];return n},qr.prototype.update=function(t,e,r,n,i,o,a){for(var u=i===gt,s=this.entries,c=0,f=s.length;c<f&&!ye(n,s[c][0]);c++);var l=c<f;if(l?s[c][1]===i:u)return this;if(bt(a),(u||!l)&&bt(o),!u||1!==s.length){if(!l&&!u&&s.length>=en)return function(t,e,r,n){t||(t=new wt);for(var i=new Yr(t,ge(r),[r,n]),o=0;o<e.length;o++){var a=e[o];i=i.update(t,0,void 0,a[0],a[1])}return i}(t,s,n,i);var p=t&&t===this.ownerID,h=p?s:rr(s);return l?u?c===f-1?h.pop():h[c]=h.pop():h[c]=[n,i]:h.push([n,i]),p?(this.entries=h,this):new qr(t,h)}};var Ur=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Ur.prototype.get=function(t,e,r,n){void 0===e&&(e=ge(r));var i=1<<(31&(0===t?e:e>>>t)),o=this.bitmap;return 0==(o&i)?n:this.nodes[Zr(o&i-1)].get(t+5,e,r,n)},Ur.prototype.update=function(t,e,r,n,i,o,a){void 0===r&&(r=ge(n));var u=31&(0===e?r:r>>>e),s=1<<u,c=this.bitmap,f=0!=(c&s);if(!f&&i===gt)return this;var l=Zr(c&s-1),p=this.nodes,h=f?p[l]:void 0,d=Qr(h,t,e+5,r,n,i,o,a);if(d===h)return this;if(!f&&d&&p.length>=rn)return function(t,e,r,n,i){for(var o=0,a=new Array(32),u=0;0!==r;u++,r>>>=1)a[u]=1&r?e[o++]:void 0;return a[n]=i,new Br(t,o+1,a)}(t,p,c,u,d);if(f&&!d&&2===p.length&&$r(p[1^l]))return p[1^l];if(f&&d&&1===p.length&&$r(d))return d;var y=t&&t===this.ownerID,v=f?d?c:c^s:c|s,_=f?d?tn(p,l,d,y):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,a=0;a<n;a++)a===e&&(o=1),i[a]=t[a+o];return i}(p,l,y):function(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),a=0,u=0;u<i;u++)u===e?(o[u]=r,a=-1):o[u]=t[u+a];return o}(p,l,d,y);return y?(this.bitmap=v,this.nodes=_,this):new Ur(t,v,_)};var Br=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Br.prototype.get=function(t,e,r,n){void 0===e&&(e=ge(r));var i=31&(0===t?e:e>>>t),o=this.nodes[i];return o?o.get(t+5,e,r,n):n},Br.prototype.update=function(t,e,r,n,i,o,a){void 0===r&&(r=ge(n));var u=31&(0===e?r:r>>>e),s=i===gt,c=this.nodes,f=c[u];if(s&&!f)return this;var l=Qr(f,t,e+5,r,n,i,o,a);if(l===f)return this;var p=this.count;if(f){if(!l&&--p<nn)return function(t,e,r,n){for(var i=0,o=0,a=new Array(r),u=0,s=1,c=e.length;u<c;u++,s<<=1){var f=e[u];void 0!==f&&u!==n&&(i|=s,a[o++]=f)}return new Ur(t,i,a)}(t,c,p,u)}else p++;var h=t&&t===this.ownerID,d=tn(c,u,l,h);return h?(this.count=p,this.nodes=d,this):new Br(t,p,d)};var Nr=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r};Nr.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(ye(r,i[o][0]))return i[o][1];return n},Nr.prototype.update=function(t,e,r,n,i,o,a){void 0===r&&(r=ge(n));var u=i===gt;if(r!==this.keyHash)return u?this:(bt(a),bt(o),Xr(this,t,e,r,[n,i]));for(var s=this.entries,c=0,f=s.length;c<f&&!ye(n,s[c][0]);c++);var l=c<f;if(l?s[c][1]===i:u)return this;if(bt(a),(u||!l)&&bt(o),u&&2===f)return new Yr(t,this.keyHash,s[1^c]);var p=t&&t===this.ownerID,h=p?s:rr(s);return l?u?c===f-1?h.pop():h[c]=h.pop():h[c]=[n,i]:h.push([n,i]),p?(this.entries=h,this):new Nr(t,this.keyHash,h)};var Yr=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};Yr.prototype.get=function(t,e,r,n){return ye(r,this.entry[0])?this.entry[1]:n},Yr.prototype.update=function(t,e,r,n,i,o,a){var u=i===gt,s=ye(n,this.entry[0]);return(s?i===this.entry[1]:u)?this:(bt(a),u?void bt(o):s?t&&t===this.ownerID?(this.entry[1]=i,this):new Yr(t,this.keyHash,[n,i]):(bt(o),Xr(this,t,e,ge(n),[n,i])))},qr.prototype.iterate=Nr.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===t(r[e?i-n:n]))return!1},Ur.prototype.iterate=Br.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[e?i-n:n];if(o&&!1===o.iterate(t,e))return!1}},Yr.prototype.iterate=function(t,e){return t(this.entry)};var Fr,Jr=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Gr(t._root)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r=e.node,n=e.index++,i=void 0;if(r.entry){if(0===n)return Kr(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Kr(t,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){var o=r.nodes[this._reverse?i-n:n];if(o){if(o.entry)return Kr(t,o.entry);e=this._stack=Gr(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},e}(Kt);function Kr(t,e){return Gt(t,e[0],e[1])}function Gr(t,e){return{node:t,index:0,__prev:e}}function Wr(t,e,r,n){var i=Object.create(Pr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Vr(){return Fr||(Fr=Wr(0))}function Hr(t,e,r){var n,i;if(t._root){var o={value:!1},a={value:!1};if(n=Qr(t._root,t.__ownerID,0,void 0,e,r,o,a),!a.value)return t;i=t.size+(o.value?r===gt?-1:1:0)}else{if(r===gt)return t;i=1,n=new qr(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?Wr(i,n):Vr()}function Qr(t,e,r,n,i,o,a,u){return t?t.update(e,r,n,i,o,a,u):o===gt?t:(bt(u),bt(a),new Yr(e,n,[i,o]))}function $r(t){return t.constructor===Yr||t.constructor===Nr}function Xr(t,e,r,n,i){if(t.keyHash===n)return new Nr(e,n,[t.entry,i]);var o,a=31&(0===r?t.keyHash:t.keyHash>>>r),u=31&(0===r?n:n>>>r),s=a===u?[Xr(t,e,r+5,n,i)]:(o=new Yr(e,n,i),a<u?[t,o]:[o,t]);return new Ur(e,1<<a|1<<u,s)}function Zr(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function tn(t,e,r,n){var i=n?t:rr(t);return i[e]=r,i}var en=8,rn=16,nn=8;function on(t){return Boolean(t&&t["@@__IMMUTABLE_LIST__@@"])}var an=function(t){function e(e){var r=hn();if(null==e)return r;if(on(e))return e;var n=t(e),i=n.size;return 0===i?r:(ir(i),i>0&&i<32?pn(0,i,5,null,new sn(n.toArray())):r.withMutations((function(t){t.setSize(i),n.forEach((function(e,r){return t.set(r,e)}))})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("List [","]")},e.prototype.get=function(t,e){if((t=St(this,t))>=0&&t<this.size){var r=vn(this,t+=this._origin);return r&&r.array[31&t]}return e},e.prototype.set=function(t,e){return function(t,e,r){if((e=St(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations((function(t){e<0?_n(t,e).set(0,r):_n(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=mn(t._capacity)?n=dn(n,t.__ownerID,0,e,r,o):i=dn(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return pn(t._origin,t._capacity,t._level,i,n)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):hn()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){_n(r,0,e+t.length);for(var n=0;n<t.length;n++)r.set(e+n,t[n])}))},e.prototype.pop=function(){return _n(this,0,-1)},e.prototype.unshift=function(){var t=arguments;return this.withMutations((function(e){_n(e,-t.length);for(var r=0;r<t.length;r++)e.set(r,t[r])}))},e.prototype.shift=function(){return _n(this,1)},e.prototype.concat=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++){var i=e[n],o=t("string"!=typeof i&&Vt(i)?i:[i]);0!==o.size&&r.push(o)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(t){r.forEach((function(e){return e.forEach((function(e){return t.push(e)}))}))})):this.constructor(r[0])},e.prototype.setSize=function(t){return _n(this,0,t)},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){for(var i=0;i<r.size;i++)n.set(i,t.call(e,n.get(i),i,r))}))},e.prototype.slice=function(t,e){var r=this.size;return Ot(t,e,r)?this:_n(this,kt(t,r),At(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=ln(this,e);return new Kt((function(){var i=n();return i===fn?{value:void 0,done:!0}:Gt(t,e?--r:r++,i)}))},e.prototype.__iterate=function(t,e){for(var r,n=e?this.size:0,i=ln(this,e);(r=i())!==fn&&!1!==t(r,e?--n:n++,this););return n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?pn(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?hn():(this.__ownerID=t,this.__altered=!1,this)},e}(Lt);an.isList=on;var un=an.prototype;un["@@__IMMUTABLE_LIST__@@"]=!0,un.delete=un.remove,un.merge=un.concat,un.setIn=_r,un.deleteIn=un.removeIn=gr,un.update=wr,un.updateIn=xr,un.mergeIn=Rr,un.mergeDeepIn=Tr,un.withMutations=Cr,un.wasAltered=Dr,un.asImmutable=Mr,un["@@transducer/init"]=un.asMutable=zr,un["@@transducer/step"]=function(t,e){return t.push(e)},un["@@transducer/result"]=function(t){return t.asImmutable()};var sn=function(t,e){this.array=t,this.ownerID=e};sn.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0===this.array.length)return this;var n=r>>>e&31;if(n>=this.array.length)return new sn([],t);var i,o=0===n;if(e>0){var a=this.array[n];if((i=a&&a.removeBefore(t,e-5,r))===a&&o)return this}if(o&&!i)return this;var u=yn(this,t);if(!o)for(var s=0;s<n;s++)u.array[s]=void 0;return i&&(u.array[n]=i),u},sn.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e:0)||0===this.array.length)return this;var n,i=r-1>>>e&31;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((n=o&&o.removeAfter(t,e-5,r))===o&&i===this.array.length-1)return this}var a=yn(this,t);return a.array.splice(i+1),n&&(a.array[i]=n),a};var cn,fn={};function ln(t,e){var r=t._origin,n=t._capacity,i=mn(n),o=t._tail;return a(t._root,t._level,0);function a(t,u,s){return 0===u?function(t,a){var u=a===i?o&&o.array:t&&t.array,s=a>r?0:r-a,c=n-a;c>32&&(c=32);return function(){if(s===c)return fn;var t=e?--c:s++;return u&&u[t]}}(t,s):function(t,i,o){var u,s=t&&t.array,c=o>r?0:r-o>>i,f=1+(n-o>>i);f>32&&(f=32);return function(){for(;;){if(u){var t=u();if(t!==fn)return t;u=null}if(c===f)return fn;var r=e?--f:c++;u=a(s&&s[r],i-5,o+(r<<i))}}}(t,u,s)}}function pn(t,e,r,n,i,o,a){var u=Object.create(un);return u.size=e-t,u._origin=t,u._capacity=e,u._level=r,u._root=n,u._tail=i,u.__ownerID=o,u.__hash=a,u.__altered=!1,u}function hn(){return cn||(cn=pn(0,0,5))}function dn(t,e,r,n,i,o){var a,u=n>>>r&31,s=t&&u<t.array.length;if(!s&&void 0===i)return t;if(r>0){var c=t&&t.array[u],f=dn(c,e,r-5,n,i,o);return f===c?t:((a=yn(t,e)).array[u]=f,a)}return s&&t.array[u]===i?t:(o&&bt(o),a=yn(t,e),void 0===i&&u===a.array.length-1?a.array.pop():a.array[u]=i,a)}function yn(t,e){return e&&t&&e===t.ownerID?t:new sn(t?t.array.slice():[],e)}function vn(t,e){if(e>=mn(t._capacity))return t._tail;if(e<1<<t._level+5){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&31],n-=5;return r}}function _n(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new wt,i=t._origin,o=t._capacity,a=i+e,u=void 0===r?o:r<0?o+r:i+r;if(a===i&&u===o)return t;if(a>=u)return t.clear();for(var s=t._level,c=t._root,f=0;a+f<0;)c=new sn(c&&c.array.length?[void 0,c]:[],n),f+=1<<(s+=5);f&&(a+=f,i+=f,u+=f,o+=f);for(var l=mn(o),p=mn(u);p>=1<<s+5;)c=new sn(c&&c.array.length?[c]:[],n),s+=5;var h=t._tail,d=p<l?vn(t,u-1):p>l?new sn([],n):h;if(h&&p>l&&a<o&&h.array.length){for(var y=c=yn(c,n),v=s;v>5;v-=5){var _=l>>>v&31;y=y.array[_]=yn(y.array[_],n)}y.array[l>>>5&31]=h}if(u<o&&(d=d&&d.removeAfter(n,0,u)),a>=p)a-=p,u-=p,s=5,c=null,d=d&&d.removeBefore(n,0,a);else if(a>i||p<l){for(f=0;c;){var m=a>>>s&31;if(m!==p>>>s&31)break;m&&(f+=(1<<s)*m),s-=5,c=c.array[m]}c&&a>i&&(c=c.removeBefore(n,s,a-f)),c&&p<l&&(c=c.removeAfter(n,s,p-f)),f&&(a-=f,u-=f)}return t.__ownerID?(t.size=u-a,t._origin=a,t._capacity=u,t._level=s,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):pn(a,u,s,c,d)}function mn(t){return t<32?0:t-1>>>5<<5}var gn,bn=function(t){function e(t){return null==t?xn():he(t)?t:xn().withMutations((function(e){var r=Dt(t);ir(r.size),r.forEach((function(t,r){return e.set(r,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):xn()},e.prototype.set=function(t,e){return Sn(this,t,e)},e.prototype.remove=function(t){return Sn(this,t,gt)},e.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],r)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?wn(e,r,t,this.__hash):0===this.size?xn():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Lr);function wn(t,e,r,n){var i=Object.create(bn.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function xn(){return gn||(gn=wn(Vr(),hn()))}function Sn(t,e,r){var n,i,o=t._map,a=t._list,u=o.get(e),s=void 0!==u;if(r===gt){if(!s)return t;a.size>=32&&a.size>=2*o.size?(n=(i=a.filter((function(t,e){return void 0!==t&&u!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=u===a.size-1?a.pop():a.set(u,void 0))}else if(s){if(r===a.get(u)[1])return t;n=o,i=a.set(u,[e,r])}else n=o.set(e,a.size),i=a.set(a.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):wn(n,i)}bn.isOrderedMap=he,bn.prototype[Nt]=!0,bn.prototype.delete=bn.prototype.remove;function En(t){return Boolean(t&&t["@@__IMMUTABLE_STACK__@@"])}var On=function(t){function e(t){return null==t?jn():En(t)?t:jn().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=St(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):In(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&En(e))return e;ir(e.size);var r=this.size,n=this._head;return e.__iterate((function(t){r++,n={value:t,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):In(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):jn()},e.prototype.slice=function(e,r){if(Ot(e,r,this.size))return this;var n=kt(e,this.size);if(At(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):In(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?In(this.size,this._head,t,this.__hash):0===this.size?jn():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new ie(this.toArray()).__iterate((function(e,n){return t(e,n,r)}),e);for(var n=0,i=this._head;i&&!1!==t(i.value,n++,this);)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new ie(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new Kt((function(){if(n){var e=n.value;return n=n.next,Gt(t,r++,e)}return{value:void 0,done:!0}}))},e}(Lt);On.isStack=En;var kn,An=On.prototype;function In(t,e,r,n){var i=Object.create(An);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function jn(){return kn||(kn=In(0))}An["@@__IMMUTABLE_STACK__@@"]=!0,An.shift=An.pop,An.unshift=An.push,An.unshiftAll=An.pushAll,An.withMutations=Cr,An.wasAltered=Dr,An.asImmutable=Mr,An["@@transducer/init"]=An.asMutable=zr,An["@@transducer/step"]=function(t,e){return t.unshift(e)},An["@@transducer/result"]=function(t){return t.asImmutable()};function Rn(t){return Boolean(t&&t["@@__IMMUTABLE_SET__@@"])}function Tn(t){return Rn(t)&&Yt(t)}function Cn(t,e){if(t===e)return!0;if(!Rt(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||Tt(t)!==Tt(e)||Ct(t)!==Ct(e)||Yt(t)!==Yt(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!zt(t);if(Yt(t)){var n=t.entries();return e.every((function(t,e){var i=n.next().value;return i&&ye(i[1],t)&&(r||ye(i[0],e))}))&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var a=!0,u=e.__iterate((function(e,n){if(r?!t.has(e):i?!ye(e,t.get(n,gt)):!ye(t.get(n,gt),e))return a=!1,!1}));return a&&t.size===u}function zn(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Mn(t){if(!t||"object"!=typeof t)return t;if(!Rt(t)){if(!sr(t))return t;t=te(t)}if(Tt(t)){var e={};return t.__iterate((function(t,r){e[r]=Mn(t)})),e}var r=[];return t.__iterate((function(t){r.push(Mn(t))})),r}var Dn=function(t){function e(e){return null==e?Bn():Rn(e)&&!Yt(e)?e:Bn().withMutations((function(r){var n=t(e);ir(n.size),n.forEach((function(t){return r.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Dt(t).keySeq())},e.intersect=function(t){return(t=Mt(t).toArray()).length?Pn.intersect.apply(e(t.pop()),t):Bn()},e.union=function(t){return(t=Mt(t).toArray()).length?Pn.union.apply(e(t.pop()),t):Bn()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return qn(this,this._map.set(t,t))},e.prototype.remove=function(t){return qn(this,this._map.remove(t))},e.prototype.clear=function(){return qn(this,this._map.clear())},e.prototype.map=function(t,e){var r=this,n=!1,i=qn(this,this._map.mapEntries((function(i){var o=i[1],a=t.call(e,o,o,r);return a!==o&&(n=!0),[a,a]}),e));return n?i:this},e.prototype.union=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(r){for(var n=0;n<e.length;n++)t(e[n]).forEach((function(t){return r.add(t)}))})):this.constructor(e[0])},e.prototype.intersect=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.every((function(e){return e.includes(t)}))||n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.subtract=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.some((function(e){return e.includes(t)}))&&n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.sort=function(t){return ii(Ge(this,t))},e.prototype.sortBy=function(t,e){return ii(Ge(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(Pt);Dn.isSet=Rn;var Ln,Pn=Dn.prototype;function qn(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Un(t,e){var r=Object.create(Pn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Bn(){return Ln||(Ln=Un(Vr()))}Pn["@@__IMMUTABLE_SET__@@"]=!0,Pn.delete=Pn.remove,Pn.merge=Pn.concat=Pn.union,Pn.withMutations=Cr,Pn.asImmutable=Mr,Pn["@@transducer/init"]=Pn.asMutable=zr,Pn["@@transducer/step"]=function(t,e){return t.add(e)},Pn["@@transducer/result"]=function(t){return t.asImmutable()},Pn.__empty=Bn,Pn.__make=Un;var Nn,Yn=function(t){function e(t,r,n){if(!(this instanceof e))return new e(t,r,n);if(nr(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<t&&(n=-n),this._start=t,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-t)/n-1)+1),0===this.size){if(Nn)return Nn;Nn=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},e.prototype.get=function(t,e){return this.has(t)?this._start+St(this,t)*this._step:e},e.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},e.prototype.slice=function(t,r){return Ot(t,r,this.size)?this:(t=kt(t,this.size),(r=At(r,this.size))<=t?new e(0,0):new e(this.get(t,this._end),this.get(r,this._end),this._step))},e.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var r=e/this._step;if(r>=0&&r<this.size)return r}return-1},e.prototype.lastIndexOf=function(t){return this.indexOf(t)},e.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},e.prototype.__iterator=function(t,e){var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;return new Kt((function(){if(o===r)return{value:void 0,done:!0};var a=i;return i+=e?-n:n,Gt(t,e?r-++o:o++,a)}))},e.prototype.equals=function(t){return t instanceof e?this._start===t._start&&this._end===t._end&&this._step===t._step:Cn(this,t)},e}(re);function Fn(t,e,r){for(var n=or(e),i=0;i!==n.length;)if((t=lr(t,n[i++],gt))===gt)return r;return t}function Jn(t,e){return Fn(this,t,e)}function Kn(t,e){return Fn(t,e,gt)!==gt}function Gn(){ir(this.size);var t={};return this.__iterate((function(e,r){t[r]=e})),t}Mt.isIterable=Rt,Mt.isKeyed=Tt,Mt.isIndexed=Ct,Mt.isAssociative=zt,Mt.isOrdered=Yt,Mt.Iterator=Kt,zn(Mt,{toArray:function(){ir(this.size);var t=new Array(this.size||0),e=Tt(this),r=0;return this.__iterate((function(n,i){t[r++]=e?[i,n]:n})),t},toIndexedSeq:function(){return new De(this)},toJS:function(){return Mn(this)},toKeyedSeq:function(){return new Me(this,!0)},toMap:function(){return Lr(this.toKeyedSeq())},toObject:Gn,toOrderedMap:function(){return bn(this.toKeyedSeq())},toOrderedSet:function(){return ii(Tt(this)?this.valueSeq():this)},toSet:function(){return Dn(Tt(this)?this.valueSeq():this)},toSetSeq:function(){return new Le(this)},toSeq:function(){return Ct(this)?this.toIndexedSeq():Tt(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return On(Tt(this)?this.valueSeq():this)},toList:function(){return an(Tt(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Qe(this,Je(this,t))},includes:function(t){return this.some((function(e){return ye(e,t)}))},entries:function(){return this.__iterator(2)},every:function(t,e){ir(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!t.call(e,n,i,o))return r=!1,!1})),r},filter:function(t,e){return Qe(this,Ne(this,t,e,!0))},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return ir(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ir(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate((function(n){r?r=!1:e+=t,e+=null!=n?n.toString():""})),e},keys:function(){return this.__iterator(0)},map:function(t,e){return Qe(this,Ue(this,t,e))},reduce:function(t,e,r){return Qn(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return Qn(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Qe(this,Be(this,!0))},slice:function(t,e){return Qe(this,Ye(this,t,e,!0))},some:function(t,e){return!this.every(Zn(t),e)},sort:function(t){return Qe(this,Ge(this,t))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return xt(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,r){var n=Lr().asMutable();return t.__iterate((function(i,o){n.update(e.call(r,i,o,t),0,(function(t){return t+1}))})),n.asImmutable()}(this,t,e)},equals:function(t){return Cn(this,t)},entrySeq:function(){var t=this;if(t._cache)return new ie(t._cache);var e=t.toSeq().map(Xn).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Zn(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate((function(r,i,o){if(t.call(e,r,i,o))return n=[i,r],!1})),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(Et,null,t)},flatMap:function(t,e){return Qe(this,function(t,e,r){var n=Xe(t);return t.toSeq().map((function(i,o){return n(e.call(r,i,o,t))})).flatten(!0)}(this,t,e))},flatten:function(t){return Qe(this,Ke(this,t,!0))},fromEntrySeq:function(){return new Pe(this)},get:function(t,e){return this.find((function(e,r){return ye(r,t)}),void 0,e)},getIn:Jn,groupBy:function(t,e){return function(t,e,r){var n=Tt(t),i=(Yt(t)?bn():Lr()).asMutable();t.__iterate((function(o,a){i.update(e.call(r,o,a,t),(function(t){return(t=t||[]).push(n?[a,o]:o),t}))}));var o=Xe(t);return i.map((function(e){return Qe(t,o(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,gt)!==gt},hasIn:function(t){return Kn(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:Mt(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:Mt(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return ye(e,t)}))},keySeq:function(){return this.toSeq().map($n).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return We(this,t)},maxBy:function(t,e){return We(this,e,t)},min:function(t){return We(this,t?ti(t):ri)},minBy:function(t,e){return We(this,e?ti(e):ri,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Qe(this,Fe(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Zn(t),e)},sortBy:function(t,e){return Qe(this,Ge(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Qe(this,function(t,e,r){var n=Ze(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var a=0;return t.__iterate((function(t,i,u){return e.call(r,t,i,u)&&++a&&n(t,i,o)})),a},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var a=t.__iterator(2,i),u=!0;return new Kt((function(){if(!u)return{value:void 0,done:!0};var t=a.next();if(t.done)return t;var i=t.value,s=i[0],c=i[1];return e.call(r,c,s,o)?2===n?t:Gt(n,s,c,t):(u=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Zn(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=Yt(t),r=Tt(t),n=e?1:0;return function(t,e){return e=ve(e,3432918353),e=ve(e<<15|e>>>-15,461845907),e=ve(e<<13|e>>>-13,5),e=ve((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=_e((e=ve(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+ni(ge(t),ge(e))|0}:function(t,e){n=n+ni(ge(t),ge(e))|0}:e?function(t){n=31*n+ge(t)|0}:function(t){n=n+ge(t)|0}),n)}(this))}});var Wn=Mt.prototype;Wn["@@__IMMUTABLE_ITERABLE__@@"]=!0,Wn[Jt]=Wn.values,Wn.toJSON=Wn.toArray,Wn.__toStringMapper=cr,Wn.inspect=Wn.toSource=function(){return this.toString()},Wn.chain=Wn.flatMap,Wn.contains=Wn.includes,zn(Dt,{flip:function(){return Qe(this,qe(this))},mapEntries:function(t,e){var r=this,n=0;return Qe(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Qe(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var Vn=Dt.prototype;Vn["@@__IMMUTABLE_KEYED__@@"]=!0,Vn[Jt]=Wn.entries,Vn.toJSON=Gn,Vn.__toStringMapper=function(t,e){return cr(e)+": "+cr(t)},zn(Lt,{toKeyedSeq:function(){return new Me(this,!1)},filter:function(t,e){return Qe(this,Ne(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Qe(this,Be(this,!1))},slice:function(t,e){return Qe(this,Ye(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=kt(t,t<0?this.count():this.size);var n=this.slice(0,t);return Qe(this,1===r?n:n.concat(rr(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Qe(this,Ke(this,t,!1))},get:function(t,e){return(t=St(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=St(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Qe(this,function(t,e){var r=Ze(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate((function(t){return(!o||!1!==r(e,o++,i))&&!1!==r(t,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(1,n),a=0;return new Kt((function(){return(!i||a%2)&&(i=o.next()).done?i:a%2?Gt(r,a++,e):Gt(r,a++,i.value,i)}))},r}(this,t))},interleave:function(){var t=[this].concat(rr(arguments)),e=He(this.toSeq(),re.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Qe(this,r)},keySeq:function(){return Yn(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Qe(this,Fe(this,t,e,!1))},zip:function(){var t=[this].concat(rr(arguments));return Qe(this,He(this,ei,t))},zipAll:function(){var t=[this].concat(rr(arguments));return Qe(this,He(this,ei,t,!0))},zipWith:function(t){var e=rr(arguments);return e[0]=this,Qe(this,He(this,t,e))}});var Hn=Lt.prototype;function Qn(t,e,r,n,i,o){return ir(t.size),t.__iterate((function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),o),r}function $n(t,e){return e}function Xn(t,e){return[e,t]}function Zn(t){return function(){return!t.apply(this,arguments)}}function ti(t){return function(){return-t.apply(this,arguments)}}function ei(){return rr(arguments)}function ri(t,e){return t<e?1:t>e?-1:0}function ni(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Hn["@@__IMMUTABLE_INDEXED__@@"]=!0,Hn[Nt]=!0,zn(Pt,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),Pt.prototype.has=Wn.includes,Pt.prototype.contains=Pt.prototype.includes,zn(ee,Dt.prototype),zn(re,Lt.prototype),zn(ne,Pt.prototype);var ii=function(t){function e(t){return null==t?si():Tn(t)?t:si().withMutations((function(e){var r=Pt(t);ir(r.size),r.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Dt(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Dn);ii.isOrderedSet=Tn;var oi,ai=ii.prototype;function ui(t,e){var r=Object.create(ai);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function si(){return oi||(oi=ui(xn()))}ai[Nt]=!0,ai.zip=Hn.zip,ai.zipWith=Hn.zipWith,ai.zipAll=Hn.zipAll,ai.__empty=si,ai.__make=ui;var ci=function(t,e){var r;!function(t){if(Ut(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Bt(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var n=function(o){var a=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t),s=i._indices={};i._name=e,i._keys=u,i._defaultValues=t;for(var c=0;c<u.length;c++){var f=u[c];s[f]=c,i[f]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+hi(this)+' with property "'+f+'" since that property name is part of the Record API.'):yi(i,f)}}return this.__ownerID=void 0,this._values=an().withMutations((function(t){t.setSize(a._keys.length),Dt(o).forEach((function(e,r){t.set(a._indices[r],e===a._defaultValues[r]?void 0:e)}))})),this},i=n.prototype=Object.create(li);return i.constructor=n,e&&(n.displayName=e),n};ci.prototype.toString=function(){for(var t,e=hi(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+cr(this.get(t));return e+" }"},ci.prototype.equals=function(t){return this===t||t&&di(this).equals(di(t))},ci.prototype.hashCode=function(){return di(this).hashCode()},ci.prototype.has=function(t){return this._indices.hasOwnProperty(t)},ci.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._indices[t],n=this._values.get(r);return void 0===n?this._defaultValues[t]:n},ci.prototype.set=function(t,e){if(this.has(t)){var r=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(r!==this._values&&!this.__ownerID)return pi(this,r)}return this},ci.prototype.remove=function(t){return this.set(t)},ci.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:pi(this,t)},ci.prototype.wasAltered=function(){return this._values.wasAltered()},ci.prototype.toSeq=function(){return di(this)},ci.prototype.toJS=function(){return Mn(this)},ci.prototype.entries=function(){return this.__iterator(2)},ci.prototype.__iterator=function(t,e){return di(this).__iterator(t,e)},ci.prototype.__iterate=function(t,e){return di(this).__iterate(t,e)},ci.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?pi(this,e,t):(this.__ownerID=t,this._values=e,this)},ci.isRecord=Ut,ci.getDescriptiveName=hi;var fi,li=ci.prototype;function pi(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function hi(t){return t.constructor.displayName||t.constructor.name||"Record"}function di(t){return ce(t._keys.map((function(e){return[e,t.get(e)]})))}function yi(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){nr(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}function vi(t,e){return Tt(e)?e.toMap():e.toList()}li["@@__IMMUTABLE_RECORD__@@"]=!0,li.delete=li.remove,li.deleteIn=li.removeIn=gr,li.getIn=Jn,li.hasIn=Wn.hasIn,li.merge=Sr,li.mergeWith=Er,li.mergeIn=Rr,li.mergeDeep=Ir,li.mergeDeepWith=jr,li.mergeDeepIn=Tr,li.setIn=_r,li.update=wr,li.updateIn=xr,li.withMutations=Cr,li.asMutable=zr,li.asImmutable=Mr,li[Jt]=li.entries,li.toJSON=li.toObject=Wn.toObject,li.inspect=li.toSource=function(){return this.toString()};var _i={version:"4.0.0-rc.14",Collection:Mt,Iterable:Mt,Seq:te,Map:Lr,OrderedMap:bn,List:an,Stack:On,Set:Dn,OrderedSet:ii,Record:ci,Range:Yn,Repeat:function(t){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this._value=t,this.size=void 0===r?1/0:Math.max(0,r),0===this.size){if(fi)return fi;fi=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},e.prototype.get=function(t,e){return this.has(t)?this._value:e},e.prototype.includes=function(t){return ye(this._value,t)},e.prototype.slice=function(t,r){var n=this.size;return Ot(t,r,n)?this:new e(this._value,At(r,n)-kt(t,n))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(t){return ye(this._value,t)?0:-1},e.prototype.lastIndexOf=function(t){return ye(this._value,t)?this.size:-1},e.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},e.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new Kt((function(){return i===n?{value:void 0,done:!0}:Gt(t,e?n-++i:i++,r._value)}))},e.prototype.equals=function(t){return t instanceof e?ye(this._value,t._value):Cn(t)},e}(re),is:ye,fromJS:function(t,e){return function t(e,r,n,i,o,a){var u=Array.isArray(n)?re:ur(n)?ee:null;if(u){if(~e.indexOf(n))throw new TypeError("Cannot convert circular structure to Immutable");e.push(n),o&&""!==i&&o.push(i);var s=r.call(a,i,u(n).map((function(i,a){return t(e,r,i,a,o,n)})),o&&o.slice());return e.pop(),o&&o.pop(),s}return n}([],e||vi,t,"",e&&e.length>2?[]:void 0,{"":t})},hash:ge,isImmutable:Bt,isCollection:Rt,isKeyed:Tt,isIndexed:Ct,isAssociative:zt,isOrdered:Yt,isValueObject:de,isPlainObject:ur,isSeq:qt,isList:on,isMap:pe,isOrderedMap:he,isStack:En,isSet:Rn,isOrderedSet:Tn,isRecord:Ut,get:lr,getIn:Fn,has:fr,hasIn:Kn,merge:function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Ar(t,e)},mergeDeep:function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return kr(t,e)},mergeWith:function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Ar(e,r,t)},mergeDeepWith:function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return kr(e,r,t)},remove:hr,removeIn:mr,set:dr,setIn:vr,update:br,updateIn:yr},mi={keysColor:"red",dashColor:"bold",stringColor:"red"},gi={keysColor:"cyan",dashColor:"bold",stringColor:"bold"},bi={keysColor:"magenta",dashColor:"black",stringColor:"bold"};var wi=function(t,e){var r=t.items("tablesByName",e);if(null!==r){var n=r.get("rows"),i=[];r.get("schema").map((function(t){i.push(t.get("name"))})),zi.object(i,"Columns"),zi.titleLine("Data Rows");var o=n.map((function(t,e){var r={};return t.map((function(t,e){r[i[e]]=t})),r}));zi.object(o,"Data for ".concat(e))}},xi=r(12),Si=r.n(xi);function Ei(){return(Ei=s()(f.a.mark((function t(e){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.map((function(t){var e=t.line.replace(/(\r\n|\n|\r)/gm,"");0===e.length&&console.log(" "),"title"===t.type?console.log(Si.a.bold(e)):console.log(e)})),t.abrupt("return");case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Oi=function(t){return Ei.apply(this,arguments)},ki=r(8),Ai=r.n(ki);function Ii(t){console.log(" ","\n======================================="),console.log(Ai.a.render({title:t},bi)),console.log(" ","=======================================\n")}function ji(t,e){Ii("".concat(e," size: ").concat(t.itemsList().size)),t.itemsList().size>0?Ci(t.itemsList().toJS()):Ci({info:"List is empty"})}function Ri(t,e){Ii("".concat(e," size: ").concat(t.links().size)),t.links().forEach((function(t,e){Ci({rel:e})}))}function Ti(t,e){Ii("".concat(e," size: ").concat(ji.size)),Ci(t.items().toJS())}function Ci(t,e){!function(t,e){e&&Ii(e);console.log(Ai.a.render(t,gi))}(_i.Iterable.isIterable(t)?t.toJS():"object"===mt()(t)||Array.isArray(t)?t:{value:t},e)}var zi={result:function(t,e){t.itemsList().size>0&&ji(t,"".concat(e,": ItemList")),t.links().size>0&&Ri(t,"".concat(e,": links")),null!==t.items()&&Ti(t,"".concat(e,": items"))},itemsList:ji,links:Ri,items:Ti,itemsCmd:function(t,e,r){Ii("".concat(r," size: ").concat(t.itemsCmd(e).size)),t.itemsCmd(e).forEach((function(t,e){Ci({rel:e})}))},object:Ci,errMsg:function(t){var e="object"===mt()(t)?t:{Error:t};console.log(Ai.a.render(e,mi))},msg:function(t,e){e&&Ii(e),console.log(Ai.a.render(t,gi))},titleLine:Ii,casTable:wi,logListLines:Oi};function Mi(t){this.message=t}Mi.prototype=new Error,Mi.prototype.name="InvalidCharacterError";var Di="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Mi("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,o=0,a="";n=e.charAt(o++);~n&&(r=i%4?64*r+n:n,i++%4)?a+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};function Li(t){this.message=t}Li.prototype=new Error,Li.prototype.name="InvalidTokenError";var Pi=function(t,e){if("string"!=typeof t)throw new Li("Invalid token specified");var r=!0===(e=e||{}).header?0:1;try{return JSON.parse(function(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(Di(t).replace(/(.)/g,(function(t,e){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(e)}catch(t){return Di(e)}}(t.split(".")[r]))}catch(t){throw new Li("Invalid token specified: "+t.message)}};var qi=function(t){return Pi(t)},Ui=r(10),Bi=r.n(Ui),Ni=r(14),Yi=r(7),Fi=r(38).promises;function Ji(){return(Ji=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=Object(Ni.a)(n,i),null==a){t.next=5;break}t.t0=a,t.next=8;break;case 5:return t.next=7,Fi.readFile(n,u.fileOptions);case 7:t.t0=t.sent;case 8:return s=t.t0,null!==u.transform&&(s=u.transform(s,u)),t.next=12,u.handler(e,r,s,u,o);case 12:if(c=t.sent,!0!==o){t.next=18;break}return l=i.split("."),p=Bi()(l,2),h=p[0],d=p[1],t.next=17,Object(Yi.a)(e,r,h,d);case 17:c=c+"\n"+" ".concat(i," was saved");case 18:return t.abrupt("return",c);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ki=function(t,e,r,n,i,o){return Ji.apply(this,arguments)},Gi=r(43);function Wi(){return(Wi=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p,h,d,y,v,_,m,g,b,w,x;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.addServices("casManagement");case 2:return u=t.sent,s=u.casManagement,t.next=6,o.apiCall(s.links("servers"));case 6:if(0!==(c=t.sent).itemsList().size){t.next=9;break}throw{Error:"No cas servers were found"};case 9:return l=c.itemsList(0),p={qs:{filter:"eq(name,".concat(e,")")}},t.next=13,o.apiCall(c.itemsCmd(l,"caslibs"),p);case 13:return h=t.sent,t.next=16,o.apiCall(h.itemsCmd(e,"tables"));case 16:return d=t.sent,y={qs:{filter:"eq(name, ".concat(r.trim().toUpperCase(),")")}},t.next=20,o.apiCall(h.itemsCmd(e,"tables"),y);case 20:if(1!==(v=t.sent).itemsList().size){t.next=25;break}return _=v.itemsList(0),m=v.items(_,"data","tableReference","tableUri"),t.abrupt("return",m);case 25:return(g=new Gi).append("tableName",r),g.append("format",i),g.append("scope",null==a?"global":a),g.append("containsHeaderRow",!0),g.append("file",n),b={data:g,headers:{"content-type":'multipart/form-data; boundary="----------12345678901234567"'}},t.next=34,o.apiCall(d.links("upload"),b);case 34:return w=t.sent,x=w.items("tableReference","tableUri"),t.abrupt("return",x);case 37:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Vi=function(t,e,r,n,i,o){return Wi.apply(this,arguments)};var Hi=function(){return{caslRun:n.a,caslRunBase:i.a,casSetup:w,casActionRun:S,casFetchData:O,computeRun:C,computeSetup:M,computeSummary:I,computeFetchData:q,computeFileContent:B,computeResults:L,findReport:Y,getReportImage:J,getReportUri:G,getSASTableRows:V,jesSetup:Q,jesRun:it,jesSummary:X,jsonToDict:ot.a,casTableToJson:k,caslScore:y,caslDescribe:g,masSetup:lt,masAddModel:ut,masDescribe:pt,masRun:dt,decodeJwt:qi,casUpload:Ki,uploadData:Vi}}()}])}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("restaflib",[],e):"object"==typeof exports?exports.restaflib=e():t.restaflib=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}([function(t,e,r){t.exports=r(16)},function(t,e){function r(t,e,r,n,i,o,a){try{var u=t[o](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function u(t){r(a,i,o,u,s,"next",t)}function s(t){r(a,i,o,u,s,"throw",t)}u(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";var n=r(1),i=r.n(n),o=r(0),a=r.n(o),u=r(5);function s(){return(s=i()(a.a.mark((function t(e,r,n,i){var o,s,c,f,l,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=Object(u.a)(null!==i?i:{},"_args_"),s=(s=o+" "+n).replace(/\r?\n|\r/g,""),c={action:"sccasl.runcasl",data:{code:s}},f=d.length,l=new Array(f>4?f-4:0),p=4;p<f;p++)l[p-4]=d[p];return t.next=7,e.runAction.apply(e,[r,c].concat(l));case 7:return h=t.sent,t.abrupt("return",h);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,r,n){return s.apply(this,arguments)}},function(t,e,r){"use strict";var n=r(13),i=r.n(n);var o=function(){return"\n results = casFetchData(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format); \n send_response({casResults = results}); \n \n function casFetchData(caslib, name, from, count, format) ; \n \n rc = checkAndLoadTable(caslib, name);\n \n if (rc ne true) then do;\n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n\n /*\n * get all table to get rowCount\n */\n\n action table.tableinfo r= result/ \n caslib = caslib \n name = name; \n \n rowCount = result.TableInfo[1, 'rows']; \n to = min(from + count -1, rowCount); \n \n /*\n * get column information\n */\n\n action table.columninfo r=infoResult /\n table = {caslib=caslib name=name};\n\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\n i = 2;\n do c over inforesult.columninfo;\n columns[i] = c;\n i = i + 1;\n end;\n \n /*\n * Fetch the current set of rows\n */\n\n action table.fetch r = result / \n table = {caslib=caslib, name=name} \n from= from to=to format=format \n ; \n\n /* \n * create payload to return\n */\n\n i = 1;\n rows ={};\n do row over result.fetch;\n rr = {};\n j = 1;\n do key,v over row;\n rr[j] = override(columns[j].Type, v);\n j = j + 1;\n end;\n rows[i] = rr;\n i = i + 1;\n end;\n\n pagePrev = max(from - count, -1);\n if (from ne 1) then do;\n pagePrev = max(pagePrev,1);\n end; \n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do ; \n pageNext = min(to + 1, rowCount); \n end; \n table = {caslib=caslib, name=name};\n pagination = {next= {from=pageNext, count=count, format=format, table=table}, prev={from=pagePrev, count=count, format=format, table=table}};\n\n /*return ({pagination = {table = {caslib=caslib, name=name}, prev=pagePrev, next=pageNext, count=count}, rc=0 , data = {schema=columns, rows=rows } } ); */\n\n return( \n {pagination = pagination, data = {schema=columns, rows=rows }}\n );\n end; \n \n /*\n * For non-primary column types set new content\n */\n\n function override(type, iv);\n if (type EQ 'varbinary') then v = '...varbinary';\n else if (type EQ 'blob') then v = '...blob';\n else if (type EQ 'table') then v = '...table';\n else if (type EQ 'dictionary') then v = '...dictionary';\n else if (type EQ 'list') then v = '...list';\n else if (type EQ 'isArray') then v = '...array';\n else v = iv;\n return v;\n end;\n\n \n "};var a=function(){return"\n \n /*------------------------------------------------*/\n /*Does the tables exist and if not try to load it */\n /*\n Typical usage:\n rc = checkAndLoadTable(caslib, name);\n if ( rc ne true) then do;\n ...handle errors...\n end; \n else do;\n ...your stuff...\n end;\n rc = true - the data is ready for use\n rc = false - the table could not be found\n rc = -1 - the caslib does not exist\n */\n /*------------------------------------------------*/\n\n function checkAndLoadTable(caslib, name); \n\n /* verify caslib is there */\n table.queryCaslib status=status result=result/\n caslib = caslib;\n do k,v over result; /* to handle casuser[user] */ \n rc = v;\n end;\n if ( rc eq false ) then \n return -1;\n /* \n * Check to see if table is already loaded \n */ \n action table.tableExists r=result/ \n caslib = caslib \n name = name; \n /* \n * if not loaded then try to load it \n */ \n rc = true;\n if (result.exists eq 0) then do; \n path = lookupPath(caslib, name);\n if (path eq '*') then do;\n rc = false;\n end;\n else do;\n\t action table.loadTable status=status/ \n\t caslib = caslib \n\t source = path \n\t casout={caslib= caslib name=name}; \n\t if (status.statusCode ne 0 ) then rc = false;\n end; \n end; \n return rc; \n end; \n\n/*\n * return path to table\n */\n\nfunction lookupPath(caslib, name ) ; \n table.fileInfo r = result/ \n caslib=caslib; \n\n names = result.fileInfo[,4]; \n nameu = upcase(name)||'.SASHDAT'; \n cpath = '*'; \n count = 0; \n\n do n over names; \n\t if (upcase(n) eq nameu) then do; \n\t count = count + 1; \n\t if ( cpath eq '*') then do; \n\t cpath = n; \n\t end; \n\t end; \n end; \n \n if (count GT 1 ) then do; \n print 'Warning: ' count 'Files with names only different in case exist - First one chosen';\n print 'Path: ' cpath ' will be used****'; \n end; \n r = cpath; \n return r; \nend; \n\n /*-----------------------------------------*/ \n /* isModel: is it model table */ \n /*-----------------------------------------*/ \n \n function isModel(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n validTable = false; \n mtype = 'bad'; \n do c over result.columninfo; \n cu = upCase(c.Column); \n if ( cu eq 'DATASTEPSRC') then do; \n mtype = 'ds'; \n end; \n else if ( cu eq '_STATE_' ) then do; \n mtype = 'astore'; \n end; \n else if (cu eq 'MODELMETADATA') then do; \n mtype = 'ds2'; \n end; \n end; \n print 'Specified model type: ' || mtype; \n return mtype; \n end; \n \n /*-----------------------------------------*/ \n /* Returns contents of the specified table */ \n /*-----------------------------------------*/ \n \n function contents(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n /* columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}}; */ \n i = 1; \n columns = {}; \n do c over result.columninfo; \n columns[i] = c; \n i = i + 1; \n end; \n return {describe = columns, table = {}}; \n end; \n \n /*------------------------------------------*/ \n /* Returns unique values */ \n /*-----------------------------------------*/ \n \n function selectionLists(idvars,caslib, name); \n \n s = checkAndLoadTable(caslib, name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n \n do k over idvars; \n r = _getValues(k, caslib, name); \n results[k] = r; \n end; \n \n return results; \n end; \n \n function _getValues(id, caslib, name) ; \n \n action table.dropTable/ \n caslib='casuser' name='dtemp1' quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib='casuser' source= 'dtemp1.sashdat' quiet=TRUE; \n \n action simple.groupby result=r status=rc/ \n aggregator = 'N' \n inputs = {id} \n table = {caslib=caslib name=name} \n casout = {caslib='casuser' name='dtemp1'} \n ; \n action table.fetch result=r/ \n table={caslib='casuser' name='dtemp1'} \n sortby={{name=id, order='ascending'}}; \n result = r.Fetch[,2]; \n return result; \n end; \n \n /*------------------------------------------*/ \n /* get a record */ \n /*------------------------------------------*/ \n \n function _fetchData(filter, table); \n s = checkAndLoadTable(table.caslib, table.name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||table.caslib||'.'||table.name}; \n return results; \n end; \n wherex = dictTowhere(filter); \n /* wherex = table.caslib||'.'||table.name||'(where=('||wherex||'));'; \n \n destroyTable('casuser', 'input'); \n \n action datastep.runCode r=result status=rc/ \n single='yes' \n code = 'data casuser.input; set ' || wherex||'run;'; \n */ \n \n action table.fetch r = result / \n table={caslib=table.caslib name=table.name where=wherex}; \n \n rows = resultsToDict(result.Fetch); \n return {scenario = rows, table = result.Fetch}; \n \n end; \n\n function destroyTable(caslib,name); \n action table.dropTable/ \n caslib=caslib name=name quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib=caslib source= name||'.sashdat' quiet=TRUE; \n \n return true; \n end; \n \n \n function dictToWhere(filter); \n where =''; \n andbit=' '; \n do k,v over filter; \n if (isString(v) ) then do; \n where = where || andbit || k || ' eq ' || '\"'||v||'\"'; \n end; \n else do; \n where = where || andbit || k || ' eq ' || v ; \n end; \n andbit =' and '; \n end; \n return where; \n end; \n \n function resultsToDict(r); \n casResults = {}; \n i = 1; \n do row over r; \n casResults[i] = row; \n i = i + 1; \n end; \n return casResults; \n end; \n \n function argsToTable(_arg_, caslib, name ); \n action table.droptable/ \n caslib=caslib name=name quiet=TRUE; \n i = 1; \n do key,obj over _arg_; \n columns[i] = key; \n row[i] = obj; \n if ( isString(obj) ) then \n type[i] = 'varchar'; \n else if ( isInteger(obj) ) then \n type[i] = 'int'; \n else type[i] = 'double'; \n i = i + 1; \n end; \n \n data1 = newTable('data1', columns, type, row ); \n \n saveresult data1 casout=name caslib=caslib replace; \n end; \n\n "};e.a={commonCasl:a,casFetchData:o,scoreCasl:i.a}},function(t,e,r){"use strict";var n=r(1),i=r.n(n),o=r(0),a=r.n(o),u=r(2),s=r(3);function c(){return(c=i()(a.a.mark((function t(e,r,n,i,o){var c,f,l,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(c=n,!0===o&&(c=n+" "+s.a.commonCasl()),f=d.length,l=new Array(f>5?f-5:0),p=5;p<f;p++)l[p-5]=d[p];return t.next=5,u.a.apply(void 0,[e,r,c,i].concat(l));case 5:return h=t.sent,t.abrupt("return",h.items().toJS());case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,r,n,i){return c.apply(this,arguments)}},function(t,e,r){"use strict";var n=r(6),i=r.n(n);function o(t){var e="{ ",r=" ";for(var n in t){if(!0===Array.isArray(t[n])){var u=a(t[n]);e=e+r+"".concat(n,"=")+u}else{var s=i()(t[n]);if("object"===s){var c=o(t[n]);e=e+r+"".concat(n,"=")+c}else e=e+r+"".concat(n,"=")+("string"===s?' "'.concat(t[n],'" '):"".concat(t[n]," "))}r=","}return e+="} "}function a(t){for(var e="{",r=" ",n=t.length,u=0;u<n;u++)if(!0===Array.isArray(t[u])){var s=a(t[u]);e=e+r+"".concat(u,"=")+s}else{var c=i()(t[u]);if("object"===c)e=e+r+o(t[u]);else e=e+r+("string"===c?' "'.concat(t[u],'" '):"".concat(t[u]," "));r=","}return e+="}"}e.a=function(t,e){var r;return r=null===t?"{}":!0===Array.isArray(t)?a(t):o(t),"".concat(e," = ").concat(r,";")}},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"c",(function(){return l})),r.d(e,"a",(function(){return h}));var n=r(1),i=r.n(n),o=r(0),a=r.n(o);function u(){return(u=i()(a.a.mark((function t(e,r,n,i){var o,u,s,c,f;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=i.output,u=o.caslib,null!=(s=o.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return s=s.toLowerCase(s),c="\n action table.droptable /\n caslib= '".concat(u,"' name= '").concat(s,"' quiet=true;\n\n action table.deleteSource/\n caslib= '").concat(u,"' source= '").concat(s,".sashdat' quiet=true; \n "),f={action:"sccasl.runcasl",data:{code:c}},t.next=8,e.runAction(r,f);case 8:return f={action:"astore.upload",data:{rstore:{name:"".concat(s),caslib:"".concat(u),replace:!0},store:n}},t.next=11,e.runAction(r,f);case 11:return t.sent,t.abrupt("return","Upload of ".concat(i.source," to ").concat(u,".").concat(s," completed"));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var s=function(t,e,r,n){return u.apply(this,arguments)},c=r(4);function f(){return(f=i()(a.a.mark((function t(e,r,n,i,o){var u,s,f,l,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=i.output,s=u.caslib,null!=(f=u.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return l={casout:{caslib:s,name:f},importOptions:{fileType:i.fileType}},"sas"!==i.fileExt&&"ds2"!==i.fileExt||(l.importOptions.delimiter="\\"),p={headers:{"JSON-Parameters":l,"Content-Type":"binary/octet-stream"},data:n,action:"table.upload"},t.next=8,e.runAction(r,p);case 8:if(!0!==o){t.next=13;break}return h="\n\t\t\taction table.save r = result / \n\t\t\ttable = {caslib='".concat(s,"' name='").concat(f,"'} replace=true\n\t\t\tcaslib='").concat(s,"' name='").concat(f,"';\n\n\t\t\tsend_response(result);\n\t\t\t"),t.next=12,Object(c.a)(e,r,h,null);case 12:t.sent;case 13:return t.abrupt("return","Upload of ".concat(i.source," to ").concat((i.output,s),".").concat(i.output.name," completed"));case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var l=function(t,e,r,n,i){return f.apply(this,arguments)};function p(){return(p=i()(a.a.mark((function t(e,r,n,i){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o={action:"table.save",data:{name:"".concat(i),caslib:"".concat(n),replace:!0,table:{name:"".concat(i),caslib:"".concat(n)}}},t.next=3,e.runAction(r,o);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var h=function(t,e,r,n){return p.apply(this,arguments)}},function(t,e,r){"use strict";var n=r(12),i=r(31),o=/[^\w\s\n\r\v\t\.,]/i;e.version=r(32).version;var a=function(t,e){return void 0!==t||e.renderUndefined},u=function(t,e,r){return"boolean"==typeof t||"number"==typeof t||"function"==typeof t||null==t||t instanceof Date||("string"==typeof t&&-1===t.indexOf("\n")||!(!r.inlineArrays||e||!Array.isArray(t)||!u(t[0],!0,r)))},s=function(t,e){if(e.noColor)return t;if("string"==typeof t)return e.stringColor?n[e.stringColor](t):t;var r=t+"";return!0===t?n.green(r):!1===t?n.red(r):null==t?n.grey(r):"number"==typeof t?t>=0?n[e.positiveNumberColor](r):n[e.negativeNumberColor](r):"function"==typeof t?"function() {}":Array.isArray(t)?t.join(", "):r},c=function(t,e){return null===t.multilineStringColor||t.noColor?e:n[t.multilineStringColor](e)},f=function(t,e,r){var n=t.split("\n");return(n=n.map((function(t){return i.indent(e)+c(r,t)}))).join("\n")},l=function(t,e,r){if("string"==typeof t&&t.match(o)&&e.escape&&(t=JSON.stringify(t)),!a(t,e))return[];if(u(t,!1,e))return[i.indent(r)+s(t,e)];if("string"==typeof t)return[i.indent(r)+c(e,'"""'),f(t,r+e.defaultIndentation,e),i.indent(r)+c(e,'"""')];if(Array.isArray(t)){if(0===t.length)return[i.indent(r)+e.emptyArrayMsg];var p=[];return t.forEach((function(t){if(a(t,e)){var o="- ";e.noColor||(o=n[e.dashColor](o)),o=i.indent(r)+o,u(t,!1,e)?(o+=l(t,e,0)[0],p.push(o)):(p.push(o),p.push.apply(p,l(t,e,r+e.defaultIndentation)))}})),p}if(t instanceof Error)return l({message:t.message,stack:t.stack.split("\n")},e,r);var h,d=e.noAlign?0:i.getMaxIndexLength(t),y=[];return Object.getOwnPropertyNames(t).forEach((function(o){if(a(t[o],e))if(h=o+": ",e.noColor||(h=n[e.keysColor](h)),h=i.indent(r)+h,u(t[o],!1,e)){var s=e.noAlign?0:d-o.length;h+=l(t[o],e,s)[0],y.push(h)}else y.push(h),y.push.apply(y,l(t[o],e,r+e.defaultIndentation))})),y};e.render=function(t,e,r){return r=r||0,(e=e||{}).emptyArrayMsg=e.emptyArrayMsg||"(empty array)",e.keysColor=e.keysColor||"green",e.dashColor=e.dashColor||"green",e.numberColor=e.numberColor||"blue",e.positiveNumberColor=e.positiveNumberColor||e.numberColor,e.negativeNumberColor=e.negativeNumberColor||e.numberColor,e.defaultIndentation=e.defaultIndentation||2,e.noColor=!!e.noColor,e.noAlign=!!e.noAlign,e.escape=!!e.escape,e.renderUndefined=!!e.renderUndefined,e.stringColor=e.stringColor||null,e.multilineStringColor=e.multilineStringColor||null,l(t,e,r).join("\n")},e.renderString=function(t,r,i){var o,a,u="";if("string"!=typeof t||""===t)return"";"{"!==t[0]&&"["!==t[0]&&(a=-1===t.indexOf("{")?t.indexOf("["):-1===t.indexOf("[")||t.indexOf("{")<t.indexOf("[")?t.indexOf("{"):t.indexOf("["),u+=t.substr(0,a)+"\n",t=t.substr(a));try{o=JSON.parse(t)}catch(t){return n.red("Error:")+" Not valid JSON!"}return u+=e.render(o,r,i)}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(33),i=r(34),o=r(35),a=r(37);t.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var s,c=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&h())}function h(){if(!f){var t=u(p);f=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||f||u(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){var n=r(17);t.exports=n},function(t,e){t.exports=function(){return"\n result = runMain(_args_); \n send_response(result); \n /* print result; */\n \n \n function runMain(_args_) ; \n r = {Error= 'No path'}; \n if ( _args_.path eq '/selectors') then do; \n r = selectionLists(_args_.selectors, _args_.table.caslib, _args_.table.name); \n end; \n else if ( _args_.path eq '/contents') then do; \n r = contents(_args_.table.caslib, _args_.table.name); \n end; \n else if (_args_.path eq '/describe') then do; \n r = describeModel(_args_); \n end; \n else if (_args_.path eq '/scenario' ) then do;\n r = fetchData(_args_.filter, _args_.table);\n end;\n else if (_args_.path eq '/score') then do; \n if( exists(_args_, 'modelName') eq false ) then\n modelname = '';\n else modelName =_args_.modelName;\n r = runScoreCode(_args_.model, _args_.scenario, modelName); \n end; \n else do; \n r = {icasResults={Errors = 'Invalid action option specified' || _args_.path}, statusCode=404}; \n end; \n print r;\n if ( r.statusCode ne 0) then do;\n print r.icasResults;\n exit({severity=2,reason=6, status=r.iCasResults.Errors,statusCode=r.statusCode});\n end;\n result = {casResults = r.icasResults}; \n print '***************************************************************'; \n print result; \n print '***************************************************************'; \n return result; \n end; \n \n /*-----------------------------------------*/ \n /* describeModel */ \n /*-----------------------------------------*/ \n \n function describeModel(_args_) ; \n s = checkAndLoadTable(_args_.model.caslib, _args_.model.name); \n if ( s ne true) then do; \n results = {Errors= 'Unable to access ' ||_args_.model.caslib||'.'||_args_.model.name}; \n return {icasResults=results, statusCode=404}; \n end; \n \n mtype = isModel(_args_.model.caslib, _args_.model.name); \n if ( mtype EQ 'astore' ) then do; \n r = astoreDescribe(_args_.model); \n end; \n else if (mtype EQ 'ds' or mtype EQ 'ds2') then do;\n s = checkAndLoadTable(_args_.table.caslib, _args_.table.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||_args_.table.caslib||'.'||_args_.table.name}; \n return {icasResults=results, statusCode=404}; \n end; \n r = contents( _args_.table.caslib, _args_.table.name); \n end; \n return {icasResults= r, statusCode=0} ;\n end; \n \n /*------------------------------------------*/ \n /* astoreDescribe */ \n /*------------------------------------------*/ \n \n function astoreDescribe(model); \n action astore.describe r=result/ \n rstore = { caslib= model.caslib name = model.name }; \n rows = resultsToDict(result.InputVariables); \n return {describe = rows, table = result.InputVariables}; \n end; \n \n /*------------------------------------------*/ \n /* score */ \n /*------------------------------------------*/ \n function runScoreCode( model, scenario, modelName); \n print model; \n s = checkAndLoadTable(model.caslib, model.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||model.caslib||'.'||model.name}; \n return {icasResults=results, statusCode=404}; \n end;\n \n mtype = isModel(model.caslib, model.name); \n \n if ( mtype eq 'bad' ) then do; \n results = {Error= model.caslib||'.'||model.name || ' is not recognized as a valid supported model. Please check your values'};\n return {icasResults=results, statusCode=400};\n end; \n destroyTable('casuser', 'input'); \n argsToTable(scenario, 'casuser', 'input'); \n \n destroyTable('casuser', 'output'); \n \n if (mtype eq 'astore') then do; \n print 'Scoring with astore'; \n action astore.score r = result/ \n rstore = {caslib=model.caslib name=model.name} \n out = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds') then do; \n print 'scoring with datastep code'; \n action datastep.runcodetable r = result/ \n single='YES' \n codeTable= {caslib=model.caslib name=model.name} \n casout = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds2' ) then do; \n print 'Scoring with d2'; \n if ( missing(modelName) eq true) then do;\n results = {Error= 'modelName is missing. Please check your values'};\n return {icasResults=results, statusCode=400};\n end;\n\n action ds2.runModel r = result/ \n modelTable = {caslib=model.caslib, name=model.name} \n modelName = modelName \n table = {caslib= 'casuser', name='input'} \n casOut = {caslib= 'casuser' name='output'}; \n end; \n \n \n action table.fetch r = result / \n table={caslib='casuser' name='output'}; \n \n rows = resultsToDict(result.Fetch); \n \n return {icasResults= rows, statusCode=0} ;\n end; \n \n \n "}},function(t,e,r){"use strict";(function(t){var n=r(10),i=r.n(n),o=r(7);e.a=function(e,r){var n,a=null,u=o.c,s=function(t){return t},c=e.split(".").pop().toLowerCase();switch(c){case"sas7bdat":n="basesas";break;case"sashdat":n="hdat";break;case"csv":n=c,a="UTF8";break;case"xslx":case"xsl":n=c;break;case"astore":case"sasast":n=c,u=o.b,s=function(e){return new t.from(e).toString("base64")};break;case"ds2":case"sas":n="csv",a="UTF8",u=o.c,s=function(t,e){var r=t.replace(/[^\x00-\x7F]/g,"").replace(/\r?\n/g,""),n=e.fileExt;return"modelName\\"+("sas"===n?"dataStepSrc":"ds2"===n?"ds2Src":"casl"===n?"caslSrc":"dataStepsrc")+"\n"+e.output.name+"\\ "+r+"\n"};break;default:throw"Currently file type of ".concat(c," is not supported")}var f=r.split("."),l=i()(f,2);return{source:e,output:{caslib:l[0],name:l[1].toLowerCase()},fileType:n,fileExt:c,fileOptions:a,transform:s,contentType:"binary/octet-stream",handler:u}}}).call(this,r(39).Buffer)},function(t,e,r){t.exports=r(44)},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),a=new S(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return O()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=b(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function l(){}function p(){}function h(){}var d={};u(d,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(E([])));v&&v!==e&&r.call(v,i)&&(d=v);var _=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(i,o){function a(){return new e((function(n,a){!function n(i,o,a,u){var s=c(t[i],t,o);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=h,u(_,"constructor",h),u(h,"constructor",p),p.displayName=u(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,u(t,a,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},m(g.prototype),u(g.prototype,o,(function(){return this})),t.AsyncIterator=g,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new g(s(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(_),u(_,a,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=E,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n={};t.exports=n,n.themes={};var i=r(18),o=n.styles=r(21),a=Object.defineProperties,u=new RegExp(/[\r\n]+/g);n.supportsColor=r(22).supportsColor,void 0===n.enabled&&(n.enabled=!1!==n.supportsColor()),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};n.stylize=function(t,e){if(!n.enabled)return t+"";var r=o[e];return!r&&e in n?n[e](t):r.open+t+r.close};var s=/[|\\{}()[\]^$+*?.]/g;function c(t){var e=function t(){return h.apply(t,arguments)};return e._styles=t,e.__proto__=p,e}var f,l=(f={},o.grey=o.gray,Object.keys(o).forEach((function(t){o[t].closeRe=new RegExp(function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(s,"\\$&")}(o[t].close),"g"),f[t]={get:function(){return c(this._styles.concat(t))}}})),f),p=a((function(){}),l);function h(){var t=Array.prototype.slice.call(arguments),e=t.map((function(t){return null!=t&&t.constructor===String?t:i.inspect(t)})).join(" ");if(!n.enabled||!e)return e;for(var r=-1!=e.indexOf("\n"),a=this._styles,s=a.length;s--;){var c=o[a[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,r&&(e=e.replace(u,(function(t){return c.close+t+c.open})))}return e}n.setTheme=function(t){if("string"!=typeof t)for(var e in t)!function(e){n[e]=function(r){if("object"==typeof t[e]){var i=r;for(var o in t[e])i=n[t[e][o]](i);return i}return n[t[e]](r)}}(e);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var d=function(t,e){var r=e.split("");return(r=r.map(t)).join("")};for(var y in n.trap=r(25),n.zalgo=r(26),n.maps={},n.maps.america=r(27)(n),n.maps.zebra=r(28)(n),n.maps.rainbow=r(29)(n),n.maps.random=r(30)(n),n.maps)!function(t){n[t]=function(e){return d(n.maps[t],e)}}(y);a(n,function(){var t={};return Object.keys(l).forEach((function(e){t[e]={get:function(){return c([e])}}})),t}())},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<o;s=n[++r])y(s)||!b(s)?a+=" "+s:a+=" "+u(s);return a},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,a={};function u(t,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),f(n,t,n.depth)}function s(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return _(i)||(i=f(t,i,n)),i}var o=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(y(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),u=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(S(r)){var s=r.name?": "+r.name:"";return t.stylize("[Function"+s+"]","special")}if(g(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(x(r))return l(r)}var c,b="",E=!1,O=["{","}"];(h(r)&&(E=!0,O=["[","]"]),S(r))&&(b=" [Function"+(r.name?": "+r.name:"")+"]");return g(r)&&(b=" "+RegExp.prototype.toString.call(r)),w(r)&&(b=" "+Date.prototype.toUTCString.call(r)),x(r)&&(b=" "+l(r)),0!==a.length||E&&0!=r.length?n<0?g(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=E?function(t,e,r,n,i){for(var o=[],a=0,u=e.length;a<u;++a)I(e,String(a))?o.push(p(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(t,e,r,n,i,!0))})),o}(t,r,n,u,a):a.map((function(e){return p(t,r,n,u,e,E)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,O)):O[0]+b+O[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,u,s;if((s=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?u=s.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):s.set&&(u=t.stylize("[Setter]","special")),I(n,i)||(a="["+i+"]"),u||(t.seen.indexOf(s.value)<0?(u=y(r)?f(t,s.value,null):f(t,s.value,r-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+u.split("\n").map((function(t){return" "+t})).join("\n")):u=t.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return u;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+u}function h(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return"number"==typeof t}function _(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return b(t)&&"[object RegExp]"===E(t)}function b(t){return"object"==typeof t&&null!==t}function w(t){return b(t)&&"[object Date]"===E(t)}function x(t){return b(t)&&("[object Error]"===E(t)||t instanceof Error)}function S(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(m(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=h,e.isBoolean=d,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=_,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=g,e.isObject=b,e.isDate=w,e.isError=x,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(19);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var t=new Date,e=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",A(),e.format.apply(e,arguments))},e.inherits=r(20),e._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var j="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(j&&t[j]){var e;if("function"!=typeof(e=t[j]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,j,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),j&&Object.defineProperty(e,j,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=j,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,r).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(R,e,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(11))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){var r={};t.exports=r;var n={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(n).forEach((function(t){var e=n[t],i=r[t]=[];i.open="["+e[0]+"m",i.close="["+e[1]+"m"}))},function(t,e,r){"use strict";(function(e){var n=r(23),i=r(24),o=e.env,a=void 0;function u(t){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(function(t){if(!1===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(t&&!t.isTTY&&!0!==a)return 0;var r=a?1:0;if("win32"===e.platform){var u=n.release().split(".");return Number(e.versions.node.split(".")[0])>=8&&Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((function(t){return t in o}))||"codeship"===o.CI_NAME?1:r;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in o){var s=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:(o.TERM,r)}(t))}i("no-color")||i("no-colors")||i("color=false")?a=!1:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=!0),"FORCE_COLOR"in o&&(a=0===o.FORCE_COLOR.length||0!==parseInt(o.FORCE_COLOR,10)),t.exports={supportsColor:u,stdout:u(e.stdout),stderr:u(e.stderr)}}).call(this,r(11))},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},function(t,e,r){"use strict";(function(e){t.exports=function(t,r){var n=(r=r||e.argv).indexOf("--"),i=/^-{1,2}/.test(t)?"":"--",o=r.indexOf(i+t);return-1!==o&&(-1===n||o<n)}}).call(this,r(11))},function(t,e){t.exports=function(t,e){var r="";t=(t=t||"Run the trap, drop the bass").split("");var n={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return t.forEach((function(t){t=t.toLowerCase();var e=n[t]||[" "],i=Math.floor(Math.random()*e.length);r+=void 0!==n[t]?n[t][i]:t})),r}},function(t,e){t.exports=function(t,e){t=t||" he is here ";var r={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},n=[].concat(r.up,r.down,r.mid);function i(t){return Math.floor(Math.random()*t)}function o(t){var e=!1;return n.filter((function(r){e=r===t})),e}return function(t,e){var n,a,u="";for(a in(e=e||{}).up=void 0===e.up||e.up,e.mid=void 0===e.mid||e.mid,e.down=void 0===e.down||e.down,e.size=void 0!==e.size?e.size:"maxi",t=t.split(""))if(!o(a)){switch(u+=t[a],n={up:0,down:0,mid:0},e.size){case"mini":n.up=i(8),n.mid=i(2),n.down=i(8);break;case"maxi":n.up=i(16)+3,n.mid=i(4)+1,n.down=i(64)+3;break;default:n.up=i(8)+1,n.mid=i(6)/2,n.down=i(8)+1}var s=["up","mid","down"];for(var c in s)for(var f=s[c],l=0;l<=n[f];l++)e[f]&&(u+=r[f][i(r[f].length)])}return u}(t,e)}},function(t,e){t.exports=function(t){return function(e,r,n){if(" "===e)return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}},function(t,e){t.exports=function(t){return function(e,r,n){return r%2==0?e:t.inverse(e)}}},function(t,e){t.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return" "===r?r:t[e[n++%e.length]](r)}}},function(t,e){t.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return" "===r?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}},function(t,e,r){"use strict";e.indent=function(t){return new Array(t+1).join(" ")},e.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach((function(r){void 0!==t[r]&&(e=Math.max(e,r.length))})),e}},function(t){t.exports=JSON.parse('{"author":"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)","name":"prettyjson","description":"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output","version":"1.2.5","homepage":"http://rafeca.com/prettyjson","keywords":["json","cli","formatting","colors"],"repository":{"type":"git","url":"https://github.com/rafeca/prettyjson.git"},"bugs":{"url":"https://github.com/rafeca/prettyjson/issues"},"main":"./lib/prettyjson","files":["bin/prettyjson","lib/*.js"],"license":"MIT","scripts":{"test":"npm run jshint && mocha --reporter spec","testwin":"node ./node_modules/mocha/bin/mocha --reporter spec","jshint":"jshint lib/*.js test/*.js","coverage":"istanbul cover _mocha --report lcovonly -- -R spec","coveralls":"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage","changelog":"git log $(git describe --tags --abbrev=0)..HEAD --pretty=\'* %s\' --first-parent"},"bin":{"prettyjson":"./bin/prettyjson"},"dependencies":{"colors":"1.4.0","minimist":"^1.2.0"},"devDependencies":{"coveralls":"^2.11.15","istanbul":"^0.4.5","jshint":"^2.9.4","mocha":"^3.1.2","mocha-lcov-reporter":"^1.2.0","should":"^11.1.1"}}')},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){u=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw i}}return o}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(36);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){},function(t,e,r){"use strict";
2
+ /*!
3
+ * The buffer module from node.js, for the browser.
4
+ *
5
+ * @author Feross Aboukhadijeh <http://feross.org>
6
+ * @license MIT
7
+ */var n=r(40),i=r(41),o=r(42);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=p(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),i=(t=u(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|h(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=u(t,e<0?0:0|h(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|h(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;o<u;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===s)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+s>u&&(r=u-s),o=r;o>=0;o--){for(var l=!0,p=0;p<s;p++)if(c(t,o+p)!==c(e,p)){l=!1;break}if(l)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function b(t,e,r,n){return Y(B(e,t.length-r),t,r,n)}function w(t,e,r,n){return Y(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return w(t,e,r,n)}function S(t,e,r,n){return Y(N(e),t,r,n)}function E(t,e,r,n){return Y(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,u,s,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&c)<<6|63&o)>127&&(f=s);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(s=(15&c)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==Object({}).TYPED_ARRAY_SUPPORT?Object({}).TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),c=this.slice(n,i),f=t.slice(e,r),l=0;l<u;++l)if(c[l]!==f[l]){o=c[l],a=f[l];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return _(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return _(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=U(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function z(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,o){return o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var i=e-t;r=new s(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||T(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||T(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);T(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);T(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=s.isBuffer(t)?t:B(new s(t,n).toString()),u=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%u]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],u=n[1],s=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),f=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;2===u&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,s[f++]=255&e);1===u&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,u=r-i;a<u;a+=16383)o.push(f(t,a,a+16383>u?u:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)n[u]=a[u],i[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,o,a=[],u=e;u<r;u+=3)i=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
8
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
9
+ e.read=function(t,e,r,n,i){var o,a,u=8*i-n-1,s=(1<<u)-1,c=s>>1,f=-7,l=r?i-1:0,p=r?-1:1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=u;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,u,s,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+l>=1?p/s:p*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(e*s-1)*Math.pow(2,i),a+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+h]=255&u,h+=d,u/=256,i-=8);for(a=a<<i|u,c+=i;c>0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){t.exports="object"==typeof self?self.FormData:window.FormData},function(t,e,r){"use strict";r.r(e),r.d(e,"caslRun",(function(){return n.a})),r.d(e,"caslRunBase",(function(){return i.a})),r.d(e,"casSetup",(function(){return w})),r.d(e,"casActionRun",(function(){return S})),r.d(e,"casTableToJson",(function(){return k})),r.d(e,"casFetchData",(function(){return O})),r.d(e,"computeRun",(function(){return T})),r.d(e,"computeSetup",(function(){return M})),r.d(e,"computeSummary",(function(){return I})),r.d(e,"computeFetchData",(function(){return q})),r.d(e,"computeFileContent",(function(){return B})),r.d(e,"findReport",(function(){return Y})),r.d(e,"getReportImage",(function(){return J})),r.d(e,"getReportUri",(function(){return G})),r.d(e,"getSasTableRows",(function(){return V})),r.d(e,"jesSetup",(function(){return Q})),r.d(e,"jesRun",(function(){return it})),r.d(e,"jesSummary",(function(){return X})),r.d(e,"jsonToDict",(function(){return ot.a})),r.d(e,"computeResults",(function(){return L})),r.d(e,"print",(function(){return Mi})),r.d(e,"caslScore",(function(){return y})),r.d(e,"caslDescribe",(function(){return g})),r.d(e,"masSetup",(function(){return lt})),r.d(e,"masAddModel",(function(){return ut})),r.d(e,"masDescribe",(function(){return pt})),r.d(e,"masRun",(function(){return dt})),r.d(e,"masScore",(function(){return vt})),r.d(e,"casUpload",(function(){return Ni})),r.d(e,"uploadData",(function(){return Ji})),r.d(e,"lib",(function(){return Ki}));var n=r(4),i=r(2),o=r(9),a=r.n(o),u=r(1),s=r.n(u),c=r(0),f=r.n(c),l=r(3);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(){return(d=s()(f.a.mark((function t(e,r,n){var o,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.a.commonCasl()+" "+l.a.scoreCasl(),a=h({path:"/score"},n),t.next=4,Object(i.a)(e,r,o,a);case 4:return u=t.sent,s=u.items("results","casResults").toJS()[0],t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var y=function(t,e,r){return d.apply(this,arguments)};function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){a()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(){return(m=s()(f.a.mark((function t(e,r,n){var o,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.a.commonCasl()+" "+l.a.scoreCasl(),a=_({path:"/describe"},n),t.next=4,Object(i.a)(e,r,o,a);case 4:return u=t.sent,s=u.items("results").toJS(),t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var g=function(t,e,r){return m.apply(this,arguments)};function b(){return(b=s()(f.a.mark((function t(e,r){var n,i,o,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=3;break}return t.next=3,e.logon(r);case 3:return t.next=5,e.addServices("casManagement");case 5:return n=t.sent,i=n.casManagement,t.next=9,e.apiCall(i.links("servers"));case 9:if(0!==(o=t.sent).itemsList().size){t.next=12;break}throw{Error:"No cas servers were found"};case 12:return a=o.itemsList(0),t.next=15,e.apiCall(o.itemsCmd(a,"createSession"));case 15:return u=t.sent,t.abrupt("return",{servers:o,session:u});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var w=function(t,e){return b.apply(this,arguments)};function x(){return(x=s()(f.a.mark((function t(e){var r,n,i,o,a=arguments;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=a.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=a[i];return t.next=3,e.runAction.apply(e,n);case 3:return o=t.sent,t.abrupt("return",o.items().toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var S=function(t){return x.apply(this,arguments)};function E(){return(E=s()(f.a.mark((function t(e,r,n){var o,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.a.commonCasl()+" "+l.a.casFetchData(),t.next=3,Object(i.a)(e,r,o,n);case 3:return a=t.sent,t.abrupt("return",a.items("results","casResults").toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var O=function(t,e,r){return E.apply(this,arguments)};var k=function(t,e){var r=t.items("tables",e),n=r.get("rows"),i=[];r.get("schema").map((function(t){i.push(t.get("name"))}));var o=[];return n.map((function(t){var e={};t.map((function(t,r){e[i[r]]=t})),o.push(e)})),o};function A(){return(A=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((i={session:r,log:null,listing:null,ods:null,job:n,tables:{},files:{}}).log=n.links("log"),i.listing=n.links("listing"),null===(o=n.links("results"))){t.next=10;break}return t.next=7,e.apiCall(o);case 7:if(a=t.sent,(u=a.itemsList().size)>0)for(s=0;s<u;s++)c=a.itemsList(s),"ods"===(l=a.items(c,"data","type").toLowerCase())?i.ods=a.itemsCmd(c,"self"):"table"===l?(p={self:a.itemsCmd(c,"self"),current:null},i.tables[c]=p):"file"===l?(h={self:c,current:null,data:null},i.files[c]=h):(d={self:c,current:null,data:null},i[l]=d);case 10:return t.abrupt("return",i);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var I=function(t,e,r){return A.apply(this,arguments)};function j(){return(j=s()(f.a.mark((function t(e,r,n,i,o){var a,u,s,c,l,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="wait",u=null!=o?o:5,"wait"!==i&&null!==i&&(a=Math.max(Math.floor(i/u),1)),s={data:{code:n}},t.next=6,e.apiCall(r.links("execute"),s);case 6:return c=t.sent,t.next=9,e.jobState(c,null,a,u);case 9:if("running"!==(l=t.sent).data){t.next=14;break}throw"ERROR: Job did not complete in allotted time";case 14:return t.next=16,I(e,r,l.job);case 16:return(p=t.sent).SASJobStatus=l.data,t.abrupt("return",p);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var R=function(t,e,r,n,i){return j.apply(this,arguments)};function C(){return(C=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=[],null!=i)for(s in i)c="%let ".concat(s," = ").concat(i[s],";"),u.push(c);return l=n.split(/\r?\n/),u=u.concat(l),t.next=6,R(e,r,u,o,a);case 6:return p=t.sent,t.abrupt("return",p);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var T=function(t,e,r,n,i,o){return C.apply(this,arguments)};function z(){return(z=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=4;break}return t.next=3,e.logon(n);case 3:t.sent;case 4:return t.next=6,e.addServices("compute");case 6:return i=t.sent,o=i.compute,t.next=10,e.apiCall(o.links("contexts"));case 10:if(a=t.sent,null==r&&(r="Job Execution compute"),r=r.toLowerCase(),-1!==(u=a.itemsList().findIndex((function(t){return t.toLowerCase().indexOf(r)>=0})))){t.next=17;break}throw{Error:"Compute Context not found: "+r};case 17:return s=a.itemsCmd(a.itemsList(u),"createSession"),t.next=20,e.apiCall(s);case 20:return c=t.sent,t.abrupt("return",c);case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var M=function(t,e,r){return z.apply(this,arguments)};function D(){return(D=s()(f.a.mark((function t(e,r,n){var i,o,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("log"!==n&&"listing"!==n){t.next=20;break}if(i=[],null===r[n]){t.next=16;break}return t.next=5,e.apiCall(r[n]);case 5:o=t.sent,i=i.concat(o.items().toJS());case 7:if(null===(a=o.scrollCmds("next"))){t.next=14;break}return t.next=10,e.apiCall(a);case 10:o=t.sent,i=i.concat(o.items().toJS()),t.next=7;break;case 14:t.next=17;break;case 16:i[0]="Note: No ".concat(n);case 17:return t.abrupt("return",i);case 20:if("ods"!==n){t.next=31;break}if(null===r.ods){t.next=28;break}return t.next=24,e.apiCall(r.ods);case 24:return u=t.sent,t.abrupt("return",u.items());case 28:return t.abrupt("return","<h2> No ODS output </h2>");case 29:t.next=40;break;case 31:if("tables"!==n){t.next=35;break}return t.abrupt("return",Object.keys(r.tables));case 35:if("files"!==n){t.next=39;break}return t.abrupt("return",Object.keys(r.files));case 39:throw"Error: Invalid type ".concat(n);case 40:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var L=function(t,e,r){return D.apply(this,arguments)};function P(){return(P=s()(f.a.mark((function t(e,r,n,i){var o,a,u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=null,!0!==r.tables.hasOwnProperty(n)){t.next=26;break}if(null!==(a=r.tables[n]).current&&null!=i){t.next=15;break}return t.next=6,e.apiCall(a.self);case 6:return u=t.sent,t.next=9,e.apiCall(u.links("rowSet"));case 9:s=t.sent,a.current=s,c=s.items().toJS(),o={columns:c.columns,rows:c.rows,scrollOptions:s.scrollCmds().keySeq().toJS()},t.next=26;break;case 15:if(l=a.current,p=i,"next"===i&&null===l.scrollCmds("next")&&(p=null!==l.links("last")?"last":null),"prev"===i&&null===l.scrollCmds("prev")&&(p=null!==l.links("first")?"first":null),null===p||null===l.scrollCmds(p)){t.next=26;break}return t.next=22,e.apiCall(l.scrollCmds(p));case 22:h=t.sent,a.current=h,d=h.items().toJS(),o={columns:d.columns,rows:d.rows,scrollOptions:h.scrollCmds().keySeq().toJS()};case 26:return t.abrupt("return",o);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var q=function(t,e,r,n){return P.apply(this,arguments)};function U(){return(U=s()(f.a.mark((function t(e,r,n,i){var o,a,u,s,c,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(o=r.files[n])){t.next=3;break}throw"Invalid fileref ".concat(n);case 3:if(null!==o.current){t.next=12;break}return a={qs:{filter:"eq(name,'".concat(n,"')")}},t.next=7,e.apiCall(r.session.links("files"),a);case 7:return u=t.sent,t.next=10,e.apiCall(u.itemsCmd(n,"self"));case 10:u=t.sent,o.current=u;case 12:if(!0!==i){t.next=17;break}return s="".concat(r.session.host).concat(o.current.links("content","link","uri")),t.abrupt("return",s);case 17:if(null!==o.data){t.next=26;break}return t.next=20,e.apiCall(o.current.links("content"));case 20:return c=t.sent,l=c.items(),o.data=l,t.abrupt("return",l);case 26:return t.abrupt("return",o.data);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var B=function(t,e,r,n){return U.apply(this,arguments)};function N(){return(N=s()(f.a.mark((function t(e,r){var n,i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.getService("reports"),i=null,null!==r&&(i={qs:{filter:"eq(name,'".concat(r,"')")}}),t.next=5,e.apiCall(n.links("reports"),i);case 5:return o=t.sent,t.abrupt("return",0===o.itemsList().size?null:o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Y=function(t,e){return N.apply(this,arguments)};function F(){return(F=s()(f.a.mark((function t(e,r){var n,i,o,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.rafObject("reportImages"),t.next=3,Y(e,r);case 3:if(null!==(i=t.sent)){t.next=6;break}return t.abrupt("return","".concat(r," was not found"));case 6:return o=i.itemsCmd(i.itemsList(0),"self","link","uri"),a={data:{reportUri:o,sectionIndex:0,layoutType:"entireSection",size:"400x400"}},t.next=11,e.apiCall(n.links("createJob"),a);case 11:return u=t.sent,t.next=14,e.jobState(u,{qs:{wait:1.5}},10,2);case 14:if("completed"===(s=t.sent).data){t.next=17;break}return t.abrupt("return","Job failed ".concat(s.data));case 17:return t.next=19,e.apiCall(s.job.itemsCmd(s.job.itemsList(0),"image"));case 19:return c=t.sent,t.abrupt("return",c.items());case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var J=function(t,e){return F.apply(this,arguments)};function K(){return(K=s()(f.a.mark((function t(e,r){var n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Y(e,r);case 2:if(null!==(n=t.sent)){t.next=6;break}throw null==r?"No reports were found":"".concat(r," was not found");case 6:return i=[],n.items().map((function(t,e){var r={name:e,uri:n.itemsCmd(e,"self","link","uri")};i.push(r)})),t.abrupt("return",i);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var G=function(t,e){return K.apply(this,arguments)};function W(){return(W=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c,l,p,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.tables[n],t.next=3,e.apiCall(i);case 3:return o=t.sent,t.next=6,e.apiCall(o.links("rowSet"));case 6:for(a=t.sent,u=a.items("columns"),s=a.items("rows"),c=[],l=s.size,p=function(t){var e=s.get(t),r={};u.map((function(t,n){var i=t.toLowerCase();r[i]=e.get(n)})),c.push(r)},h=0;h<l;h++)p(h);return t.abrupt("return",c);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var V=function(t,e,r){return W.apply(this,arguments)};function H(){return(H=s()(f.a.mark((function t(e,r){var n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=3;break}return t.next=3,e.logon(r);case 3:return t.next=5,e.addServices("jobExecution","compute","jobDefinitions");case 5:return n=t.sent,t.abrupt("return",n.jobExecution);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Q=function(t,e){return H.apply(this,arguments)};function $(){return($=s()(f.a.mark((function t(e,r){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r);case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var X=function(t,e){return $.apply(this,arguments)};function Z(){return(Z=s()(f.a.mark((function t(e,r,n){var i,o,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apiCall(r.links("create"),n);case 2:return i=t.sent,t.next=5,e.jobState(i,null,5,2);case 5:if("running"!==(o=t.sent).data){t.next=10;break}throw"ERROR: Job did not complete in allotted time";case 10:if("failed"!==o.data){t.next=14;break}throw JSON.stringify(o);case 14:return t.next=16,X(e,o.job);case 16:return a=t.sent,t.abrupt("return",a);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var tt=function(t,e,r){return Z.apply(this,arguments)};function et(){return(et=s()(f.a.mark((function t(e,r,n,i,o){var a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a={},u={},null===i){t.next=6;break}return t.next=5,rt(e,i);case 5:a.jobDefinitionUri=t.sent;case 6:return-0!=n&&(u.code=n),u.type="Compute",a.arguments=o,a.jobDefinition=u,s={data:a},t.next=13,tt(e,r,s);case 13:return c=t.sent,t.abrupt("return",c);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function rt(t,e){return nt.apply(this,arguments)}function nt(){return(nt=s()(f.a.mark((function t(e,r){var n,i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.getService("jobDefinitions"),n=null,i={qs:{filter:"eq(name,'".concat(r,"')")}},t.next=5,tt(e,i);case 5:if(0!==(o=t.sent).itemsList().size){t.next=10;break}throw"Error: ".concat(r," not found in the system");case 10:n=o.itemsCmd(r,"self","link","uri");case 11:return t.abrupt("return",n);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var it=function(t,e,r,n,i){return et.apply(this,arguments)},ot=r(5);function at(){return(at=s()(f.a.mark((function t(e,r,n){var i,o,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=r.service,o=0;case 2:if(!(o<n.length)){t.next=12;break}if(a=n[o],null!=r.steps[a]){t.next=9;break}return t.next=7,ct(e,i,a);case 7:u=t.sent,r.steps[a]=u;case 9:o++,t.next=2;break;case 12:return t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ut=function(t,e,r){return at.apply(this,arguments)};function st(){return(st=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={qs:{filter:"eq(name,'".concat(n.trim(),"')")}},t.next=3,e.apiCall(r.links("modules"),i);case 3:if(0!==(o=t.sent).itemsList().size){t.next=6;break}return t.abrupt("return",null);case 6:return a=o.itemsCmd(n,"steps"),t.next=9,e.apiCall(a);case 9:return u=t.sent,s={name:n,stepsRafLink:u,stepIds:o.items(n,"data","stepIds").toJS(),microanalyticScore:r},t.abrupt("return",s);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ct=function(t,e,r){return st.apply(this,arguments)};function ft(){return(ft=s()(f.a.mark((function t(e,r,n){var i,o,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=3;break}return t.next=3,e.logon(n);case 3:return t.next=5,e.addServices("microanalyticScore");case 5:i=t.sent,o=i.microanalyticScore,a={service:o,steps:{}},u=0;case 9:if(!(u<r.length)){t.next=18;break}return s=r[u],t.next=13,ct(e,o,s);case 13:c=t.sent,a.steps[s]=c;case 15:u++,t.next=9;break;case 18:return t.abrupt("return",a);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var lt=function(t,e,r){return ft.apply(this,arguments)};var pt=function(t,e,r){var n=t.steps[e];if(null===n)return[];var i=null;if(null==r){var o=n.stepIds.findIndex((function(t){return"execute"===t||"score"===t}));if(-1===o)return[];i=n.stepIds[o]}else{if(-1===n.stepIds.findIndex((function(t){return t===r})))return[];i=r}var a=n.stepsRafLink.items(i,"data","inputs");return null===a?[]:a.toJS()};function ht(){return(ht=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p,h,d,y,v,_,m,g,b;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=r.steps[n],s=!1,c=[],!1===Array.isArray(i))for(l in i)p={name:l,value:i[l]},c.push(p);else s=!0;if(h={data:{inputs:!0===s?i:c}},d=null,null!=o){t.next=15;break}if(-1!==(y=u.stepIds.findIndex((function(t){return"execute"===t||"score"===t})))){t.next=12;break}return t.abrupt("return",[]);case 12:d=u.stepIds[y];case 13:t.next=21;break;case 15:if(-1!==u.stepIds.findIndex((function(t){return t===o}))){t.next=20;break}return t.abrupt("return",[]);case 20:d=o;case 21:if(null!==(v=u.stepsRafLink.itemsCmd(d,a))){t.next=25;break}return _=[{name:"Error",type:"string",value:"name: ".concat(n," step: ").concat(o," operation: ").concat(a," is an invalid combination")}],t.abrupt("return",_);case 25:return t.next=27,e.apiCall(v,h);case 27:return m=t.sent,g=m.items("outputs").toJS(),!0===s?b=g:(b={},g.map((function(t){b[t.name]=t.value}))),t.abrupt("return",b);case 31:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var dt=function(t,e,r,n,i,o){return ht.apply(this,arguments)};function yt(){return(yt=s()(f.a.mark((function t(e,r,n){var i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,lt(e,[r]);case 2:return i=t.sent,t.next=5,dt(e,i,r,n,"score","execute");case 5:return o=t.sent,t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vt=function(t,e,r){return yt.apply(this,arguments)},_t=r(6),mt=r.n(_t),gt={};function bt(t){t&&(t.value=!0)}function wt(){}function xt(t){return void 0===t.size&&(t.size=t.__iterate(Et)),t.size}function St(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?xt(t)+e:e}function Et(){return!0}function Ot(t,e,r){return(0===t&&!jt(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function kt(t,e){return It(t,e,0)}function At(t,e){return It(t,e,e)}function It(t,e,r){return void 0===t?r:jt(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function jt(t){return t<0||0===t&&1/t==-1/0}function Rt(t){return Boolean(t&&t["@@__IMMUTABLE_ITERABLE__@@"])}function Ct(t){return Boolean(t&&t["@@__IMMUTABLE_KEYED__@@"])}function Tt(t){return Boolean(t&&t["@@__IMMUTABLE_INDEXED__@@"])}function zt(t){return Ct(t)||Tt(t)}var Mt=function(t){return Rt(t)?t:te(t)},Dt=function(t){function e(t){return Ct(t)?t:ee(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Mt),Lt=function(t){function e(t){return Tt(t)?t:re(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Mt),Pt=function(t){function e(t){return Rt(t)&&!zt(t)?t:ne(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Mt);Mt.Keyed=Dt,Mt.Indexed=Lt,Mt.Set=Pt;function qt(t){return Boolean(t&&t["@@__IMMUTABLE_SEQ__@@"])}function Ut(t){return Boolean(t&&t["@@__IMMUTABLE_RECORD__@@"])}function Bt(t){return Rt(t)||Ut(t)}var Nt="@@__IMMUTABLE_ORDERED__@@";function Yt(t){return Boolean(t&&t[Nt])}var Ft="function"==typeof Symbol&&Symbol.iterator,Jt=Ft||"@@iterator",Kt=function(t){this.next=t};function Gt(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function Wt(){return{value:void 0,done:!0}}function Vt(t){return!!Array.isArray(t)||!!$t(t)}function Ht(t){return t&&"function"==typeof t.next}function Qt(t){var e=$t(t);return e&&e.call(t)}function $t(t){var e=t&&(Ft&&t[Ft]||t["@@iterator"]);if("function"==typeof e)return e}Kt.prototype.toString=function(){return"[Iterator]"},Kt.KEYS=0,Kt.VALUES=1,Kt.ENTRIES=2,Kt.prototype.inspect=Kt.prototype.toSource=function(){return this.toString()},Kt.prototype[Jt]=function(){return this};var Xt=Object.prototype.hasOwnProperty;function Zt(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var te=function(t){function e(t){return null==t?se():Bt(t)?t.toSeq():function(t){var e=le(t);if(e)return(n=$t(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=$t(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new oe(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new Kt((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return Gt(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(Mt),ee=function(t){function e(t){return null==t?se().toKeyedSeq():Rt(t)?Ct(t)?t.toSeq():t.fromEntrySeq():Ut(t)?t.toSeq():ce(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(te),re=function(t){function e(t){return null==t?se():Rt(t)?Ct(t)?t.entrySeq():t.toIndexedSeq():Ut(t)?t.toSeq().entrySeq():fe(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(te),ne=function(t){function e(t){return(Rt(t)&&!zt(t)?t:re(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(te);te.isSeq=qt,te.Keyed=ee,te.Set=ne,te.Indexed=re,te.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var ie=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[St(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,i=0;return new Kt((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return Gt(t,o,r[o])}))},e}(re),oe=function(t){function e(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Xt.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var a=n[e?i-++o:o++];if(!1===t(r[a],a,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length,o=0;return new Kt((function(){if(o===i)return{value:void 0,done:!0};var a=n[e?i-++o:o++];return Gt(t,a,r[a])}))},e}(ee);oe.prototype[Nt]=!0;var ae,ue=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=Qt(this._collection),n=0;if(Ht(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=Qt(this._collection);if(!Ht(r))return new Kt(Wt);var n=0;return new Kt((function(){var e=r.next();return e.done?e:Gt(t,n++,e.value)}))},e}(re);function se(){return ae||(ae=new ie([]))}function ce(t){var e=le(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new oe(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function fe(t){var e=le(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function le(t){return Zt(t)?new ie(t):Vt(t)?new ue(t):void 0}function pe(t){return Boolean(t&&t["@@__IMMUTABLE_MAP__@@"])}function he(t){return pe(t)&&Yt(t)}function de(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ye(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(de(t)&&de(e)&&t.equals(e))}var ve="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function _e(t){return t>>>1&1073741824|3221225471&t}var me=Object.prototype.valueOf;function ge(t){if(null==t)return be(t);if("function"==typeof t.hashCode)return _e(t.hashCode(t));var e,r=(e=t).valueOf!==me&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return be(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return _e(e)}(r);case"string":return r.length>Re?function(t){var e=ze[t];void 0===e&&(e=we(t),Te===Ce&&(Te=0,ze={}),Te++,ze[t]=e);return e}(r):we(r);case"object":case"function":return function(t){var e;if(ke&&void 0!==(e=Oe.get(t)))return e;if(void 0!==(e=t[je]))return e;if(!Se){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[je]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=Ee(),ke)Oe.set(t,e);else{if(void 0!==xe&&!1===xe(t))throw new Error("Non-extensible objects are not allowed as keys.");if(Se)Object.defineProperty(t,je,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[je]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[je]=e}}return e}(r);case"symbol":return function(t){var e=Ae[t];if(void 0!==e)return e;return e=Ee(),Ae[t]=e,e}(r);default:if("function"==typeof r.toString)return we(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function be(t){return null===t?1108378658:1108378659}function we(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return _e(e)}var xe=Object.isExtensible,Se=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function Ee(){var t=++Ie;return 1073741824&Ie&&(Ie=0),t}var Oe,ke="function"==typeof WeakMap;ke&&(Oe=new WeakMap);var Ae=Object.create(null),Ie=0,je="__immutablehash__";"function"==typeof Symbol&&(je=Symbol(je));var Re=16,Ce=255,Te=0,ze={},Me=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Be(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=Ue(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e,n){return t(e,n,r)}),e)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(ee);Me.prototype[Nt]=!0;var De=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this,n=0;return e&&xt(this),this._iter.__iterate((function(i){return t(i,e?r.size-++n:n++,r)}),e)},e.prototype.__iterator=function(t,e){var r=this,n=this._iter.__iterator(1,e),i=0;return e&&xt(this),new Kt((function(){var o=n.next();return o.done?o:Gt(t,e?r.size-++i:i++,o.value,o)}))},e}(re),Le=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(1,e);return new Kt((function(){var e=r.next();return e.done?e:Gt(t,e.value,e.value,e)}))},e}(ne),Pe=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){if(e){$e(e);var n=Rt(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(1,e);return new Kt((function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){$e(n);var i=Rt(n);return Gt(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}}))},e}(ee);function qe(t){var e=Ze(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=tr,e.__iterateUncached=function(e,r){var n=this;return t.__iterate((function(t,r){return!1!==e(r,t,n)}),r)},e.__iteratorUncached=function(e,r){if(2===e){var n=t.__iterator(e,r);return new Kt((function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t}))}return t.__iterator(1===e?0:1,r)},e}function Ue(t,e,r){var n=Ze(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,gt);return o===gt?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate((function(t,i,a){return!1!==n(e.call(r,t,i,a),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(2,i);return new Kt((function(){var i=o.next();if(i.done)return i;var a=i.value,u=a[0];return Gt(n,u,e.call(r,a[1],u,t),i)}))},n}function Be(t,e){var r=this,n=Ze(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=qe(t);return e.reverse=function(){return t.flip()},e}),n.get=function(r,n){return t.get(e?r:-1-r,n)},n.has=function(r){return t.has(e?r:-1-r)},n.includes=function(e){return t.includes(e)},n.cacheResult=tr,n.__iterate=function(r,n){var i=this,o=0;return n&&xt(t),t.__iterate((function(t,a){return r(t,e?a:n?i.size-++o:o++,i)}),!n)},n.__iterator=function(n,i){var o=0;i&&xt(t);var a=t.__iterator(2,!i);return new Kt((function(){var t=a.next();if(t.done)return t;var u=t.value;return Gt(n,e?u[0]:i?r.size-++o:o++,u[1],t)}))},n}function Ne(t,e,r,n){var i=Ze(t);return n&&(i.has=function(n){var i=t.get(n,gt);return i!==gt&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,gt);return o!==gt&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var a=this,u=0;return t.__iterate((function(t,o,s){if(e.call(r,t,o,s))return u++,i(t,n?o:u-1,a)}),o),u},i.__iteratorUncached=function(i,o){var a=t.__iterator(2,o),u=0;return new Kt((function(){for(;;){var o=a.next();if(o.done)return o;var s=o.value,c=s[0],f=s[1];if(e.call(r,f,c,t))return Gt(i,n?c:u++,f,o)}}))},i}function Ye(t,e,r,n){var i=t.size;if(Ot(e,r,i))return t;var o=kt(e,i),a=At(r,i);if(o!=o||a!=a)return Ye(t.toSeq().cacheResult(),e,r,n);var u,s=a-o;s==s&&(u=s<0?0:s);var c=Ze(t);return c.size=0===u?u:t.size&&u||void 0,!n&&qt(t)&&u>=0&&(c.get=function(e,r){return(e=St(this,e))>=0&&e<u?t.get(e+o,r):r}),c.__iterateUncached=function(e,r){var i=this;if(0===u)return 0;if(r)return this.cacheResult().__iterate(e,r);var a=0,s=!0,c=0;return t.__iterate((function(t,r){if(!s||!(s=a++<o))return c++,!1!==e(t,n?r:c-1,i)&&c!==u})),c},c.__iteratorUncached=function(e,r){if(0!==u&&r)return this.cacheResult().__iterator(e,r);if(0===u)return new Kt(Wt);var i=t.__iterator(e,r),a=0,s=0;return new Kt((function(){for(;a++<o;)i.next();if(++s>u)return{value:void 0,done:!0};var t=i.next();return n||1===e||t.done?t:Gt(e,s-1,0===e?void 0:t.value[1],t)}))},c}function Fe(t,e,r,n){var i=Ze(t);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var u=!0,s=0;return t.__iterate((function(t,o,c){if(!u||!(u=e.call(r,t,o,c)))return s++,i(t,n?o:s-1,a)})),s},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var u=t.__iterator(2,o),s=!0,c=0;return new Kt((function(){var t,o,f;do{if((t=u.next()).done)return n||1===i?t:Gt(i,c++,0===i?void 0:t.value[1],t);var l=t.value;o=l[0],f=l[1],s&&(s=e.call(r,f,o,a))}while(s);return 2===i?t:Gt(i,o,f,t)}))},i}function Je(t,e){var r=Ct(t),n=[t].concat(e).map((function(t){return Rt(t)?r&&(t=Dt(t)):t=r?ce(t):fe(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&Ct(i)||Tt(t)&&Tt(i))return i}var o=new ie(n);return r?o=o.toKeyedSeq():Tt(t)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),o}function Ke(t,e,r){var n=Ze(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,u=!1;return function t(s,c){s.__iterate((function(o,s){return(!e||c<e)&&Rt(o)?t(o,c+1):(a++,!1===i(o,r?s:a-1,n)&&(u=!0)),!u}),o)}(t,0),a},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=t.__iterator(n,i),a=[],u=0;return new Kt((function(){for(;o;){var t=o.next();if(!1===t.done){var s=t.value;if(2===n&&(s=s[1]),e&&!(a.length<e)||!Rt(s))return r?t:Gt(n,u++,s,t);a.push(o),o=s.__iterator(n,i)}else o=a.pop()}return{value:void 0,done:!0}}))},n}function Ge(t,e,r){e||(e=er);var n=Ct(t),i=0,o=t.toSeq().map((function(e,n){return[n,e,i++,r?r(e,n,t):e]})).valueSeq().toArray();return o.sort((function(t,r){return e(t[3],r[3])||t[2]-r[2]})).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?ee(o):Tt(t)?re(o):ne(o)}function We(t,e,r){if(e||(e=er),r){var n=t.toSeq().map((function(e,n){return[e,r(e,n,t)]})).reduce((function(t,r){return Ve(e,t[1],r[1])?r:t}));return n&&n[0]}return t.reduce((function(t,r){return Ve(e,t,r)?r:t}))}function Ve(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(null==r||r!=r)||n>0}function He(t,e,r,n){var i=Ze(t),o=new ie(r).map((function(t){return t.size}));return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(1,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map((function(t){return t=Mt(t),Qt(i?t.reverse():t)})),a=0,u=!1;return new Kt((function(){var r;return u||(r=o.map((function(t){return t.next()})),u=n?r.every((function(t){return t.done})):r.some((function(t){return t.done}))),u?{value:void 0,done:!0}:Gt(t,a++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Qe(t,e){return t===e?t:qt(t)?e:t.constructor(e)}function $e(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Xe(t){return Ct(t)?Dt:Tt(t)?Lt:Pt}function Ze(t){return Object.create((Ct(t)?ee:Tt(t)?re:ne).prototype)}function tr(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):te.prototype.cacheResult.call(this)}function er(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t<e?-1:0}function rr(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;i<r;i++)n[i]=t[i+e];return n}function nr(t,e){if(!t)throw new Error(e)}function ir(t){nr(t!==1/0,"Cannot perform this action with an infinite size.")}function or(t){if(Zt(t)&&"string"!=typeof t)return t;if(Yt(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}De.prototype.cacheResult=Me.prototype.cacheResult=Le.prototype.cacheResult=Pe.prototype.cacheResult=tr;var ar=Object.prototype.toString;function ur(t){if(!t||"object"!=typeof t||"[object Object]"!==ar.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var r=e,n=Object.getPrototypeOf(e);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===e}function sr(t){return"object"==typeof t&&(Bt(t)||Array.isArray(t)||ur(t))}function cr(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function fr(t,e){return Bt(t)?t.has(e):sr(t)&&Xt.call(t,e)}function lr(t,e,r){return Bt(t)?t.get(e,r):fr(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function pr(t){if(Array.isArray(t))return rr(t);var e={};for(var r in t)Xt.call(t,r)&&(e[r]=t[r]);return e}function hr(t,e){if(!sr(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(Bt(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!Xt.call(t,e))return t;var r=pr(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function dr(t,e,r){if(!sr(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(Bt(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(Xt.call(t,e)&&r===t[e])return t;var n=pr(t);return n[e]=r,n}function yr(t,e,r,n){n||(n=r,r=void 0);var i=function t(e,r,n,i,o,a){var u=r===gt;if(i===n.length){var s=u?o:r,c=a(s);return c===s?r:c}if(!u&&!sr(r))throw new TypeError("Cannot update within non-data-structure value in path ["+n.slice(0,i).map(cr)+"]: "+r);var f=n[i],l=u?gt:lr(r,f,gt),p=t(l===gt?e:Bt(l),l,n,i+1,o,a);return p===l?r:p===gt?hr(r,f):dr(u?e?Vr():{}:r,f,p)}(Bt(t),t,or(e),0,r,n);return i===gt?r:i}function vr(t,e,r){return yr(t,e,gt,(function(){return r}))}function _r(t,e){return vr(this,t,e)}function mr(t,e){return yr(t,e,(function(){return gt}))}function gr(t){return mr(this,t)}function br(t,e,r,n){return yr(t,[e],r,n)}function wr(t,e,r){return 1===arguments.length?t(this):br(this,t,e,r)}function xr(t,e,r){return yr(this,t,e,r)}function Sr(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Or(this,t)}function Er(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Or(this,e,t)}function Or(t,e,r){for(var n=[],i=0;i<e.length;i++){var o=Dt(e[i]);0!==o.size&&n.push(o)}return 0===n.length?t:0!==t.toSeq().size||t.__ownerID||1!==n.length?t.withMutations((function(t){for(var e=r?function(e,n){br(t,n,gt,(function(t){return t===gt?e:r(t,e,n)}))}:function(e,r){t.set(r,e)},i=0;i<n.length;i++)n[i].forEach(e)})):t.constructor(n[0])}function kr(t,e,r){return Ar(t,e,function(t){return function e(r,n,i){return sr(r)&&sr(n)&&(o=n,a=te(r),u=te(o),Tt(a)===Tt(u)&&Ct(a)===Ct(u))?Ar(r,[n],e):t?t(r,n,i):n;var o,a,u}}(r))}function Ar(t,e,r){if(!sr(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(Bt(t))return"function"==typeof r&&t.mergeWith?t.mergeWith.apply(t,[r].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var n=Array.isArray(t),i=t,o=n?Lt:Dt,a=n?function(e){i===t&&(i=pr(i)),i.push(e)}:function(e,n){var o=Xt.call(i,n),a=o&&r?r(i[n],e,n):e;o&&a===i[n]||(i===t&&(i=pr(i)),i[n]=a)},u=0;u<e.length;u++)o(e[u]).forEach(a);return i}function Ir(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return kr(this,t)}function jr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return kr(this,e,t)}function Rr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return yr(this,t,Vr(),(function(t){return Ar(t,e)}))}function Cr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return yr(this,t,Vr(),(function(t){return kr(t,e)}))}function Tr(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function zr(){return this.__ownerID?this:this.__ensureOwner(new wt)}function Mr(){return this.__ensureOwner()}function Dr(){return this.__altered}var Lr=function(t){function e(e){return null==e?Vr():pe(e)&&!Yt(e)?e:Vr().withMutations((function(r){var n=t(e);ir(n.size),n.forEach((function(t,e){return r.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Vr().withMutations((function(e){for(var r=0;r<t.length;r+=2){if(r+1>=t.length)throw new Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Hr(this,t,e)},e.prototype.remove=function(t){return Hr(this,t,gt)},e.prototype.deleteAll=function(t){var e=Mt(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Vr()},e.prototype.sort=function(t){return bn(Ge(this,t))},e.prototype.sortBy=function(t,e){return bn(Ge(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,t.call(e,i,o,r))}))}))},e.prototype.__iterator=function(t,e){return new Jr(this,t,e)},e.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate((function(e){return n++,t(e[1],e[0],r)}),e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Wr(this.size,this._root,t,this.__hash):0===this.size?Vr():(this.__ownerID=t,this.__altered=!1,this)},e}(Dt);Lr.isMap=pe;var Pr=Lr.prototype;Pr["@@__IMMUTABLE_MAP__@@"]=!0,Pr.delete=Pr.remove,Pr.removeAll=Pr.deleteAll,Pr.setIn=_r,Pr.removeIn=Pr.deleteIn=gr,Pr.update=wr,Pr.updateIn=xr,Pr.merge=Pr.concat=Sr,Pr.mergeWith=Er,Pr.mergeDeep=Ir,Pr.mergeDeepWith=jr,Pr.mergeIn=Rr,Pr.mergeDeepIn=Cr,Pr.withMutations=Tr,Pr.wasAltered=Dr,Pr.asImmutable=Mr,Pr["@@transducer/init"]=Pr.asMutable=zr,Pr["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Pr["@@transducer/result"]=function(t){return t.asImmutable()};var qr=function(t,e){this.ownerID=t,this.entries=e};qr.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(ye(r,i[o][0]))return i[o][1];return n},qr.prototype.update=function(t,e,r,n,i,o,a){for(var u=i===gt,s=this.entries,c=0,f=s.length;c<f&&!ye(n,s[c][0]);c++);var l=c<f;if(l?s[c][1]===i:u)return this;if(bt(a),(u||!l)&&bt(o),!u||1!==s.length){if(!l&&!u&&s.length>=en)return function(t,e,r,n){t||(t=new wt);for(var i=new Yr(t,ge(r),[r,n]),o=0;o<e.length;o++){var a=e[o];i=i.update(t,0,void 0,a[0],a[1])}return i}(t,s,n,i);var p=t&&t===this.ownerID,h=p?s:rr(s);return l?u?c===f-1?h.pop():h[c]=h.pop():h[c]=[n,i]:h.push([n,i]),p?(this.entries=h,this):new qr(t,h)}};var Ur=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Ur.prototype.get=function(t,e,r,n){void 0===e&&(e=ge(r));var i=1<<(31&(0===t?e:e>>>t)),o=this.bitmap;return 0==(o&i)?n:this.nodes[Zr(o&i-1)].get(t+5,e,r,n)},Ur.prototype.update=function(t,e,r,n,i,o,a){void 0===r&&(r=ge(n));var u=31&(0===e?r:r>>>e),s=1<<u,c=this.bitmap,f=0!=(c&s);if(!f&&i===gt)return this;var l=Zr(c&s-1),p=this.nodes,h=f?p[l]:void 0,d=Qr(h,t,e+5,r,n,i,o,a);if(d===h)return this;if(!f&&d&&p.length>=rn)return function(t,e,r,n,i){for(var o=0,a=new Array(32),u=0;0!==r;u++,r>>>=1)a[u]=1&r?e[o++]:void 0;return a[n]=i,new Br(t,o+1,a)}(t,p,c,u,d);if(f&&!d&&2===p.length&&$r(p[1^l]))return p[1^l];if(f&&d&&1===p.length&&$r(d))return d;var y=t&&t===this.ownerID,v=f?d?c:c^s:c|s,_=f?d?tn(p,l,d,y):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,a=0;a<n;a++)a===e&&(o=1),i[a]=t[a+o];return i}(p,l,y):function(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),a=0,u=0;u<i;u++)u===e?(o[u]=r,a=-1):o[u]=t[u+a];return o}(p,l,d,y);return y?(this.bitmap=v,this.nodes=_,this):new Ur(t,v,_)};var Br=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Br.prototype.get=function(t,e,r,n){void 0===e&&(e=ge(r));var i=31&(0===t?e:e>>>t),o=this.nodes[i];return o?o.get(t+5,e,r,n):n},Br.prototype.update=function(t,e,r,n,i,o,a){void 0===r&&(r=ge(n));var u=31&(0===e?r:r>>>e),s=i===gt,c=this.nodes,f=c[u];if(s&&!f)return this;var l=Qr(f,t,e+5,r,n,i,o,a);if(l===f)return this;var p=this.count;if(f){if(!l&&--p<nn)return function(t,e,r,n){for(var i=0,o=0,a=new Array(r),u=0,s=1,c=e.length;u<c;u++,s<<=1){var f=e[u];void 0!==f&&u!==n&&(i|=s,a[o++]=f)}return new Ur(t,i,a)}(t,c,p,u)}else p++;var h=t&&t===this.ownerID,d=tn(c,u,l,h);return h?(this.count=p,this.nodes=d,this):new Br(t,p,d)};var Nr=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r};Nr.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(ye(r,i[o][0]))return i[o][1];return n},Nr.prototype.update=function(t,e,r,n,i,o,a){void 0===r&&(r=ge(n));var u=i===gt;if(r!==this.keyHash)return u?this:(bt(a),bt(o),Xr(this,t,e,r,[n,i]));for(var s=this.entries,c=0,f=s.length;c<f&&!ye(n,s[c][0]);c++);var l=c<f;if(l?s[c][1]===i:u)return this;if(bt(a),(u||!l)&&bt(o),u&&2===f)return new Yr(t,this.keyHash,s[1^c]);var p=t&&t===this.ownerID,h=p?s:rr(s);return l?u?c===f-1?h.pop():h[c]=h.pop():h[c]=[n,i]:h.push([n,i]),p?(this.entries=h,this):new Nr(t,this.keyHash,h)};var Yr=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};Yr.prototype.get=function(t,e,r,n){return ye(r,this.entry[0])?this.entry[1]:n},Yr.prototype.update=function(t,e,r,n,i,o,a){var u=i===gt,s=ye(n,this.entry[0]);return(s?i===this.entry[1]:u)?this:(bt(a),u?void bt(o):s?t&&t===this.ownerID?(this.entry[1]=i,this):new Yr(t,this.keyHash,[n,i]):(bt(o),Xr(this,t,e,ge(n),[n,i])))},qr.prototype.iterate=Nr.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===t(r[e?i-n:n]))return!1},Ur.prototype.iterate=Br.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[e?i-n:n];if(o&&!1===o.iterate(t,e))return!1}},Yr.prototype.iterate=function(t,e){return t(this.entry)};var Fr,Jr=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Gr(t._root)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r=e.node,n=e.index++,i=void 0;if(r.entry){if(0===n)return Kr(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Kr(t,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){var o=r.nodes[this._reverse?i-n:n];if(o){if(o.entry)return Kr(t,o.entry);e=this._stack=Gr(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},e}(Kt);function Kr(t,e){return Gt(t,e[0],e[1])}function Gr(t,e){return{node:t,index:0,__prev:e}}function Wr(t,e,r,n){var i=Object.create(Pr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Vr(){return Fr||(Fr=Wr(0))}function Hr(t,e,r){var n,i;if(t._root){var o={value:!1},a={value:!1};if(n=Qr(t._root,t.__ownerID,0,void 0,e,r,o,a),!a.value)return t;i=t.size+(o.value?r===gt?-1:1:0)}else{if(r===gt)return t;i=1,n=new qr(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?Wr(i,n):Vr()}function Qr(t,e,r,n,i,o,a,u){return t?t.update(e,r,n,i,o,a,u):o===gt?t:(bt(u),bt(a),new Yr(e,n,[i,o]))}function $r(t){return t.constructor===Yr||t.constructor===Nr}function Xr(t,e,r,n,i){if(t.keyHash===n)return new Nr(e,n,[t.entry,i]);var o,a=31&(0===r?t.keyHash:t.keyHash>>>r),u=31&(0===r?n:n>>>r),s=a===u?[Xr(t,e,r+5,n,i)]:(o=new Yr(e,n,i),a<u?[t,o]:[o,t]);return new Ur(e,1<<a|1<<u,s)}function Zr(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function tn(t,e,r,n){var i=n?t:rr(t);return i[e]=r,i}var en=8,rn=16,nn=8;function on(t){return Boolean(t&&t["@@__IMMUTABLE_LIST__@@"])}var an=function(t){function e(e){var r=hn();if(null==e)return r;if(on(e))return e;var n=t(e),i=n.size;return 0===i?r:(ir(i),i>0&&i<32?pn(0,i,5,null,new sn(n.toArray())):r.withMutations((function(t){t.setSize(i),n.forEach((function(e,r){return t.set(r,e)}))})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("List [","]")},e.prototype.get=function(t,e){if((t=St(this,t))>=0&&t<this.size){var r=vn(this,t+=this._origin);return r&&r.array[31&t]}return e},e.prototype.set=function(t,e){return function(t,e,r){if((e=St(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations((function(t){e<0?_n(t,e).set(0,r):_n(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=mn(t._capacity)?n=dn(n,t.__ownerID,0,e,r,o):i=dn(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return pn(t._origin,t._capacity,t._level,i,n)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):hn()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){_n(r,0,e+t.length);for(var n=0;n<t.length;n++)r.set(e+n,t[n])}))},e.prototype.pop=function(){return _n(this,0,-1)},e.prototype.unshift=function(){var t=arguments;return this.withMutations((function(e){_n(e,-t.length);for(var r=0;r<t.length;r++)e.set(r,t[r])}))},e.prototype.shift=function(){return _n(this,1)},e.prototype.concat=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++){var i=e[n],o=t("string"!=typeof i&&Vt(i)?i:[i]);0!==o.size&&r.push(o)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(t){r.forEach((function(e){return e.forEach((function(e){return t.push(e)}))}))})):this.constructor(r[0])},e.prototype.setSize=function(t){return _n(this,0,t)},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){for(var i=0;i<r.size;i++)n.set(i,t.call(e,n.get(i),i,r))}))},e.prototype.slice=function(t,e){var r=this.size;return Ot(t,e,r)?this:_n(this,kt(t,r),At(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=ln(this,e);return new Kt((function(){var i=n();return i===fn?{value:void 0,done:!0}:Gt(t,e?--r:r++,i)}))},e.prototype.__iterate=function(t,e){for(var r,n=e?this.size:0,i=ln(this,e);(r=i())!==fn&&!1!==t(r,e?--n:n++,this););return n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?pn(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?hn():(this.__ownerID=t,this.__altered=!1,this)},e}(Lt);an.isList=on;var un=an.prototype;un["@@__IMMUTABLE_LIST__@@"]=!0,un.delete=un.remove,un.merge=un.concat,un.setIn=_r,un.deleteIn=un.removeIn=gr,un.update=wr,un.updateIn=xr,un.mergeIn=Rr,un.mergeDeepIn=Cr,un.withMutations=Tr,un.wasAltered=Dr,un.asImmutable=Mr,un["@@transducer/init"]=un.asMutable=zr,un["@@transducer/step"]=function(t,e){return t.push(e)},un["@@transducer/result"]=function(t){return t.asImmutable()};var sn=function(t,e){this.array=t,this.ownerID=e};sn.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0===this.array.length)return this;var n=r>>>e&31;if(n>=this.array.length)return new sn([],t);var i,o=0===n;if(e>0){var a=this.array[n];if((i=a&&a.removeBefore(t,e-5,r))===a&&o)return this}if(o&&!i)return this;var u=yn(this,t);if(!o)for(var s=0;s<n;s++)u.array[s]=void 0;return i&&(u.array[n]=i),u},sn.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e:0)||0===this.array.length)return this;var n,i=r-1>>>e&31;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((n=o&&o.removeAfter(t,e-5,r))===o&&i===this.array.length-1)return this}var a=yn(this,t);return a.array.splice(i+1),n&&(a.array[i]=n),a};var cn,fn={};function ln(t,e){var r=t._origin,n=t._capacity,i=mn(n),o=t._tail;return a(t._root,t._level,0);function a(t,u,s){return 0===u?function(t,a){var u=a===i?o&&o.array:t&&t.array,s=a>r?0:r-a,c=n-a;c>32&&(c=32);return function(){if(s===c)return fn;var t=e?--c:s++;return u&&u[t]}}(t,s):function(t,i,o){var u,s=t&&t.array,c=o>r?0:r-o>>i,f=1+(n-o>>i);f>32&&(f=32);return function(){for(;;){if(u){var t=u();if(t!==fn)return t;u=null}if(c===f)return fn;var r=e?--f:c++;u=a(s&&s[r],i-5,o+(r<<i))}}}(t,u,s)}}function pn(t,e,r,n,i,o,a){var u=Object.create(un);return u.size=e-t,u._origin=t,u._capacity=e,u._level=r,u._root=n,u._tail=i,u.__ownerID=o,u.__hash=a,u.__altered=!1,u}function hn(){return cn||(cn=pn(0,0,5))}function dn(t,e,r,n,i,o){var a,u=n>>>r&31,s=t&&u<t.array.length;if(!s&&void 0===i)return t;if(r>0){var c=t&&t.array[u],f=dn(c,e,r-5,n,i,o);return f===c?t:((a=yn(t,e)).array[u]=f,a)}return s&&t.array[u]===i?t:(o&&bt(o),a=yn(t,e),void 0===i&&u===a.array.length-1?a.array.pop():a.array[u]=i,a)}function yn(t,e){return e&&t&&e===t.ownerID?t:new sn(t?t.array.slice():[],e)}function vn(t,e){if(e>=mn(t._capacity))return t._tail;if(e<1<<t._level+5){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&31],n-=5;return r}}function _n(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new wt,i=t._origin,o=t._capacity,a=i+e,u=void 0===r?o:r<0?o+r:i+r;if(a===i&&u===o)return t;if(a>=u)return t.clear();for(var s=t._level,c=t._root,f=0;a+f<0;)c=new sn(c&&c.array.length?[void 0,c]:[],n),f+=1<<(s+=5);f&&(a+=f,i+=f,u+=f,o+=f);for(var l=mn(o),p=mn(u);p>=1<<s+5;)c=new sn(c&&c.array.length?[c]:[],n),s+=5;var h=t._tail,d=p<l?vn(t,u-1):p>l?new sn([],n):h;if(h&&p>l&&a<o&&h.array.length){for(var y=c=yn(c,n),v=s;v>5;v-=5){var _=l>>>v&31;y=y.array[_]=yn(y.array[_],n)}y.array[l>>>5&31]=h}if(u<o&&(d=d&&d.removeAfter(n,0,u)),a>=p)a-=p,u-=p,s=5,c=null,d=d&&d.removeBefore(n,0,a);else if(a>i||p<l){for(f=0;c;){var m=a>>>s&31;if(m!==p>>>s&31)break;m&&(f+=(1<<s)*m),s-=5,c=c.array[m]}c&&a>i&&(c=c.removeBefore(n,s,a-f)),c&&p<l&&(c=c.removeAfter(n,s,p-f)),f&&(a-=f,u-=f)}return t.__ownerID?(t.size=u-a,t._origin=a,t._capacity=u,t._level=s,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):pn(a,u,s,c,d)}function mn(t){return t<32?0:t-1>>>5<<5}var gn,bn=function(t){function e(t){return null==t?xn():he(t)?t:xn().withMutations((function(e){var r=Dt(t);ir(r.size),r.forEach((function(t,r){return e.set(r,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):xn()},e.prototype.set=function(t,e){return Sn(this,t,e)},e.prototype.remove=function(t){return Sn(this,t,gt)},e.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],r)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?wn(e,r,t,this.__hash):0===this.size?xn():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Lr);function wn(t,e,r,n){var i=Object.create(bn.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function xn(){return gn||(gn=wn(Vr(),hn()))}function Sn(t,e,r){var n,i,o=t._map,a=t._list,u=o.get(e),s=void 0!==u;if(r===gt){if(!s)return t;a.size>=32&&a.size>=2*o.size?(n=(i=a.filter((function(t,e){return void 0!==t&&u!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=u===a.size-1?a.pop():a.set(u,void 0))}else if(s){if(r===a.get(u)[1])return t;n=o,i=a.set(u,[e,r])}else n=o.set(e,a.size),i=a.set(a.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):wn(n,i)}bn.isOrderedMap=he,bn.prototype[Nt]=!0,bn.prototype.delete=bn.prototype.remove;function En(t){return Boolean(t&&t["@@__IMMUTABLE_STACK__@@"])}var On=function(t){function e(t){return null==t?jn():En(t)?t:jn().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=St(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):In(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&En(e))return e;ir(e.size);var r=this.size,n=this._head;return e.__iterate((function(t){r++,n={value:t,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):In(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):jn()},e.prototype.slice=function(e,r){if(Ot(e,r,this.size))return this;var n=kt(e,this.size);if(At(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):In(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?In(this.size,this._head,t,this.__hash):0===this.size?jn():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new ie(this.toArray()).__iterate((function(e,n){return t(e,n,r)}),e);for(var n=0,i=this._head;i&&!1!==t(i.value,n++,this);)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new ie(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new Kt((function(){if(n){var e=n.value;return n=n.next,Gt(t,r++,e)}return{value:void 0,done:!0}}))},e}(Lt);On.isStack=En;var kn,An=On.prototype;function In(t,e,r,n){var i=Object.create(An);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function jn(){return kn||(kn=In(0))}An["@@__IMMUTABLE_STACK__@@"]=!0,An.shift=An.pop,An.unshift=An.push,An.unshiftAll=An.pushAll,An.withMutations=Tr,An.wasAltered=Dr,An.asImmutable=Mr,An["@@transducer/init"]=An.asMutable=zr,An["@@transducer/step"]=function(t,e){return t.unshift(e)},An["@@transducer/result"]=function(t){return t.asImmutable()};function Rn(t){return Boolean(t&&t["@@__IMMUTABLE_SET__@@"])}function Cn(t){return Rn(t)&&Yt(t)}function Tn(t,e){if(t===e)return!0;if(!Rt(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||Ct(t)!==Ct(e)||Tt(t)!==Tt(e)||Yt(t)!==Yt(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!zt(t);if(Yt(t)){var n=t.entries();return e.every((function(t,e){var i=n.next().value;return i&&ye(i[1],t)&&(r||ye(i[0],e))}))&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var a=!0,u=e.__iterate((function(e,n){if(r?!t.has(e):i?!ye(e,t.get(n,gt)):!ye(t.get(n,gt),e))return a=!1,!1}));return a&&t.size===u}function zn(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Mn(t){if(!t||"object"!=typeof t)return t;if(!Rt(t)){if(!sr(t))return t;t=te(t)}if(Ct(t)){var e={};return t.__iterate((function(t,r){e[r]=Mn(t)})),e}var r=[];return t.__iterate((function(t){r.push(Mn(t))})),r}var Dn=function(t){function e(e){return null==e?Bn():Rn(e)&&!Yt(e)?e:Bn().withMutations((function(r){var n=t(e);ir(n.size),n.forEach((function(t){return r.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Dt(t).keySeq())},e.intersect=function(t){return(t=Mt(t).toArray()).length?Pn.intersect.apply(e(t.pop()),t):Bn()},e.union=function(t){return(t=Mt(t).toArray()).length?Pn.union.apply(e(t.pop()),t):Bn()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return qn(this,this._map.set(t,t))},e.prototype.remove=function(t){return qn(this,this._map.remove(t))},e.prototype.clear=function(){return qn(this,this._map.clear())},e.prototype.map=function(t,e){var r=this,n=!1,i=qn(this,this._map.mapEntries((function(i){var o=i[1],a=t.call(e,o,o,r);return a!==o&&(n=!0),[a,a]}),e));return n?i:this},e.prototype.union=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(r){for(var n=0;n<e.length;n++)t(e[n]).forEach((function(t){return r.add(t)}))})):this.constructor(e[0])},e.prototype.intersect=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.every((function(e){return e.includes(t)}))||n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.subtract=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.some((function(e){return e.includes(t)}))&&n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.sort=function(t){return oi(Ge(this,t))},e.prototype.sortBy=function(t,e){return oi(Ge(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(Pt);Dn.isSet=Rn;var Ln,Pn=Dn.prototype;function qn(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Un(t,e){var r=Object.create(Pn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Bn(){return Ln||(Ln=Un(Vr()))}Pn["@@__IMMUTABLE_SET__@@"]=!0,Pn.delete=Pn.remove,Pn.merge=Pn.concat=Pn.union,Pn.withMutations=Tr,Pn.asImmutable=Mr,Pn["@@transducer/init"]=Pn.asMutable=zr,Pn["@@transducer/step"]=function(t,e){return t.add(e)},Pn["@@transducer/result"]=function(t){return t.asImmutable()},Pn.__empty=Bn,Pn.__make=Un;var Nn,Yn=function(t){function e(t,r,n){if(!(this instanceof e))return new e(t,r,n);if(nr(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<t&&(n=-n),this._start=t,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-t)/n-1)+1),0===this.size){if(Nn)return Nn;Nn=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},e.prototype.get=function(t,e){return this.has(t)?this._start+St(this,t)*this._step:e},e.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},e.prototype.slice=function(t,r){return Ot(t,r,this.size)?this:(t=kt(t,this.size),(r=At(r,this.size))<=t?new e(0,0):new e(this.get(t,this._end),this.get(r,this._end),this._step))},e.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var r=e/this._step;if(r>=0&&r<this.size)return r}return-1},e.prototype.lastIndexOf=function(t){return this.indexOf(t)},e.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},e.prototype.__iterator=function(t,e){var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;return new Kt((function(){if(o===r)return{value:void 0,done:!0};var a=i;return i+=e?-n:n,Gt(t,e?r-++o:o++,a)}))},e.prototype.equals=function(t){return t instanceof e?this._start===t._start&&this._end===t._end&&this._step===t._step:Tn(this,t)},e}(re);function Fn(t,e,r){for(var n=or(e),i=0;i!==n.length;)if((t=lr(t,n[i++],gt))===gt)return r;return t}function Jn(t,e){return Fn(this,t,e)}function Kn(t,e){return Fn(t,e,gt)!==gt}function Gn(){ir(this.size);var t={};return this.__iterate((function(e,r){t[r]=e})),t}Mt.isIterable=Rt,Mt.isKeyed=Ct,Mt.isIndexed=Tt,Mt.isAssociative=zt,Mt.isOrdered=Yt,Mt.Iterator=Kt,zn(Mt,{toArray:function(){ir(this.size);var t=new Array(this.size||0),e=Ct(this),r=0;return this.__iterate((function(n,i){t[r++]=e?[i,n]:n})),t},toIndexedSeq:function(){return new De(this)},toJS:function(){return Mn(this)},toKeyedSeq:function(){return new Me(this,!0)},toMap:function(){return Lr(this.toKeyedSeq())},toObject:Gn,toOrderedMap:function(){return bn(this.toKeyedSeq())},toOrderedSet:function(){return oi(Ct(this)?this.valueSeq():this)},toSet:function(){return Dn(Ct(this)?this.valueSeq():this)},toSetSeq:function(){return new Le(this)},toSeq:function(){return Tt(this)?this.toIndexedSeq():Ct(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return On(Ct(this)?this.valueSeq():this)},toList:function(){return an(Ct(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Qe(this,Je(this,t))},includes:function(t){return this.some((function(e){return ye(e,t)}))},entries:function(){return this.__iterator(2)},every:function(t,e){ir(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!t.call(e,n,i,o))return r=!1,!1})),r},filter:function(t,e){return Qe(this,Ne(this,t,e,!0))},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return ir(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ir(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate((function(n){r?r=!1:e+=t,e+=null!=n?n.toString():""})),e},keys:function(){return this.__iterator(0)},map:function(t,e){return Qe(this,Ue(this,t,e))},reduce:function(t,e,r){return $n(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return $n(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Qe(this,Be(this,!0))},slice:function(t,e){return Qe(this,Ye(this,t,e,!0))},some:function(t,e){return!this.every(ti(t),e)},sort:function(t){return Qe(this,Ge(this,t))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return xt(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,r){var n=Lr().asMutable();return t.__iterate((function(i,o){n.update(e.call(r,i,o,t),0,(function(t){return t+1}))})),n.asImmutable()}(this,t,e)},equals:function(t){return Tn(this,t)},entrySeq:function(){var t=this;if(t._cache)return new ie(t._cache);var e=t.toSeq().map(Zn).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(ti(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate((function(r,i,o){if(t.call(e,r,i,o))return n=[i,r],!1})),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(Et,null,t)},flatMap:function(t,e){return Qe(this,function(t,e,r){var n=Xe(t);return t.toSeq().map((function(i,o){return n(e.call(r,i,o,t))})).flatten(!0)}(this,t,e))},flatten:function(t){return Qe(this,Ke(this,t,!0))},fromEntrySeq:function(){return new Pe(this)},get:function(t,e){return this.find((function(e,r){return ye(r,t)}),void 0,e)},getIn:Jn,groupBy:function(t,e){return function(t,e,r){var n=Ct(t),i=(Yt(t)?bn():Lr()).asMutable();t.__iterate((function(o,a){i.update(e.call(r,o,a,t),(function(t){return(t=t||[]).push(n?[a,o]:o),t}))}));var o=Xe(t);return i.map((function(e){return Qe(t,o(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,gt)!==gt},hasIn:function(t){return Kn(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:Mt(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:Mt(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return ye(e,t)}))},keySeq:function(){return this.toSeq().map(Xn).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return We(this,t)},maxBy:function(t,e){return We(this,e,t)},min:function(t){return We(this,t?ei(t):ni)},minBy:function(t,e){return We(this,e?ei(e):ni,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Qe(this,Fe(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(ti(t),e)},sortBy:function(t,e){return Qe(this,Ge(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Qe(this,function(t,e,r){var n=Ze(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var a=0;return t.__iterate((function(t,i,u){return e.call(r,t,i,u)&&++a&&n(t,i,o)})),a},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var a=t.__iterator(2,i),u=!0;return new Kt((function(){if(!u)return{value:void 0,done:!0};var t=a.next();if(t.done)return t;var i=t.value,s=i[0],c=i[1];return e.call(r,c,s,o)?2===n?t:Gt(n,s,c,t):(u=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(ti(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=Yt(t),r=Ct(t),n=e?1:0;return function(t,e){return e=ve(e,3432918353),e=ve(e<<15|e>>>-15,461845907),e=ve(e<<13|e>>>-13,5),e=ve((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=_e((e=ve(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+ii(ge(t),ge(e))|0}:function(t,e){n=n+ii(ge(t),ge(e))|0}:e?function(t){n=31*n+ge(t)|0}:function(t){n=n+ge(t)|0}),n)}(this))}});var Wn=Mt.prototype;Wn["@@__IMMUTABLE_ITERABLE__@@"]=!0,Wn[Jt]=Wn.values,Wn.toJSON=Wn.toArray,Wn.__toStringMapper=cr,Wn.inspect=Wn.toSource=function(){return this.toString()},Wn.chain=Wn.flatMap,Wn.contains=Wn.includes,zn(Dt,{flip:function(){return Qe(this,qe(this))},mapEntries:function(t,e){var r=this,n=0;return Qe(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Qe(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var Vn=Dt.prototype;Vn["@@__IMMUTABLE_KEYED__@@"]=!0,Vn[Jt]=Wn.entries,Vn.toJSON=Gn,Vn.__toStringMapper=function(t,e){return cr(e)+": "+cr(t)},zn(Lt,{toKeyedSeq:function(){return new Me(this,!1)},filter:function(t,e){return Qe(this,Ne(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Qe(this,Be(this,!1))},slice:function(t,e){return Qe(this,Ye(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=kt(t,t<0?this.count():this.size);var n=this.slice(0,t);return Qe(this,1===r?n:n.concat(rr(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Qe(this,Ke(this,t,!1))},get:function(t,e){return(t=St(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=St(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Qe(this,function(t,e){var r=Ze(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate((function(t){return(!o||!1!==r(e,o++,i))&&!1!==r(t,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(1,n),a=0;return new Kt((function(){return(!i||a%2)&&(i=o.next()).done?i:a%2?Gt(r,a++,e):Gt(r,a++,i.value,i)}))},r}(this,t))},interleave:function(){var t=[this].concat(rr(arguments)),e=He(this.toSeq(),re.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Qe(this,r)},keySeq:function(){return Yn(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Qe(this,Fe(this,t,e,!1))},zip:function(){var t=[this].concat(rr(arguments));return Qe(this,He(this,ri,t))},zipAll:function(){var t=[this].concat(rr(arguments));return Qe(this,He(this,ri,t,!0))},zipWith:function(t){var e=rr(arguments);return e[0]=this,Qe(this,He(this,t,e))}});var Hn=Lt.prototype;Hn["@@__IMMUTABLE_INDEXED__@@"]=!0,Hn[Nt]=!0,zn(Pt,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Qn=Pt.prototype;function $n(t,e,r,n,i,o){return ir(t.size),t.__iterate((function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),o),r}function Xn(t,e){return e}function Zn(t,e){return[e,t]}function ti(t){return function(){return!t.apply(this,arguments)}}function ei(t){return function(){return-t.apply(this,arguments)}}function ri(){return rr(arguments)}function ni(t,e){return t<e?1:t>e?-1:0}function ii(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Qn.has=Wn.includes,Qn.contains=Qn.includes,Qn.keys=Qn.values,zn(ee,Vn),zn(re,Hn),zn(ne,Qn);var oi=function(t){function e(t){return null==t?ci():Cn(t)?t:ci().withMutations((function(e){var r=Pt(t);ir(r.size),r.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Dt(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Dn);oi.isOrderedSet=Cn;var ai,ui=oi.prototype;function si(t,e){var r=Object.create(ui);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function ci(){return ai||(ai=si(xn()))}ui[Nt]=!0,ui.zip=Hn.zip,ui.zipWith=Hn.zipWith,ui.zipAll=Hn.zipAll,ui.__empty=ci,ui.__make=si;var fi=function(t,e){var r;!function(t){if(Ut(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Bt(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var n=function(o){var a=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t),s=i._indices={};i._name=e,i._keys=u,i._defaultValues=t;for(var c=0;c<u.length;c++){var f=u[c];s[f]=c,i[f]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+di(this)+' with property "'+f+'" since that property name is part of the Record API.'):vi(i,f)}}return this.__ownerID=void 0,this._values=an().withMutations((function(t){t.setSize(a._keys.length),Dt(o).forEach((function(e,r){t.set(a._indices[r],e===a._defaultValues[r]?void 0:e)}))})),this},i=n.prototype=Object.create(pi);return i.constructor=n,e&&(n.displayName=e),n};fi.prototype.toString=function(){for(var t,e=di(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+cr(this.get(t));return e+" }"},fi.prototype.equals=function(t){return this===t||t&&yi(this).equals(yi(t))},fi.prototype.hashCode=function(){return yi(this).hashCode()},fi.prototype.has=function(t){return this._indices.hasOwnProperty(t)},fi.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._indices[t],n=this._values.get(r);return void 0===n?this._defaultValues[t]:n},fi.prototype.set=function(t,e){if(this.has(t)){var r=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(r!==this._values&&!this.__ownerID)return hi(this,r)}return this},fi.prototype.remove=function(t){return this.set(t)},fi.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:hi(this,t)},fi.prototype.wasAltered=function(){return this._values.wasAltered()},fi.prototype.toSeq=function(){return yi(this)},fi.prototype.toJS=function(){return Mn(this)},fi.prototype.entries=function(){return this.__iterator(2)},fi.prototype.__iterator=function(t,e){return yi(this).__iterator(t,e)},fi.prototype.__iterate=function(t,e){return yi(this).__iterate(t,e)},fi.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?hi(this,e,t):(this.__ownerID=t,this._values=e,this)},fi.isRecord=Ut,fi.getDescriptiveName=di;var li,pi=fi.prototype;function hi(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function di(t){return t.constructor.displayName||t.constructor.name||"Record"}function yi(t){return ce(t._keys.map((function(e){return[e,t.get(e)]})))}function vi(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){nr(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}function _i(t,e){return Tt(e)?e.toList():Ct(e)?e.toMap():e.toSet()}pi["@@__IMMUTABLE_RECORD__@@"]=!0,pi.delete=pi.remove,pi.deleteIn=pi.removeIn=gr,pi.getIn=Jn,pi.hasIn=Wn.hasIn,pi.merge=Sr,pi.mergeWith=Er,pi.mergeIn=Rr,pi.mergeDeep=Ir,pi.mergeDeepWith=jr,pi.mergeDeepIn=Cr,pi.setIn=_r,pi.update=wr,pi.updateIn=xr,pi.withMutations=Tr,pi.asMutable=zr,pi.asImmutable=Mr,pi[Jt]=pi.entries,pi.toJSON=pi.toObject=Wn.toObject,pi.inspect=pi.toSource=function(){return this.toString()};var mi={version:"4.0.0",Collection:Mt,Iterable:Mt,Seq:te,Map:Lr,OrderedMap:bn,List:an,Stack:On,Set:Dn,OrderedSet:oi,Record:fi,Range:Yn,Repeat:function(t){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this._value=t,this.size=void 0===r?1/0:Math.max(0,r),0===this.size){if(li)return li;li=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},e.prototype.get=function(t,e){return this.has(t)?this._value:e},e.prototype.includes=function(t){return ye(this._value,t)},e.prototype.slice=function(t,r){var n=this.size;return Ot(t,r,n)?this:new e(this._value,At(r,n)-kt(t,n))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(t){return ye(this._value,t)?0:-1},e.prototype.lastIndexOf=function(t){return ye(this._value,t)?this.size:-1},e.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},e.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new Kt((function(){return i===n?{value:void 0,done:!0}:Gt(t,e?n-++i:i++,r._value)}))},e.prototype.equals=function(t){return t instanceof e?ye(this._value,t._value):Tn(t)},e}(re),is:ye,fromJS:function(t,e){return function t(e,r,n,i,o,a){if("string"!=typeof n&&!Bt(n)&&(Zt(n)||Vt(n)||ur(n))){if(~e.indexOf(n))throw new TypeError("Cannot convert circular structure to Immutable");e.push(n),o&&""!==i&&o.push(i);var u=r.call(a,i,te(n).map((function(i,a){return t(e,r,i,a,o,n)})),o&&o.slice());return e.pop(),o&&o.pop(),u}return n}([],e||_i,t,"",e&&e.length>2?[]:void 0,{"":t})},hash:ge,isImmutable:Bt,isCollection:Rt,isKeyed:Ct,isIndexed:Tt,isAssociative:zt,isOrdered:Yt,isValueObject:de,isPlainObject:ur,isSeq:qt,isList:on,isMap:pe,isOrderedMap:he,isStack:En,isSet:Rn,isOrderedSet:Cn,isRecord:Ut,get:lr,getIn:Fn,has:fr,hasIn:Kn,merge:function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Ar(t,e)},mergeDeep:function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return kr(t,e)},mergeWith:function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Ar(e,r,t)},mergeDeepWith:function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return kr(e,r,t)},remove:hr,removeIn:mr,set:dr,setIn:vr,update:br,updateIn:yr},gi={keysColor:"red",dashColor:"bold",stringColor:"red"},bi={keysColor:"cyan",dashColor:"bold",stringColor:"bold"},wi={keysColor:"magenta",dashColor:"black",stringColor:"bold"};var xi=function(t,e){var r=t.items("tablesByName",e);if(null!==r){var n=r.get("rows"),i=[];r.get("schema").map((function(t){i.push(t.get("name"))})),Mi.object(i,"Columns"),Mi.titleLine("Data Rows");var o=n.map((function(t,e){var r={};return t.map((function(t,e){r[i[e]]=t})),r}));Mi.object(o,"Data for ".concat(e))}},Si=r(12),Ei=r.n(Si);function Oi(){return(Oi=s()(f.a.mark((function t(e){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.map((function(t){var e=t.line.replace(/(\r\n|\n|\r)/gm,"");0===e.length&&console.log(" "),"title"===t.type?console.log(Ei.a.bold(e)):console.log(e)})),t.abrupt("return");case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ki=function(t){return Oi.apply(this,arguments)},Ai=r(8),Ii=r.n(Ai);function ji(t){console.log(" ","\n======================================="),console.log(Ii.a.render({title:t},wi)),console.log(" ","=======================================\n")}function Ri(t,e){ji("".concat(e," size: ").concat(t.itemsList().size)),t.itemsList().size>0?zi(t.itemsList().toJS()):zi({info:"List is empty"})}function Ci(t,e){ji("".concat(e," size: ").concat(t.links().size)),t.links().forEach((function(t,e){zi({rel:e})}))}function Ti(t,e){ji("".concat(e," size: ").concat(Ri.size)),zi(t.items().toJS())}function zi(t,e){!function(t,e){e&&ji(e);console.log(Ii.a.render(t,bi))}(mi.Iterable.isIterable(t)?t.toJS():"object"===mt()(t)||Array.isArray(t)?t:{value:t},e)}var Mi={result:function(t,e){t.itemsList().size>0&&Ri(t,"".concat(e,": ItemList")),t.links().size>0&&Ci(t,"".concat(e,": links")),null!==t.items()&&Ti(t,"".concat(e,": items"))},itemsList:Ri,links:Ci,items:Ti,itemsCmd:function(t,e,r){ji("".concat(r," size: ").concat(t.itemsCmd(e).size)),t.itemsCmd(e).forEach((function(t,e){zi({rel:e})}))},object:zi,errMsg:function(t){var e="object"===mt()(t)?t:{Error:t};console.log(Ii.a.render(e,gi))},msg:function(t,e){e&&ji(e),console.log(Ii.a.render(t,bi))},titleLine:ji,casTable:xi,logListLines:ki},Di=r(10),Li=r.n(Di),Pi=r(14),qi=r(7),Ui=r(38).promises;function Bi(){return(Bi=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=Object(Pi.a)(n,i),null==a){t.next=5;break}t.t0=a,t.next=8;break;case 5:return t.next=7,Ui.readFile(n,u.fileOptions);case 7:t.t0=t.sent;case 8:return s=t.t0,null!==u.transform&&(s=u.transform(s,u)),t.next=12,u.handler(e,r,s,u,o);case 12:if(c=t.sent,!0!==o){t.next=18;break}return l=i.split("."),p=Li()(l,2),h=p[0],d=p[1],t.next=17,Object(qi.a)(e,r,h,d);case 17:c=c+"\n"+" ".concat(i," was saved");case 18:return t.abrupt("return",c);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ni=function(t,e,r,n,i,o){return Bi.apply(this,arguments)},Yi=r(43);function Fi(){return(Fi=s()(f.a.mark((function t(e,r,n,i,o,a){var u,s,c,l,p,h,d,y,v,_,m,g,b,w,x;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.addServices("casManagement");case 2:return u=t.sent,s=u.casManagement,t.next=6,o.apiCall(s.links("servers"));case 6:if(0!==(c=t.sent).itemsList().size){t.next=9;break}throw{Error:"No cas servers were found"};case 9:return l=c.itemsList(0),p={qs:{filter:"eq(name,".concat(e,")")}},t.next=13,o.apiCall(c.itemsCmd(l,"caslibs"),p);case 13:return h=t.sent,t.next=16,o.apiCall(h.itemsCmd(e,"tables"));case 16:return d=t.sent,y={qs:{filter:"eq(name, ".concat(r.trim().toUpperCase(),")")}},t.next=20,o.apiCall(h.itemsCmd(e,"tables"),y);case 20:if(1!==(v=t.sent).itemsList().size){t.next=25;break}return _=v.itemsList(0),m=v.items(_,"data","tableReference","tableUri"),t.abrupt("return",m);case 25:return(g=new Yi).append("tableName",r),g.append("format",i),g.append("scope",null==a?"global":a),g.append("containsHeaderRow",!0),g.append("file",n),b={data:g,headers:{"content-type":'multipart/form-data; boundary="----------12345678901234567"'}},t.next=34,o.apiCall(d.links("upload"),b);case 34:return w=t.sent,x=w.items("tableReference","tableUri"),t.abrupt("return",x);case 37:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ji=function(t,e,r,n,i,o){return Fi.apply(this,arguments)};var Ki=function(){return{caslRun:n.a,caslRunBase:i.a,casSetup:w,casActionRun:S,casFetchData:O,computeRun:T,computeSetup:M,computeSummary:I,computeFetchData:q,computeFileContent:B,computeResults:L,findReport:Y,getReportImage:J,getReportUri:G,getSASTableRows:V,jesSetup:Q,jesRun:it,jesSummary:X,jsonToDict:ot.a,casTableToJson:k,caslScore:y,caslDescribe:g,masSetup:lt,masAddModel:ut,masDescribe:pt,masRun:dt,casUpload:Ni,uploadData:Ji}}()}])}));